Open kevingrillet opened 1 year ago
You have a few options:
libappindicator3-1
packagePYSTRAY_BACKEND=gtk
environment variable before running the appPyGObject
dependency in requirements.txt
(this will likely break system tray functionality, however)P.S.: This is not a bug.
Installing the AppIndicator libraries on Linux is now "required" (unless you apply the second or third workaround I mentioned in my previous post), because after the addition of PyGObject
as a dependency (which was done for better tray icon support), pystray
detects it and defaults to the appindicator
backend, where before it'd just choose gtk
or whatever.
And because the Linux binary we are distributing through the CI (AMD64 only, unfortunately) already includes everything, it didn't cross my mind to mention this in the README, but we probably should.
What makes me think it's a bug is that it's not written in the README / wiki ;)
But yep, I should migrate my RaspberryPi to 64bit too 😄
I did try but still not working :(
pi@raspberrypi:~/Documents $ sudo apt-get install -y libappindicator3-1
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libappindicator3-1 is already the newest version (0.4.92-8).
The following packages were automatically installed and are no longer required:
golang-1.15 golang-1.15-doc golang-1.15-go golang-1.15-src golang-doc golang-go golang-src
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
pi@raspberrypi:~/Documents $ ./tdm.sh -r
Traceback (most recent call last):
File "/home/pi/Downloads/TwitchDropsMiner/env/lib/python3.9/site-packages/pystray/_appindicator.py", line 23, in <module>
gi.require_version('AppIndicator3', '0.1')
File "/home/pi/Downloads/TwitchDropsMiner/env/lib/python3.9/site-packages/gi/__init__.py", line 126, in require_version
raise ValueError('Namespace %s not available' % namespace)
ValueError: Namespace AppIndicator3 not available
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/pi/Downloads/TwitchDropsMiner/main.py", line 29, in <module>
from twitch import Twitch
File "/home/pi/Downloads/TwitchDropsMiner/twitch.py", line 39, in <module>
from gui import GUIManager
File "/home/pi/Downloads/TwitchDropsMiner/gui.py", line 21, in <module>
import pystray
File "/home/pi/Downloads/TwitchDropsMiner/env/lib/python3.9/site-packages/pystray/__init__.py", line 64, in <module>
Icon = backend().Icon
File "/home/pi/Downloads/TwitchDropsMiner/env/lib/python3.9/site-packages/pystray/__init__.py", line 56, in backend
return candidate()
File "/home/pi/Downloads/TwitchDropsMiner/env/lib/python3.9/site-packages/pystray/__init__.py", line 28, in appindicator
from . import _appindicator as backend; return backend
File "/home/pi/Downloads/TwitchDropsMiner/env/lib/python3.9/site-packages/pystray/_appindicator.py", line 26, in <module>
gi.require_version('AyatanaAppIndicator3', '0.1')
File "/home/pi/Downloads/TwitchDropsMiner/env/lib/python3.9/site-packages/gi/__init__.py", line 126, in require_version
raise ValueError('Namespace %s not available' % namespace)
ValueError: Namespace AyatanaAppIndicator3 not available
@kevingrillet I had to install these additional packages on Ubuntu to make it work
sudo apt install gir1.2-appindicator3-0.1 libcairo2-dev libgirepository1.0-dev pkg-config
@miroslav-suvada Ty, it works!
pi@raspberrypi:~/Documents $ ./tdm.sh -aur
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
gir1.2-appindicator3-0.1 is already the newest version (0.4.92-8).
libgirepository1.0-dev is already the newest version (1.66.1-1+b1).
pkg-config is already the newest version (0.29.2-1).
libcairo2-dev is already the newest version (1.16.0-5+rpt1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Already up to date.
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting pystray@ git+https://github.com/moses-palmer/pystray.git@903836104f8b1a2979f4fa5a333870ef7b075992
Cloning https://github.com/moses-palmer/pystray.git (to revision 903836104f8b1a2979f4fa5a333870ef7b075992) to /tmp/pip-install-xg1_wrl9/pystray_333945fa934f4da78ebd5921076bbc34
Running command git clone -q https://github.com/moses-palmer/pystray.git /tmp/pip-install-xg1_wrl9/pystray_333945fa934f4da78ebd5921076bbc34
Running command git rev-parse -q --verify 'sha^903836104f8b1a2979f4fa5a333870ef7b075992'
Running command git fetch -q https://github.com/moses-palmer/pystray.git 903836104f8b1a2979f4fa5a333870ef7b075992
Ignoring pywin32: markers 'sys_platform == "win32"' don't match your environment
Ignoring truststore: markers 'sys_platform == "linux" and python_version >= "3.10"' don't match your environment
Requirement already satisfied: aiohttp<4.0,>2.0 in ./env/lib/python3.9/site-packages (from -r requirements.txt (line 1)) (3.8.4)
Requirement already satisfied: Pillow in ./env/lib/python3.9/site-packages (from -r requirements.txt (line 2)) (9.4.0)
Requirement already satisfied: PyGObject in ./env/lib/python3.9/site-packages (from -r requirements.txt (line 5)) (3.44.1)
Requirement already satisfied: six in ./env/lib/python3.9/site-packages (from pystray@ git+https://github.com/moses-palmer/pystray.git@903836104f8b1a2979f4fa5a333870ef7b075992->-r requirements.txt (line 4)) (1.16.0)
Requirement already satisfied: python-xlib>=0.17 in ./env/lib/python3.9/site-packages (from pystray@ git+https://github.com/moses-palmer/pystray.git@903836104f8b1a2979f4fa5a333870ef7b075992->-r requirements.txt (line 4)) (0.33)
Requirement already satisfied: frozenlist>=1.1.1 in ./env/lib/python3.9/site-packages (from aiohttp<4.0,>2.0->-r requirements.txt (line 1)) (1.3.3)
Requirement already satisfied: yarl<2.0,>=1.0 in ./env/lib/python3.9/site-packages (from aiohttp<4.0,>2.0->-r requirements.txt (line 1)) (1.8.2)
Requirement already satisfied: charset-normalizer<4.0,>=2.0 in ./env/lib/python3.9/site-packages (from aiohttp<4.0,>2.0->-r requirements.txt (line 1)) (3.1.0)
Requirement already satisfied: aiosignal>=1.1.2 in ./env/lib/python3.9/site-packages (from aiohttp<4.0,>2.0->-r requirements.txt (line 1)) (1.3.1)
Requirement already satisfied: multidict<7.0,>=4.5 in ./env/lib/python3.9/site-packages (from aiohttp<4.0,>2.0->-r requirements.txt (line 1)) (6.0.4)
Requirement already satisfied: attrs>=17.3.0 in ./env/lib/python3.9/site-packages (from aiohttp<4.0,>2.0->-r requirements.txt (line 1)) (22.2.0)
Requirement already satisfied: async-timeout<5.0,>=4.0.0a3 in ./env/lib/python3.9/site-packages (from aiohttp<4.0,>2.0->-r requirements.txt (line 1)) (4.0.2)
Requirement already satisfied: idna>=2.0 in ./env/lib/python3.9/site-packages (from yarl<2.0,>=1.0->aiohttp<4.0,>2.0->-r requirements.txt (line 1)) (3.4)
Requirement already satisfied: pycairo>=1.16.0 in ./env/lib/python3.9/site-packages (from PyGObject->-r requirements.txt (line 5)) (1.23.0)
@DevilXD thanks for this great tool! I don't like running my desktop 24/7 so installed this on a Pi. Running DietPi from a 4 GB SD card on a Raspberry Pi rev2 B.
Below are the upgraded scripts, also added this comment's code. Would like to have this in one session with two windows.
Since everything is now in tmux you have to run tmux a
and can get a preview of all the windows by pressing Ctrl+b w
and detach with Ctrl+b d
. This does login, but that is only as far as I have tested.
I was having the same problem on my raspberry pi 4b with 'AppIndicator3 not available', but for some reason 'apt-get install gir1.2-appindicator3-0' was not able to find the package, from what I see online gir1.2 is outdated. I was able to circumvent the issue by building from source and running in a venv following this guide. Now I get the same issue when starting with python3 main.py
, however by starting with PYSTRAY_BACKEND=gtk python3 main.py
, as mentioned here, it works perfectly!
@DevilXD thanks for this great tool! I don't like running my desktop 24/7 so installed this on a Pi. Running DietPi from a 4 GB SD card on a Raspberry Pi rev2 B.
Below are the upgraded scripts...
Hi, sorry to resurrect like this, are you still somehow active in raspi TDM?
I tried script from your comment with new TDM by Win20k (which fixed drop change done by twitch) https://github.com/Windows200000/TwitchDropsMiner-updated/releases, but without success.
I would really like to run this on raspi and not keeping my main pc up. If you could look into it and do little walkthru on how to do it properly, it will be epic.
Thanks
I've just pull the last update of the project, then updated the packages & run, but it's not working :/
Hardware
Running on Raspbian 32 bits, up to date.
Update
Output:
Run
Output