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

23 lines
583 B
Bash
Executable File

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