You are not logged in.
Pages: 1
In app finder I have the .desktop file that starts the syncthing service in the background. It has all the metadata I need.
I can simply run the command that the .desktop file runs via session and startup menu, but can I instruct system and startup to run a specific desktop file? This sounds to me like a cleaner solution.
Offline
Once you've created the .desktop file and know the command works you can place it in /home/user/.config/autostart and it will be run at startup/login.
I AM CANADIAN!
Siduction
Debian Sid
Xfce 4.20 with Wayland/Labwc
Offline
Once you've created the .desktop file and know the command works you can place it in /home/user/.config/autostart and it will be run at startup/login.
And app finder will still find it because it finds all the .desktop files because of ini file format magic?
Offline
I'm not sure the app finder will find it because it looks for binaries and scripts. If you create a script and call it in the .desktop file it should be called on startup. You must place the script somewhere in $PATH. Example /home/user/.local/share/applications.
I AM CANADIAN!
Siduction
Debian Sid
Xfce 4.20 with Wayland/Labwc
Offline
I'm not sure the app finder will find it because it looks for binaries and scripts. If you create a script and call it in the .desktop file it should be called on startup. You must place the script somewhere in $PATH. Example /home/user/.local/share/applications.
So what intrigued me is that syncthing as is came with the .desktop file:
kamil$cat syncthing-start.desktop
[Desktop Entry]
Name=Start Syncthing
GenericName=File synchronization
Comment=Starts the main syncthing process in the background.
Exec=syncthing serve --no-browser --logfile=default
Icon=syncthing
Terminal=false
Type=Application
Keywords=synchronization;daemon;
Categories=Network;FileTransfer;P2P
Path=
StartupNotify=true
kamil$pwd
/home/kamil/.local/share/applications
Which is actually ran on startup, but it's not shown inside "Session and Startup" menu in the GUI. This is the default path of .desktop files and I don't know where it's actually defined to run this .desktop at startup.
Offline
I'm not familiar with Syncthing but it looks like it has a daemon. So it's probably put somewhere to run at boot rather than login. You might be able to find it with locate.
updatedb
locate syncthing
updatedb must be run as root or sudo. If you look at your .desktop file under "Categories" you see "Network" so it should show up in the Whisker menu or Applications menu under the Network section.
I AM CANADIAN!
Siduction
Debian Sid
Xfce 4.20 with Wayland/Labwc
Offline
In app finder I have the .desktop file that starts the syncthing service in the background. It has all the metadata I need.
I can simply run the command that the .desktop file runs via session and startup menu, but can I instruct system and startup to run a specific desktop file? This sounds to me like a cleaner solution.
Syncthing is not installed on my system, but I can get the file list of the package remotely. It doesn't provide a .desktop file, but some systemd services :
pacman -Fl syncthing | grep desktop
~
pacman -Fl syncthing | grep service
syncthing usr/lib/systemd/system/syncthing@.service
syncthing usr/lib/systemd/user/syncthing.service
To me, using a service is a better way to start Syncthing, it start automatically at the start of your session, you don't have to do anything.
(I checked, the service is part of Syncthing sources, it's not specific to my distribution)
EndeavourOS
Xfce+gtk3-classic (no CSD)+Picom
Offline
Fragrant1470 wrote:In app finder I have the .desktop file that starts the syncthing service in the background. It has all the metadata I need.
I can simply run the command that the .desktop file runs via session and startup menu, but can I instruct system and startup to run a specific desktop file? This sounds to me like a cleaner solution.
Syncthing is not installed on my system, but I can get the file list of the package remotely. It doesn't provide a .desktop file, but some systemd services :
pacman -Fl syncthing | grep desktop ~ pacman -Fl syncthing | grep service syncthing usr/lib/systemd/system/syncthing@.service syncthing usr/lib/systemd/user/syncthing.service
To me, using a service is a better way to start Syncthing, it start automatically at the start of your session, you don't have to do anything.
(I checked, the service is part of Syncthing sources, it's not specific to my distribution)
So then I don't know where the .desktop file came from. This was included in the default Debian installation.
// cwd is /usr/lib/systemd/user/
kamil$cat syncthing.service
[Unit]
Description=Syncthing - Open Source Continuous File Synchronization
Documentation=man:syncthing(1)
StartLimitIntervalSec=60
StartLimitBurst=4
[Service]
ExecStart=/usr/bin/syncthing serve --no-browser --no-restart --logflags=0
Restart=on-failure
RestartSec=1
SuccessExitStatus=3 4
RestartForceExitStatus=3 4
# Hardening
SystemCallArchitectures=native
MemoryDenyWriteExecute=true
NoNewPrivileges=true
# Elevated permissions to sync ownership (disabled by default),
# see https://docs.syncthing.net/advanced/folder-sync-ownership
#AmbientCapabilities=CAP_CHOWN CAP_FOWNER
[Install]
WantedBy=default.target
Below was included with another .desktop file to start the syncthing web UI – it seems syncthing is launched on startup via systemd but this desktop file can be used to execute the same command as systemd in case the user disables it.
kamil$cd ~/.local/share/applications/
kamil$cat syncthing-start.desktop
[Desktop Entry]
Name=Start Syncthing
GenericName=File synchronization
Comment=Starts the main syncthing process in the background.
Exec=syncthing serve --no-browser --logfile=default
Icon=syncthing
Terminal=false
Type=Application
Keywords=synchronization;daemon;
Categories=Network;FileTransfer;P2P
Path=
StartupNotify=true
Hidden=true
At this point there is no 'problem' but I am curious and keen on learning (:
Added later 55 min 29 s:
I have to clarify some things. The syncthing service is not actually ran on startup by default as installed for debian (from syncthing website).
It comes with the .service file I (contents in previous post) and the .desktop files. I said that it is ran on startup because I forgot that I ran:
kamil$mv -v ~/.local/share/applications/syncthing-start.desktop ~/.config/autostart
But then, systemctl does not find the syncthing service in case I wanted to run the daemon:
kamil$systemctl status syncthing.service
Unit syncthing.service could not be found.
but the file exists in the directory /usr/lib/systemd/user, so why is the service not found?
Offline
Its a user-based service. Try:
systemctl --user status syncthing.service
Mark solved threads as [SOLVED] to make it easier for others to find solutions.
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline
Pages: 1
[ Generated in 0.010 seconds, 7 queries executed - Memory usage: 590.95 KiB (Peak: 607.8 KiB) ]