2017-12-28 17:04:24 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
red="\033[38;5;1m"
|
|
|
|
blue="\033[38;5;6m"
|
|
|
|
reset="\033[0;5;0m"
|
|
|
|
|
|
|
|
function check_exec() {
|
|
|
|
if hash $1 2> /dev/null ; then
|
|
|
|
echo $2 is installed
|
|
|
|
else
|
|
|
|
echo -en "$red"
|
|
|
|
echo $2 is not installed or not in PATH
|
|
|
|
echo Exiting ...
|
|
|
|
echo -en "$reset"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
echo -e "${blue}Checking Dependencies $reset"
|
|
|
|
|
2018-04-01 22:26:25 +02:00
|
|
|
check_exec jq jq
|
|
|
|
check_exec curl curl
|
2017-12-28 17:04:24 +01:00
|
|
|
check_exec i3lock i3lock-color
|
|
|
|
check_exec convert Imagemagick
|
|
|
|
|
|
|
|
echo -e "${blue}Dependencies Satisfied $reset \n"
|
|
|
|
|
|
|
|
echo -e "${blue}Checking repository location $reset"
|
|
|
|
cd $HOME/i3lock-delta
|
|
|
|
if [[ $? -ne 0 ]]; then
|
|
|
|
echo -e "$red Please clone the repo in your home folder $reset"
|
|
|
|
exit
|
|
|
|
else
|
|
|
|
echo "OK"
|
|
|
|
fi
|
|
|
|
echo -e "${blue}Checked repository location $reset \n"
|
|
|
|
|
|
|
|
echo -e "${blue}Creating Required Files$reset"
|
|
|
|
|
|
|
|
mkdir -p $HOME/.config
|
|
|
|
echo 1 > $HOME/.config/lock_screen.sta
|
|
|
|
> $HOME/.config/lock_preferences
|
|
|
|
|
2017-12-29 06:29:39 +01:00
|
|
|
read x y <<<$(xdpyinfo | awk -F'[ x]+' '/dimensions:/{print $3, $4}')
|
2017-12-28 18:04:17 +01:00
|
|
|
> box_config
|
2017-12-29 06:29:39 +01:00
|
|
|
echo "BOX_TOP_LEFT_X=10" >> box_config
|
|
|
|
echo "BOX_TOP_LEFT_Y=$(($y-160))" >> box_config
|
|
|
|
echo "BOX_BOTTOM_RIGHT_X=410" >> box_config
|
|
|
|
echo "BOX_BOTTOM_RIGHT_Y=$(($y-50))" >> box_config
|
|
|
|
echo "ROUNDENESS=50" >> box_config
|
|
|
|
echo "NAME_X=$(( $x / 3 ))" >> box_config
|
|
|
|
echo "NAME_Y=17" >> box_config
|
2017-12-28 17:04:24 +01:00
|
|
|
echo -e "${blue}Finished Creating Required Files $reset \n"
|
|
|
|
echo -e "${blue}Installation Successful $reset"
|
|
|
|
echo -e "${blue}To set your random lock image themes, edit ~/.config/lock_preferences and enter your themes one per line."
|