From d216c70fa7ae8f5795874db3ee7afa0cf688c9a4 Mon Sep 17 00:00:00 2001 From: perremba <34656608+perremba@users.noreply.github.com> Date: Thu, 3 May 2018 01:55:33 +0200 Subject: [PATCH 1/5] correct indent (tab mixed with spaces) This program should not have worked as is : There was a tab instead of spaces in line 50 There are others after line 145 which shouldn't have caused problems since they were consistent, however, I also changed them because they were not in accord with the rest of the code, nor with pep8 style recommendation. --- main.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/main.py b/main.py index a1afc13..138aff8 100644 --- a/main.py +++ b/main.py @@ -47,7 +47,7 @@ def sendCycle(self): myG = G213Colors myG.connectG() myG.sendCycleCommand(self.sbGetValue(self.sbCycle)) - myG.saveData(myG.cycleCommand.format(str(format(self.sbGetValue(self.sbCycle), '04x')))) + myG.saveData(myG.cycleCommand.format(str(format(self.sbGetValue(self.sbCycle), '04x')))) myG.disconnectG() def sendSegments(self): @@ -142,18 +142,18 @@ def __init__(self): if "-t" in option: - myG = G213Colors - myG.connectG() - file = open(myG.confFile, "r") - commands = file.readline().split(',') - for command in commands: - print command - myG.sendData(command) - sleep(0.01) - - myG.disconnectG() - sys.exit(0) - + myG = G213Colors + myG.connectG() + file = open(myG.confFile, "r") + commands = file.readline().split(',') + for command in commands: + print command + myG.sendData(command) + sleep(0.01) + + myG.disconnectG() + sys.exit(0) +but win = Window() win.connect("delete-event", Gtk.main_quit) win.show_all() From 8cd5e6453ad0a4f1b157aae892c32ace6687fc68 Mon Sep 17 00:00:00 2001 From: Aaron Echols Date: Sun, 12 Aug 2018 00:08:27 -0700 Subject: [PATCH 2/5] NameError: name 'but' is not defined Remove undefined statement --- main.py | 1 - 1 file changed, 1 deletion(-) diff --git a/main.py b/main.py index 138aff8..2ad6517 100644 --- a/main.py +++ b/main.py @@ -153,7 +153,6 @@ def __init__(self): myG.disconnectG() sys.exit(0) -but win = Window() win.connect("delete-event", Gtk.main_quit) win.show_all() From ddc58e5ca203b871d38c0cc1be85669fc749d282 Mon Sep 17 00:00:00 2001 From: Jeroen De Meerleer Date: Sat, 28 Sep 2019 19:13:52 +0200 Subject: [PATCH 3/5] Using polkit instead of gksudo --- G213Colors.desktop | 2 +- be.jeroened.pkexec.g213colors.policy | 19 +++++++++++++++++++ makefile | 2 ++ 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 be.jeroened.pkexec.g213colors.policy diff --git a/G213Colors.desktop b/G213Colors.desktop index 916ae5c..36b6836 100755 --- a/G213Colors.desktop +++ b/G213Colors.desktop @@ -1,6 +1,6 @@ [Desktop Entry] Name=G213 Colors -Exec=gksudo g213colors-gui +Exec=pkexec g213colors-gui Comment=A gui to change the key colors on a Logitech G213 Prodigy Gaming Keyboard Icon=g213colors Type=Application diff --git a/be.jeroened.pkexec.g213colors.policy b/be.jeroened.pkexec.g213colors.policy new file mode 100644 index 0000000..fe10cab --- /dev/null +++ b/be.jeroened.pkexec.g213colors.policy @@ -0,0 +1,19 @@ + + + + + + Authentication is required to run G213 Colors + g213colors + + auth_admin + auth_admin + auth_admin + + /usr/bin/g213colors-gui + true + + + \ No newline at end of file diff --git a/makefile b/makefile index 393311f..38613e7 100644 --- a/makefile +++ b/makefile @@ -12,6 +12,7 @@ install : cp icons/G213Colors-128.png /usr/share/icons/hicolor/128x128/apps/g213colors.png cp icons/G213Colors-192.png /usr/share/icons/hicolor/192x192/apps/g213colors.png cp G213Colors.desktop /usr/share/applications/g213colors.desktop + cp be.jeroened.pkexec.g213colors.policy /usr/share/polkit-1/actions/ gtk-update-icon-cache -q /usr/share/icons/hicolor/ systemctl daemon-reload uninstall : @@ -26,5 +27,6 @@ uninstall : rm /usr/share/icons/hicolor/128x128/apps/g213colors.png rm /usr/share/icons/hicolor/192x192/apps/g213colors.png rm /usr/share/applications/g213colors.desktop + rm /usr/share/polkit-1/actions/be.jeroened.pkexec.g213colors.policy gtk-update-icon-cache -q /usr/share/icons/hicolor/ systemctl daemon-reload From a7d8e241eaad6bfa51e0ca335130110208bafa74 Mon Sep 17 00:00:00 2001 From: Michael L Date: Sat, 21 Nov 2020 12:12:11 -0600 Subject: [PATCH 4/5] Create g213colors.openrc --- g213colors.openrc | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 g213colors.openrc diff --git a/g213colors.openrc b/g213colors.openrc new file mode 100644 index 0000000..e59a513 --- /dev/null +++ b/g213colors.openrc @@ -0,0 +1,11 @@ +#!/sbin/openrc-run + +# https://github.com/goose121/initify systemd to openrc conversion perl script. +#opernrc service unit for g213colors + +command=/usr/bin/g213colors-gui +command_args="-t" +pidfile= + +name="g213colors" +description="Start G213Colors profile" From bb5183e9461fc10fc27ecf0e3314a4bcb024ef0c Mon Sep 17 00:00:00 2001 From: Michael L Date: Mon, 23 Nov 2020 19:19:51 -0600 Subject: [PATCH 5/5] Update makefile --- makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/makefile b/makefile index 38613e7..6a1d22e 100644 --- a/makefile +++ b/makefile @@ -3,6 +3,7 @@ install : cp main.py /usr/bin/g213colors-gui cp default.conf /etc/G213Colors.conf cp g213colors.service /etc/systemd/system/g213colors.service + cp g213colors.openrc /etc/init.d/g213colors chmod +x /usr/bin/G213Colors.py chmod +x /usr/bin/g213colors-gui cp icons/G213Colors-16.png /usr/share/icons/hicolor/16x16/apps/g213colors.png @@ -20,6 +21,7 @@ uninstall : rm /usr/bin/g213colors-gui rm /etc/G213Colors.conf rm /etc/systemd/system/g213colors.service + rm /etc/init.d/g213colors rm /usr/share/icons/hicolor/16x16/apps/g213colors.png rm /usr/share/icons/hicolor/24x24/apps/g213colors.png rm /usr/share/icons/hicolor/32x32/apps/g213colors.png