jceb / dex

DesktopEntry Execution
Other
420 stars 33 forks source link

Running individual autostart entries via systemd #55

Open WhyNotHugo opened 2 years ago

WhyNotHugo commented 2 years ago

Hi! I've been thinking a bit about dex+systemd integration, and I've a kind-of-proposal, but would like to hear your thoughts before hacking into it. The idea is basically:

Note that dex run is very very similar to dex -w, but takes only the basename instead of the full path (e.g.: caffeine instead of /etc/xdg/autostart/caffeine.desktop).

The end result is being able to run autostart-desktop entries with three benefits:

As a bonus point, something like dex enable $NAME that runs systemctl --user enable dex@$NAME.service might be interesting, though this is a bit systemd-centric, and, so far, it seems that dex is very systemd-agnostic, which is probably important for a lot of users.

What are you thoughts on this?

jceb commented 1 month ago

Interesting idea, I like it. Desktop Entries are tedious to manage because programs just add them. Therefore, I wonder how practical the approach is to manage each service individually. Personally, I use the following dex.service:

[Unit]
Description=Desktop Autostart

[Service]
ExecStart=dex -a -e XFCE
Type=forking
RemainAfterExit=yes

[Install]
WantedBy=graphical-session.target

It starts all services for the XFCE environment. This is close enough and not starts the GNOME and KDE services.

Feel free to develop the services.