Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Python install for ciaro and gtk #19

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
2 changes: 1 addition & 1 deletion G213Colors.desktop
Original file line number Diff line number Diff line change
@@ -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
Expand Down
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
19 changes: 19 additions & 0 deletions be.jeroened.pkexec.g213colors.policy
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC
"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
"http://www.freedesktop.org/software/polkit/policyconfig-1.dtd">
<policyconfig>

<action id="be.jeroened.pkexec.g213colors">
<message>Authentication is required to run G213 Colors</message>
<icon_name>g213colors</icon_name>
<defaults>
<allow_any>auth_admin</allow_any>
<allow_inactive>auth_admin</allow_inactive>
<allow_active>auth_admin</allow_active>
</defaults>
<annotate key="org.freedesktop.policykit.exec.path">/usr/bin/g213colors-gui</annotate>
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
</action>

</policyconfig>
6 changes: 6 additions & 0 deletions fix.sh
Original file line number Diff line number Diff line change
@@ -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

11 changes: 11 additions & 0 deletions g213colors.openrc
Original file line number Diff line number Diff line change
@@ -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"
4 changes: 4 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -12,19 +13,22 @@ 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 :
rm /usr/bin/G213Colors.py
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
rm /usr/share/icons/hicolor/48x48/apps/g213colors.png
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