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/README.md b/README.md index d7add0f..000c05c 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,19 @@ The "Wave" color effect that is available with the Logitech software could not b ## Installation Clone this project with git and run `sudo make install` +Remark: The PyUSB and PyGObject libraries can be installed with (Running Ubuntu) running the `fix.sh` file or by pasteing: + +``` +sudo apt install python3-gi python3-gi-cairo gir1.2-gtk-3.0 +pip install pycairo PyGObject +sudo make install +sudo python main.py +``` + +The desktop entry didn't work for me. +In case your python is not found for sudo, check your python with `whereis python` using the normal user. For example I had to replace the last python command with +`sudo /home/user/miniconda3/bin/python main.py` + ### Prerequisites * [Python](https://www.python.org/) 3.x (which is usually already installed) * [PyUSB](https://github.com/walac/pyusb) (please see their instructions on how to install) 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/fix.sh b/fix.sh new file mode 100755 index 0000000..4b31cee --- /dev/null +++ b/fix.sh @@ -0,0 +1,6 @@ +#!/bin/bash +sudo apt install python3-gi python3-gi-cairo gir1.2-gtk-3.0 +pip install pycairo PyGObject +sudo make install +sudo python main.py + 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" diff --git a/makefile b/makefile index 393311f..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 @@ -12,6 +13,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 : @@ -19,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 @@ -26,5 +29,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