1
0
Fork 0
dotfiles/files/bin/__on-gamemode

23 lines
583 B
Plaintext
Raw Normal View History

2018-10-31 19:04:08 +00:00
#!/bin/bash
exec 1<&-
system_services="cronie"
2018-11-08 04:52:35 +00:00
user_services="compton redshift mpv"
2018-10-31 19:04:08 +00:00
if [[ "$1" == "start" ]]; then
for service in $system_services; do
sudo systemctl stop "$service"
done
for service in $user_services; do
systemctl --user stop "$service"
done
elif [[ "$1" == "end" ]]; then
for service in $system_services; do
systemctl is-enabled "$service" && sudo systemctl start "$service"
done
for service in $user_services; do
systemctl --user is-enabled "$service" && systemctl --user start "$service"
done
fi