From e98a39091ecf84d827580b171219139112ce1fc2 Mon Sep 17 00:00:00 2001 From: Alexander Hess Date: Mon, 8 May 2023 13:47:22 +0200 Subject: [PATCH] Adjust keyboard shortcuts for the Elgato Key Lights - add keyboard shortcuts to increase/decrease the color temperature - simplify (i.e., unify) all the shortcuts to only come in one variant --- .config/gnome-settings/elgato/dec_color.py | 12 +++++++ .config/gnome-settings/elgato/inc_color.py | 12 +++++++ .config/gnome-settings/key-bindings.ini | 39 ++++++++++------------ 3 files changed, 41 insertions(+), 22 deletions(-) create mode 100755 .config/gnome-settings/elgato/dec_color.py create mode 100755 .config/gnome-settings/elgato/inc_color.py diff --git a/.config/gnome-settings/elgato/dec_color.py b/.config/gnome-settings/elgato/dec_color.py new file mode 100755 index 0000000..c21a899 --- /dev/null +++ b/.config/gnome-settings/elgato/dec_color.py @@ -0,0 +1,12 @@ +#!/usr/bin/env python + +import leglight + +LEFT_KEYLIGHT_IP = "192.168.190.62" +RIGHT_KEYLIGHT_IP = "192.168.190.63" + +left = leglight.LegLight(LEFT_KEYLIGHT_IP, port=9123) +right = leglight.LegLight(RIGHT_KEYLIGHT_IP, port=9123) + +left.decColor(200) +right.decColor(200) diff --git a/.config/gnome-settings/elgato/inc_color.py b/.config/gnome-settings/elgato/inc_color.py new file mode 100755 index 0000000..9105b9e --- /dev/null +++ b/.config/gnome-settings/elgato/inc_color.py @@ -0,0 +1,12 @@ +#!/usr/bin/env python + +import leglight + +LEFT_KEYLIGHT_IP = "192.168.190.62" +RIGHT_KEYLIGHT_IP = "192.168.190.63" + +left = leglight.LegLight(LEFT_KEYLIGHT_IP, port=9123) +right = leglight.LegLight(RIGHT_KEYLIGHT_IP, port=9123) + +left.incColor(200) +right.incColor(200) diff --git a/.config/gnome-settings/key-bindings.ini b/.config/gnome-settings/key-bindings.ini index 9383745..1386835 100644 --- a/.config/gnome-settings/key-bindings.ini +++ b/.config/gnome-settings/key-bindings.ini @@ -96,7 +96,7 @@ magnifier-zoom-out=@as [] on-screen-keyboard=@as [] screenreader=@as [] -custom-keybindings=['/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom3/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom4/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom5/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom6/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom7/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom8/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom9/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom10/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom11/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom12/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom13/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom14/'] +custom-keybindings=['/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom3/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom4/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom5/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom6/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom7/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom8/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom9/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom10/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom11/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom12/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom13/'] [org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0] binding='Home' @@ -142,36 +142,31 @@ command='alacritty' name='Terminal (3)' [org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom8] -binding='L' -command='/home/alexander/.local/share/elgato/bin/python /home/alexander/.config/gnome-settings/elgato/toggle_keylights.py' -name='Toggle Keylights in the Office (1)' - -[org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom9] binding='L' command='/home/alexander/.local/share/elgato/bin/python /home/alexander/.config/gnome-settings/elgato/toggle_keylights.py' -name='Toggle Keylights in the Office (2)' +name='Toggle Keylights in the Office' -[org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom10] -binding='Apostrophe' -command='/home/alexander/.local/share/elgato/bin/python /home/alexander/.config/gnome-settings/elgato/inc_brightness.py' -name='Increase Brightness of Keylights in the Office (1)' - -[org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom11] +[org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom9] binding='Apostrophe' command='/home/alexander/.local/share/elgato/bin/python /home/alexander/.config/gnome-settings/elgato/inc_brightness.py' -name='Increase Brightness of Keylights in the Office (2)' +name='Increase Brightness of Keylights in the Office' -[org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom12] -binding='Semicolon' -command='/home/alexander/.local/share/elgato/bin/python /home/alexander/.config/gnome-settings/elgato/dec_brightness.py' -name='Decrease Brightness of Keylights in the Office (1)' - -[org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom13] +[org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom10] binding='Semicolon' command='/home/alexander/.local/share/elgato/bin/python /home/alexander/.config/gnome-settings/elgato/dec_brightness.py' -name='Decrease Brightness of Keylights in the Office (2)' +name='Decrease Brightness of Keylights in the Office' -[org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom14] +[org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom11] +binding='Bracketright' +command='/home/alexander/.local/share/elgato/bin/python /home/alexander/.config/gnome-settings/elgato/inc_color.py' +name='Increase Color of Keylights in the Office' + +[org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom12] +binding='Bracketleft' +command='/home/alexander/.local/share/elgato/bin/python /home/alexander/.config/gnome-settings/elgato/dec_color.py' +name='Decrease Color of Keylights in the Office' + +[org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom13] binding='U' command='/usr/bin/flatpak run com.spotify.Client' name='Spotify'