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

23 lines
580 B
Plaintext
Raw Normal View History

2018-10-31 19:04:08 +00:00
#!/bin/bash
exec 1<&-
system_services="cronie"
2020-09-02 19:58:19 +00:00
user_services="redshift swayidle"
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