#!/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 printf "(2) copying systemd daemon\n"; sudo cp $local_d/systemd/* "$systemd_d"; # enable path printf "(3) enabling systemd watcher\n"; 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; printf "\n . install sucessful\n"