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

23 lines
579 B
Bash
Executable File

#!/bin/bash
exec 1<&-
system_services="cronie"
user_services="compton redshift"
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