SafeEyes
SafeEyes copied to clipboard
Flatpak package
Would be nice to have SafeEyes packaged in flatpak.
Hi, Yup I see the advantage of flatpak packaging but do not have the experience and time to maintain Flatpak package. Looking forward to see any contributors to help on this.
I'm attempting to build a Flatpak of SafeEyes currently (repository). Does SafeEyes use GDBus to access DBus? Or does it use dbus-python?
@PopeRigby thank you so much. I am using the dbus-python API. You can see the import here: https://github.com/slgobinath/SafeEyes/blob/master/safeeyes/safeeyes.py#L28
Got it. I'll tell you if I have any other issues. If I may ask, why is dbus-python not a pip dependency of safeyes?
Hey, so I got it to build successfully, but it's giving a critical GTK error, the tray icon is missing, and I don't seem to be able to access the settings, along with something else about xauthority.
WARNING:root:Unable to determine if wayland is running. Assuming no.
Xlib.xauth: warning, no xauthority details available
(safeeyes:2): Gtk-CRITICAL **: 16:00:54.609: gtk_widget_get_scale_factor: assertion 'GTK_IS_WIDGET (widget)' failed
For the Xlib xauthority problem, please check this solution https://github.com/slgobinath/SafeEyes/issues/206#issuecomment-338047998
For the Gtk-CRITICAL issue, I have to debug and see. Can you share your system info (OS and Desktop Env)? I will try to reproduce it.
For the Xlib xauthority problem, please check this solution #206 (comment)
I'll try to get that working in the Flatpak.
For the Gtk-CRITICAL issue, I have to debug and see. Can you share your system info (OS and Desktop Env)? I will try to reproduce it.
My OS is Arch Linux and I'm using Sway as my window manager. But, could you try cloning the repository for the SafeEyes Flatpak and reproducing with that? There are instructions for building/running in the README.
@slgobinath were you able to reproduce the issue?
Hi, Sorry I didn't get a chance to test it. I will get back to you asap.
Thanks! Just checking in.
@PopeRigby I tried to build the flatpak today but I got the following error:
error: org.gnome.Sdk/x86_64/40 not installed
Failed to init: Unable to find sdk org.gnome.Sdk version 40
I couldn't find any sources to install the SDK after a quick search. I will look at it this weekend.
Just run flatpak install org.gnome.Sdk/x86_64/40.
After installing flatpak install org.gnome.Sdk/x86_64/40 also I get the same error.
Strange. What OS are you on? Maybe try running flatpak-builder with -v.
Linux Mint 20.1 with Cinnamon
$ flatpak-builder -v --user --install build/ org.slgobinath.SafeEyes.yml --force-clean
FB: Running: git config --get user.email
FB: Running: git config --get user.name
FB: Running: flatpak info --arch=x86_64 --show-commit org.gnome.Sdk 40
FB: Running: flatpak info --show-location --arch=x86_64 org.gnome.Sdk 40
FB: Running: flatpak info --arch=x86_64 --show-commit org.gnome.Platform 40
error: org.gnome.Platform/x86_64/40 not installed
Failed to init: Unable to find runtime org.gnome.Platform version 40
Can you run flatpak list?
$ flatpak list
Name Application ID Version Branch Installation
default org.freedesktop.Platform.GL.default 19.08 system
Mesa org.freedesktop.Platform.GL.default 21.1.4 20.08 system
Intel org.freedesktop.Platform.VAAPI.Intel 19.08 system
Intel org.freedesktop.Platform.VAAPI.Intel 20.08 system
openh264 org.freedesktop.Platform.openh264 2.1.0 2.0 system
GNOME Application Platform version 3.36 org.gnome.Platform 3.36 system
GNOME Software Development Kit version 40 org.gnome.Sdk 40 system
Mint-Y Gtk Theme org.gtk.Gtk3theme.Mint-Y 3.22 system
This is how I installed (Now it says the sdk is already installed):
$ flatpak install org.gnome.Sdk/x86_64/40
Looking for matches…
Found similar ref(s) for ‘org.gnome.Sdk/x86_64/40’ in remote ‘flathub’ (system).
Use this remote? [Y/n]: y
Skipping: org.gnome.Sdk/x86_64/40 is already installed
```
Try org.gnome.Platform/x86_64/40.
It worked. Now I can build it but when I try to run it using flatpak run org.slgobinath.SafeEyes, I get the following error:
Gtk-Message: 22:06:08.352: Failed to load module "xapp-gtk3-module"
Traceback (most recent call last):
File "/app/bin/safeeyes", line 8, in <module>
sys.exit(main())
File "/app/lib/python3.8/site-packages/safeeyes/__main__.py", line 113, in main
config = Config()
File "/app/lib/python3.8/site-packages/safeeyes/model.py", line 308, in __init__
utility.initialize_safeeyes()
File "/app/lib/python3.8/site-packages/safeeyes/utility.py", line 377, in initialize_safeeyes
shutil.copy2(SYSTEM_CONFIG_FILE_PATH, CONFIG_FILE_PATH)
File "/usr/lib/python3.8/shutil.py", line 435, in copy2
copyfile(src, dst, follow_symlinks=follow_symlinks)
File "/usr/lib/python3.8/shutil.py", line 264, in copyfile
with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst:
FileNotFoundError: [Errno 2] No such file or directory: '/home/gobinath/.var/app/org.slgobinath.SafeEyes/config/safeeyes/safeeyes.json'
/home/gobinath/.var/app/org.slgobinath.SafeEyes/config/ is there but the safeeyes.json is not there.
Yeah I also had that issue, and I'm not sure why SafeEyes wouldn't be automatically generating that file. I got it to work by copying my other versions of safeeyes.json to that path.
Hi, the error comes from https://github.com/slgobinath/SafeEyes/blob/master/safeeyes/utility.py#L377 where I copy the configuration files from source to ~/.config folder. I think the /home/gobinath/.var/app/org.slgobinath.SafeEyes/config/safeeyes/safeeyes.json is seen as the source location but its not.
I found the source config is available at this location: /home/gobinath/.local/share/flatpak/app/org.slgobinath.SafeEyes/x86_64/master/active/files/lib/python3.8/site-packages/safeeyes/config. Is it the installation location?
Yeah, I believe ~/.local/share/flatpak/app/org.slgobinath.SafeEyes/x86_64/master is the installation location.
From looking at the Flatpak documentation, it looks like config files are supposed to go in ~/.var/app/org.slgobinath.SafeEyes/config/.
Any progress on this?
I was just waiting on @slgobinath
Sorry this is my bad. I lost in other stuff and couldn't spend much time on this project. Though still it's the case, I will try my best to get back to you.
No worries.
Hey, just because I just noticed it here, I am receiving the
(safeeyes:2): Gtk-CRITICAL **: 16:00:54.609: gtk_widget_get_scale_factor: assertion 'GTK_IS_WIDGET (widget)' failed
error as well with the pip installation on fedora 36. Python 3.10.4 Pip version 21.3.1 Gnome version 42.1
Hi, is there any update about this? :heart:
I use Fedora silverblue and I badly need it.
I tried packaging it a while back and was having some trouble. I might try again some day, but Stretchly has been working for me, and it has a Flatpak.
@poperigby news to me, thanks a lot!