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

xdg updates + autostart + lockfile #964

Merged
merged 12 commits into from
Jun 21, 2023
Merged

xdg updates + autostart + lockfile #964

merged 12 commits into from
Jun 21, 2023

Conversation

munix9
Copy link
Contributor

@munix9 munix9 commented Jun 9, 2023

I have summarized the various changes here:

  • Use of pyxdg
  • Extension of xdg.py (autostart)
  • control autostart in tray
  • check if os-ui is already running

See also #950

@gustavo-iniguez-goya
Copy link
Collaborator

This looks really good to me @munix9 , removing the pkill was a must.

Some general notes:

I see that pyxdg is packaged as python3-xdg on debian and ubuntu, and as python3-pyxdg/python36-pyxdg on fedora and opensuse.
Only available since ubuntu >= 20.04, so we would be incompatible with ubuntu 18 and 16 (and the linux mint/mx equivalents). Just a note, nothing really important, but worth mentioning.

@munix9
Copy link
Contributor Author

munix9 commented Jun 9, 2023

This looks really good to me @munix9 , removing the pkill was a must.

Some general notes:

I see that pyxdg is packaged as python3-xdg on debian and ubuntu, and as python3-pyxdg/python36-pyxdg on fedora and opensuse. Only available since ubuntu >= 20.04, so we would be incompatible with ubuntu 18 and 16 (and the linux mint/mx equivalents). Just a note, nothing really important, but worth mentioning.

This is not nice. Maybe I can integrate the needed methods of pyxdg directly into xdg.py to avoid the dependency.
I'll have a look at it.

@munix9
Copy link
Contributor Author

munix9 commented Jun 9, 2023

@gustavo-iniguez-goya pyxdg dependency is removed.

@gustavo-iniguez-goya
Copy link
Collaborator

@munix9 , did you see this error? it occurs when the ~/.config/autostart/opensnitch_ui.desktop already exists. We'll hit this error when users coming from v1.5.x install the next version.

  File "/usr/lib/python3/dist-packages/opensnitch/service.py", line 202, in _on_switch_autostart
    self._autostart.enable(self._menu_autostart.isChecked())
  File "/usr/lib/python3/dist-packages/opensnitch/utils/xdg.py", line 82, in enable
    shutil.copyfile(self.systemAutostart, self.userAutostart)
  File "/usr/lib/python3.8/shutil.py", line 244, in copyfile
    raise SameFileError("{!r} and {!r} are the same file".format(src, dst))
shutil.SameFileError: '/etc/xdg/autostart/opensnitch_ui.desktop' and '/home/ga/.config/autostart/opensnitch_ui.desktop' are the same file

@gustavo-iniguez-goya
Copy link
Collaborator

thank you @munix9 !

@gustavo-iniguez-goya gustavo-iniguez-goya marked this pull request as ready for review June 21, 2023 12:37
@gustavo-iniguez-goya gustavo-iniguez-goya merged commit 5962101 into evilsocket:master Jun 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants