diff --git a/.config/gnome-settings/elgato/README.md b/.config/gnome-settings/elgato/README.md new file mode 100644 index 0000000..0d9f452 --- /dev/null +++ b/.config/gnome-settings/elgato/README.md @@ -0,0 +1,5 @@ +# Elgato Key Lights + +The Python files in this folder are hooked as keyboard shortcuts in Gnome. +They allow to toggle the key lights in my office. +In the long-run, these scripts should be improved a bit. diff --git a/.config/gnome-settings/elgato/dec_brightness.py b/.config/gnome-settings/elgato/dec_brightness.py new file mode 100755 index 0000000..e3dcaeb --- /dev/null +++ b/.config/gnome-settings/elgato/dec_brightness.py @@ -0,0 +1,12 @@ +#!/usr/bin/env python + +import leglight + +LEFT_KEYLIGHT_IP = "192.168.20.72" +RIGHT_KEYLIGHT_IP = "192.168.20.73" + +left = leglight.LegLight(LEFT_KEYLIGHT_IP, port=9123) +right = leglight.LegLight(RIGHT_KEYLIGHT_IP, port=9123) + +left.decBrightness(5) +right.decBrightness(5) diff --git a/.config/gnome-settings/elgato/inc_brightness.py b/.config/gnome-settings/elgato/inc_brightness.py new file mode 100755 index 0000000..8500c6a --- /dev/null +++ b/.config/gnome-settings/elgato/inc_brightness.py @@ -0,0 +1,12 @@ +#!/usr/bin/env python + +import leglight + +LEFT_KEYLIGHT_IP = "192.168.20.72" +RIGHT_KEYLIGHT_IP = "192.168.20.73" + +left = leglight.LegLight(LEFT_KEYLIGHT_IP, port=9123) +right = leglight.LegLight(RIGHT_KEYLIGHT_IP, port=9123) + +left.incBrightness(5) +right.incBrightness(5) diff --git a/.config/gnome-settings/elgato/toggle_keylights.py b/.config/gnome-settings/elgato/toggle_keylights.py new file mode 100755 index 0000000..286227e --- /dev/null +++ b/.config/gnome-settings/elgato/toggle_keylights.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python + +import leglight + +LEFT_KEYLIGHT_IP = "192.168.20.72" +RIGHT_KEYLIGHT_IP = "192.168.20.73" + +left = leglight.LegLight(LEFT_KEYLIGHT_IP, port=9123) +right = leglight.LegLight(RIGHT_KEYLIGHT_IP, port=9123) + +if left.info()["on"] or right.info()["on"]: + left.off() + right.off() + +else: + left.on() + right.on() + left.brightness(30) + right.brightness(30) + left.color(6000) + right.color(6000) diff --git a/.config/gnome-settings/key-bindings.ini b/.config/gnome-settings/key-bindings.ini index 7daf0bd..f2f58b6 100644 --- a/.config/gnome-settings/key-bindings.ini +++ b/.config/gnome-settings/key-bindings.ini @@ -50,7 +50,7 @@ toggle-tiled-left=@as [] toggle-tiled-right=@as [] [org/gnome/settings-daemon/plugins/media-keys] -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/'] +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/'] email=['e'] help=@as [] home=['f'] @@ -106,6 +106,21 @@ binding='t' command='gnome-terminal' name='Terminal (2)' +[org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom7] +binding='l' +command='/home/alexander/.pyenv/versions/utils/bin/python /home/alexander/.config/gnome-settings/elgato/toggle_keylights.py' +name='Toggle Keylights in the Office' + +[org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom8] +binding='Up' +command='/home/alexander/.pyenv/versions/utils/bin/python /home/alexander/.config/gnome-settings/elgato/inc_brightness.py' +name='Increase Brightness of Keylights in the Office' + +[org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom9] +binding='Down' +command='/home/alexander/.pyenv/versions/utils/bin/python /home/alexander/.config/gnome-settings/elgato/dec_brightness.py' +name='Decrease Brightness of Keylights in the Office' + [org/gnome/shell/extensions/pop-shell] activate-launcher=['d'] pop-workspace-down=['Down'] diff --git a/.config/shell/utils.sh b/.config/shell/utils.sh index 9fef6bf..3429bb0 100644 --- a/.config/shell/utils.sh +++ b/.config/shell/utils.sh @@ -210,7 +210,7 @@ _py2_version='2.7.18' _py3_site_packages=('black' 'pipenv' 'poetry') # The pyenv virtualenv "utils" contains some globally available tools (e.g., mackup) -_py3_utils=('mackup' 'youtube-dl') +_py3_utils=('leglight' 'mackup' 'youtube-dl') # Important: this REMOVES the old ~/.pyenv installation _install_pyenv() {