Created
August 28, 2021 11:14
-
-
Save dpanter/ecb042f9a4a9932fa5643be0c07e13c6 to your computer and use it in GitHub Desktop.
keyb_rgbsaver.sh - Auto load OpenRGB profiles with xscreensaver
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# keyb_rgbsaver.sh | |
# Automatically mute keyboard RGB when xscreensaver activates, turn back up when deactivating | |
# Created 2021-08-28 | |
# Written for Siduction (Debian sid based distro) | |
# By dpanter https://gist.github.com/dpanter | |
# Requires _xscreensaver_ and _openrgb_ | |
process() { | |
while read input; do | |
case "$input" in | |
# Double openrgb commands needed, sometimes openrgb turns off the keyboard RGB completely | |
# UNBLANK profile is very bright, the other is 5% brightness | |
UNBLANK*) /usr/bin/openrgb -p red-blue.orp && sleep 5 && /usr/bin/openrgb -p red-blue.orp;; | |
BLANK*) /usr/bin/openrgb -p red-blue2.orp && sleep 5 && /usr/bin/openrgb -p red-blue2.orp;; | |
RUN*) /usr/bin/openrgb -p red-blue2.orp && sleep 5 && /usr/bin/openrgb -p red-blue2.orp;; | |
LOCK*) /usr/bin/openrgb -p red-blue2.orp && sleep 5 && /usr/bin/openrgb -p red-blue2.orp;; | |
esac | |
done | |
} | |
/usr/bin/xscreensaver-command -watch | process | |
# Reference: https://bbs.archlinux.org/viewtopic.php?pid=1182514 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment