serverroom-components/boinc/screenlock.sh

11 lines
423 B
Bash
Raw Normal View History

2024-11-24 19:06:27 +00:00
#!/bin/bash
# If screen is locked (GNOME Screensaver true), enable GPU computing. Otherwise disable GPU computing.
dbus-monitor --session "type='signal',interface='org.gnome.ScreenSaver'" |
while read x; do
case "$x" in
*"boolean true"*) boinccmd --set_gpu_mode always && echo "GPU Computing Enabled";;
*"boolean false"*) boinccmd --set_gpu_mode never && echo "GPU Computing Disabled";;
esac
done