@@ -2,18 +2,25 @@ echo "----------------------------------------------"
2
2
echo " Crestfallen Git Installer"
3
3
echo " ----------------------------------------------"
4
4
5
+ # vars
6
+ project_dir=/opt/py-crestfallen-git
7
+ me=$( whoami)
8
+
5
9
# initializing project dir
6
- echo " [*] Copying project files to /opt/crestfallen-git ..."
7
- sudo rm -rf /opt/crestfallen-git
8
- project_dir=/opt/crestfallen-git
10
+ echo " [*] Setting up config directory as ~/.config/py-crestfallen-git ..."
11
+ mkdir /home/$( whoami) /.config /home/$( whoami) /.config/py-crestfallen-git
12
+ echo $XAUTHORITY > /home/$( whoami) /.config/py-crestfallen-git/xauth-cred
13
+ touch /home/$( whoami) /.config/py-crestfallen-git/projects
14
+ echo " [*] Copying project files to $project_dir ..."
15
+ sudo rm -rf $project_dir
9
16
sudo mkdir $project_dir
10
17
sudo cp ./crestfallen-git.py ./crestfallen-git.sh ./README.md $project_dir
11
18
12
19
# setup config file for xauthority dump
13
20
echo " [*] Backing up .bash_profile --> .bash_profile.bkp ..."
14
21
cp /home/$( whoami) /.bash_profile /home/$( whoami) /.bash_profile.bkp
15
22
echo " [*] Patching .bash_profile to cache \$ XAUTHORITY ..."
16
- echo " echo \$ XAUTHORITY > .config- cresfallen-git" >> " /home/$( whoami) /.bash_profile"
23
+ echo " echo \$ XAUTHORITY > /home/ $( whoami ) / .config/ cresfallen-git/xauth-cred " >> " /home/$( whoami) /.bash_profile"
17
24
18
25
# backup handler.sh
19
26
echo " [*] Backing up /etc/acpi/handler.sh --> /etc/acpi/hander.sh.bkp ..."
32
39
done < " $input "
33
40
c=$(( c+ 1 ))
34
41
echo " [*] Patching /etc/acpi/handler.sh to intercept power button press ..."
35
- sudo sed -i $c ' i\ ' $project_dir ' /crestfallen-git.sh' /etc/acpi/handler.sh
42
+ sudo sed -i $c ' i\ ' $project_dir ' /crestfallen-git.sh ' $me /etc/acpi/handler.sh
36
43
37
44
# restart acpid
38
45
echo " [*] Restarting acpid.service ..."
0 commit comments