SafeEyes icon indicating copy to clipboard operation
SafeEyes copied to clipboard

Flatpak package

Open soredake opened this issue 4 years ago • 27 comments

Would be nice to have SafeEyes packaged in flatpak.

soredake avatar Mar 19 '21 19:03 soredake

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.

slgobinath avatar Mar 28 '21 13:03 slgobinath

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 avatar Jun 08 '21 22:06 poperigby

@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

slgobinath avatar Jun 10 '21 02:06 slgobinath

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?

poperigby avatar Jun 10 '21 17:06 poperigby

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

poperigby avatar Jun 14 '21 23:06 poperigby

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.

slgobinath avatar Jun 15 '21 00:06 slgobinath

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.

poperigby avatar Jun 15 '21 16:06 poperigby

@slgobinath were you able to reproduce the issue?

poperigby avatar Jun 29 '21 20:06 poperigby

Hi, Sorry I didn't get a chance to test it. I will get back to you asap.

slgobinath avatar Jun 29 '21 20:06 slgobinath

Thanks! Just checking in.

poperigby avatar Jun 29 '21 21:06 poperigby

@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.

slgobinath avatar Jul 07 '21 12:07 slgobinath

Just run flatpak install org.gnome.Sdk/x86_64/40.

poperigby avatar Jul 07 '21 21:07 poperigby

After installing flatpak install org.gnome.Sdk/x86_64/40 also I get the same error.

slgobinath avatar Jul 14 '21 22:07 slgobinath

Strange. What OS are you on? Maybe try running flatpak-builder with -v.

poperigby avatar Jul 15 '21 00:07 poperigby

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

slgobinath avatar Jul 15 '21 01:07 slgobinath

Can you run flatpak list?

poperigby avatar Jul 15 '21 02:07 poperigby

$ 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
```

slgobinath avatar Jul 15 '21 02:07 slgobinath

Try org.gnome.Platform/x86_64/40.

poperigby avatar Jul 16 '21 00:07 poperigby

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.

slgobinath avatar Jul 21 '21 02:07 slgobinath

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.

poperigby avatar Jul 21 '21 17:07 poperigby

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?

slgobinath avatar Jul 24 '21 12:07 slgobinath

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/.

poperigby avatar Jul 24 '21 19:07 poperigby

Any progress on this?

soredake avatar Jan 09 '22 11:01 soredake

I was just waiting on @slgobinath

poperigby avatar Jan 09 '22 17:01 poperigby

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.

slgobinath avatar Jan 09 '22 17:01 slgobinath

No worries.

poperigby avatar Jan 09 '22 18:01 poperigby

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

AntonOellerer avatar May 30 '22 11:05 AntonOellerer

Hi, is there any update about this? :heart:

I use Fedora silverblue and I badly need it.

azzamsa avatar Mar 17 '23 07:03 azzamsa

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 avatar Mar 17 '23 20:03 poperigby

@poperigby news to me, thanks a lot!

azzamsa avatar Mar 17 '23 20:03 azzamsa