-
Notifications
You must be signed in to change notification settings - Fork 3
/
win10.sh
24 lines (23 loc) · 919 Bytes
/
win10.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
# Script for win10
if [[ $1 == "win10" ]]; then
if [[ $2 == "started" ]]; then
# CPU isolation
systemctl set-property --runtime -- user.slice AllowedCPUs=0,1,8,9
systemctl set-property --runtime -- system.slice AllowedCPUs=0,1,8,9
systemctl set-property --runtime -- init.scope AllowedCPUs=0,1,8,9
# Disable DVI-D-0
su -l lennard0711 -c "DISPLAY=:0 xrandr --output DVI-D-0 --off"
# Restart barrier
su -l lennard0711 -c ""
fi
if [[ $2 == "stopped" ]]; then
# Free all CPUs
systemctl set-property --runtime -- user.slice AllowedCPUs=0-15
systemctl set-property --runtime -- system.slice AllowedCPUs=0-15
systemctl set-property --runtime -- init.scope AllowedCPUs=0-15
# Enable DVI-D-0
su -l lennard0711 -c "DISPLAY=:0 xrandr --output DVI-D-0 --auto --left-of HDMI-0"
su -l lennard0711 -c "DISPLAY=:0 xrandr --output HDMI-0 --primary"
fi
fi