make gamemode stop services
This commit is contained in:
parent
bdfa31f9d5
commit
290aa6a9df
|
@ -0,0 +1,3 @@
|
|||
[custom]
|
||||
start=__on-gamemode start
|
||||
end=__on-gamemode end
|
|
@ -48,10 +48,6 @@ play-vm() {
|
|||
if ! [ -S /tmp/win10.sock ]; then
|
||||
echo "Cannot find spice socket! Is the vm started?"
|
||||
else
|
||||
echo "Stopping services"
|
||||
sudo systemctl stop cronie
|
||||
systemctl --user stop redshift compton wallpaper
|
||||
|
||||
echo "Setup cpuset cgroup for host"
|
||||
sudo cset set -c 0,4 -s system
|
||||
sudo cset proc -m -f root -t system
|
||||
|
@ -68,8 +64,5 @@ play-vm() {
|
|||
sudo bash -c "echo f > /sys/devices/virtual/workqueue/cpumask"
|
||||
# cpuset
|
||||
sudo cset set -d system &>/dev/null
|
||||
# services
|
||||
systemctl --user start redshift compton wallpaper
|
||||
sudo systemctl start cronie
|
||||
fi
|
||||
}
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
#!/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
|
||||
|
Loading…
Reference in New Issue