-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·33 lines (30 loc) · 1.13 KB
/
setup.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
#!/usr/bin/env bash
help() {
echo "$0 [install | uninstall]"
echo " install installs the scripts and immediately enables the user service"
echo " uninstall uninstalls the scripts and immediately disables the user service"
exit 1
}
if [ "$1" == "install" ]; then
mkdir -p "$HOME"/.config/systemd/user
mkdir -p "$HOME"/.local/bin
cp -f on-session-state.service "$HOME"/.config/systemd/user/
cp -f ./*.sh ./*.py "$HOME"/.local/bin/
chmod 0755 \
"$HOME"/.local/bin/{monitor-dbus-session-state,fix-gsync,openrgb-load,on-session}.sh \
"$HOME"/.local/bin/kscreen-id.py
systemctl --user daemon-reload &&
systemctl --user enable --now on-session-state.service
echo "Installed the on-session-state.service unit!"
elif [ "$1" == "uninstall" ]; then
systemctl --user disable --now on-session-state.service
rm -f "$HOME"/.config/systemd/user/on-session-state.service
rm -f \
"$HOME"/.local/bin/{monitor-dbus-session-state,fix-gsync,,openrgb-load,on-session}.sh \
"$HOME"/.local/bin/kscreen-id.py
systemctl --user daemon-reload
echo "Uninstalled the on-session-state.service unit!"
else
help
fi
exit 0