xlock/install.sh

25 lines
641 B
Bash
Raw Normal View History

2019-03-02 18:47:03 +00:00
#!/bin/bash
user=`whoami`
local_d="$(realpath `dirname $0`)";
bin_d="/usr/sbin/";
systemd_d="/usr/lib/systemd/system";
# copy lock script
printf "(1) copying xlock executable\n";
sudo cp "$local_d/src/xlock" "$bin_d/xlock";
sudo chmod +x "$bin_d/xlock";
# copy systemd files
2019-03-03 13:01:16 +00:00
printf "(2) copying systemd daemon\n";
2019-03-02 18:47:03 +00:00
sudo cp $local_d/systemd/* "$systemd_d";
# enable path
printf "(3) enabling systemd watcher\n";
2019-03-03 13:01:16 +00:00
sudo systemctl enable "xlock@$user.service" > /dev/null 2>&1;
# sudo systemctl enable "xlock@$user.path" > /dev/null 2>&1;
# reload systemd if not first install
sudo systemctl daemon-reload;
2019-03-02 18:47:03 +00:00
printf "\n . install sucessful\n"