Skip to content

Instantly share code, notes, and snippets.

@asathoor
Created August 9, 2017 21:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save asathoor/3cbb3db6e04ffa35746ab23128bee7b7 to your computer and use it in GitHub Desktop.
Save asathoor/3cbb3db6e04ffa35746ab23128bee7b7 to your computer and use it in GitHub Desktop.
Appjar GUI for g810-led

Appjar / Python GUI for Logitech g810-led

Dependencies:

Install appjar:

pip install appjar
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# file: tastatur.py
# purpose: a GUI for g810-led
# by: per thykjaer jensen
# license: GPLv3
# DEPENDENCIES
# appjar
# g810-led: https://github.com/MatMoul/g810-led
from appJar import gui # appjar
import subprocess as sub # os commands
import signal
app = gui("G810-led")
app.addLabel("title", "G810 Led Keyboard")
app.setLabelBg("title", "orange")
'''
Button Actions
'''
def btnClick( btn ):
if btn == "All":
color = app.getEntry("hex")
setKbd = sub.call( [ "g810-led", "-a", color ] )
elif btn == "Key":
color = app.getEntry("hex")
key = app.getEntry("key")
setKbd = sub.call( [ "g810-led", "-k", key, color ] )
elif btn == "Keygroup":
color = app.getEntry("hex")
key = app.getEntry("key")
setKbd = sub.call( [ "g810-led", "-g", key, color ] )
elif btn == "Cancel":
app.stop()
'''
Button Panel
'''
app.addLabel("color","Type color HEX")
app.addLabelEntry("hex")
app.addLabel("keyName")
app.addLabel("kgrpork","Add a keygroup or a key")
app.addLabelEntry("key")
app.addButtons(["All","Key","Keygroup","Cancel"],btnClick)
app.go() # loop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment