ztefn / haguichi

Haguichi provides a graphical frontend for Hamachi on Linux.
https://haguichi.net
GNU General Public License v3.0
151 stars 8 forks source link

.desktop file deleted from .config/autostart Gnome - Flatapk #65

Closed plmosqueda closed 3 weeks ago

plmosqueda commented 1 month ago

Hello ztefn. I Hope this message finds you well. First I want to apologize, because i have never made a donation and this application and your work keeps me away from windows XDDD. I really appreciate your work and this tool is amazing to work in Linux .

This new update is amazing, looks very cool and i love the integrated indicator, style in the flatpak version. BTW Im using Debian+Gnome+flatpak.

I need the mighty Haguichi running after boot but i have noticed the .desktop file under /.config/autostart is deleted after reboot, renaming the file works. I think you already know that, but maybe anothers Haguicians must know the workaround.

Thank you

ztefn commented 1 month ago

Hello @plmosqueda, thanks for the appreciation! 😊

How did you create the .desktop file in ~/.config/autostart in the first place? By manually copying an existing .desktop file there or by using a tool like GNOME Tweaks?

plmosqueda commented 1 month ago

Hi, sorry i forgot that part XDDD

The file was created with Gnome Tweaks

ztefn commented 1 month ago

Okay... couple of more questions:

plmosqueda commented 1 month ago

Great, I hope this helps, and thank you again

What is the version of GNOME Tweaks and is it installed from the Debian repository or flatpak?

What is the filename and content of the .desktop file it creates?

What is the filename you rename it to so it doesn't get deleted?

ztefn commented 1 month ago

Thanks!

I will check if I can reproduce this and if so try to find out if there's anything specific in the .deskop file that triggers the deletion.

plmosqueda commented 1 month ago

Thank you, you are the best

ztefn commented 1 month ago

Hello again! I created a virtual machine with Debian Testing and installed GNOME Tweaks and Haguichi as flatpak. No matter what I threw at it, the .desktop file in ~/.config/autostart was never deleted after reboot. So the good news is that there seems to be no issue with Haguichi or the .desktop file. The bad news is that this suggests some other process or configuration on your Debian system is the cause of this file deletion...

While testing however, I did encounter an annoying delay when logging in with autostart active. An empty grey screen is displayed idle for 30 seconds before showing the desktop and launching Haguichi. I solved this by changing the Exec line into a bash command with a small delay before running Haguichi:

Exec=sh -c 'sleep 5 && /usr/bin/flatpak run --branch=stable --arch=x86_64 --command=haguichi com.github.ztefn.haguichi --background'

I thought it might be helpful to mention it here.

plmosqueda commented 1 month ago

Thank you for your time Master ztefn, let me check my system configuration. I appreciate the exec command.

ztefn commented 1 month ago

You could try the audit daemon to find out what process deletes the file. https://askubuntu.com/questions/48844/how-to-find-the-pid-of-the-process-which-has-deleted-a-file

To install: sudo apt install auditd

To start watching the file path: sudo auditctl -w ~/.config/autostart/com.github.ztefn.haguichi.desktop -p wra

To read the log: sudo ausearch -f ~/.config/autostart/com.github.ztefn.haguichi.desktop -i

To stop watching the file path (uppercase -W instead of lowercase): sudo auditctl -W ~/.config/autostart/com.github.ztefn.haguichi.desktop -p wra

ztefn commented 1 month ago

@plmosqueda have you discovered which process is responsible for deleting the .desktop file?