Add keyboard shortcuts for Elgato key lights
- create Gnome keyboard shortcuts to manage the Elgato key lights: + toggle + increase and decrease brightness - we use Python scripts in ~/.config/gnome-settings/elgato based on the "leglight" PIP package (Source: https://gitlab.com/obviate.io/pyleglight)
This commit is contained in:
parent
9bc310ff9f
commit
337bebbb0c
6 changed files with 67 additions and 2 deletions
5
.config/gnome-settings/elgato/README.md
Normal file
5
.config/gnome-settings/elgato/README.md
Normal file
|
@ -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.
|
12
.config/gnome-settings/elgato/dec_brightness.py
Executable file
12
.config/gnome-settings/elgato/dec_brightness.py
Executable file
|
@ -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)
|
12
.config/gnome-settings/elgato/inc_brightness.py
Executable file
12
.config/gnome-settings/elgato/inc_brightness.py
Executable file
|
@ -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)
|
21
.config/gnome-settings/elgato/toggle_keylights.py
Executable file
21
.config/gnome-settings/elgato/toggle_keylights.py
Executable file
|
@ -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)
|
|
@ -50,7 +50,7 @@ toggle-tiled-left=@as []
|
||||||
toggle-tiled-right=@as []
|
toggle-tiled-right=@as []
|
||||||
|
|
||||||
[org/gnome/settings-daemon/plugins/media-keys]
|
[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=['<Super>e']
|
email=['<Super>e']
|
||||||
help=@as []
|
help=@as []
|
||||||
home=['<Super>f']
|
home=['<Super>f']
|
||||||
|
@ -106,6 +106,21 @@ binding='<Super>t'
|
||||||
command='gnome-terminal'
|
command='gnome-terminal'
|
||||||
name='Terminal (2)'
|
name='Terminal (2)'
|
||||||
|
|
||||||
|
[org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom7]
|
||||||
|
binding='<Shift><Control>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='<Shift><Control>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='<Shift><Control>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]
|
[org/gnome/shell/extensions/pop-shell]
|
||||||
activate-launcher=['<Super>d']
|
activate-launcher=['<Super>d']
|
||||||
pop-workspace-down=['<Primary><Alt>Down']
|
pop-workspace-down=['<Primary><Alt>Down']
|
||||||
|
|
|
@ -210,7 +210,7 @@ _py2_version='2.7.18'
|
||||||
_py3_site_packages=('black' 'pipenv' 'poetry')
|
_py3_site_packages=('black' 'pipenv' 'poetry')
|
||||||
|
|
||||||
# The pyenv virtualenv "utils" contains some globally available tools (e.g., mackup)
|
# 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
|
# Important: this REMOVES the old ~/.pyenv installation
|
||||||
_install_pyenv() {
|
_install_pyenv() {
|
||||||
|
|
Loading…
Reference in a new issue