-
Notifications
You must be signed in to change notification settings - Fork 3
/
install.sh
executable file
·37 lines (32 loc) · 1.17 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
FILEPATH_R=$(readlink -f "reTheme")
FILEPATH_S=$(readlink -f "slick-pywal")
ln -sf "$FILEPATH_R" /usr/local/bin/reTheme
ln -sf "$FILEPATH_S" /usr/local/bin/slick-pywal
# make the directory for the lightdm background image with the correct permissions.
if ! [ -d /usr/share/wallpapers ]; then
mkdir /usr/share/wallpapers
fi
chmod 777 /usr/share/wallpapers
# generate the config for slick-greeter if it doesn't already exist
slickconf="/etc/lightdm/slick-greeter.conf"
# if the file doesnt exist, generate the most basic config.
if ! [[ -f $slickconf ]]; then
touch $slickconf
echo "[Greeter]" >> $slickconf
echo "background=/usr/share/wallpapers/wal" >> $slickconf
# if the file exists, insert or change background=/usr/share/wallpapers/wal in the right place.
else
if grep -Fxq "[Greeter]" $slickconf
then
if grep -Fq "background" $slickconf
then
sed -i.slickbk "s/background=.*/background=\/usr\/share\/wallpapers\/wal/g" $slickconf
else
sed -i.slickb '/\[Greeter\]/a background=\/usr\/share\/wallpapers\/wal/' $slickconf
fi
else
echo "[Greeter]" >> $slickconf
echo "background=/usr/share/wallpapers/wal" >> $slickconf
fi
fi