Xde-start - a powertool for .desktop files

  • Have you ever wanted to check which autostart applications would start when you login KDE, and compare with when you login Gnome, or another DE/WM (if you use more than one DE with the same user account)?
  • Would you like to easily change which applications start on KDE, but not other sessions?
  • Have you ever wanted to see Gnome menu entries in a list, or use a REGEX to filter menu entries in a terminal list?
  • Would you like to check why a program is not in KDE Applications menu, while it is shown in LxQt?
  • Would you like to easily create a context menu for an application (in Applications menu) to start it with your dGPU, like in Gnome?
  • Would you like to easily add an autostart entry for a program in Applications menu, that does not autostart by default?
  • If you create custom scripts or programs, would you like an option to start a program from the .desktop file (using the Exec key, that may include a command with arguments and environment variables), instead of writing the full command from memory?

The above are only a few among the features of the brand new xde-start program (actually, a single bash script file).

I would appreciate any feedback on usage, bugs, or ideas for feature changes/additions.

Edit:

You can read more details on usage, including several examples in the man page.
For Arch based systems, install it with a PKGBUILD:

7 Likes

Sounds like a great idea, thanks! :+1:

(But an off-topic note: gitlab seems to require signing up to see the pageā€¦)

1 Like

:grin: I forgot to make it public. :face_with_head_bandage:
Can you check now, please?

Not finished my coffee. :rofl:

I hope it is public nowā€¦

1 Like

Still doesnā€™t work here:
https://gitlab.com/users/sign_in

Works now without signing up, thanks!

1 Like

Same here! :v:

One thing I already know is missing is a detailed man page, which I have first in my list (despite what the TODO.md says :joy: ).

I hope the examples help for a start.

The program will not change system files, only local, unless you run it as root/sudo user.

1 Like

Does it work on i3?

It works everywhere, but it uses/needs XDG_CURRENT_DESKTOP, or a manual list with -e.

1 Like

Could you specify that for an i3-wm? I see that xdg-utils donā€™t support i3-wm ootb.

Would be some (unexpected) hastle, I guess? - If so, never mindā€¦ :wink:

Stin ygeia sou! :clinking_glasses:

:v:

.desktop files have DE based filters, in order to exclusively OnlyShow, or NotShow the entry in selected sessions. Related utils, like dex or systemd-autostart-generator apply those filters, based on XDG_CURRENT_DESKTOP env var, which any serious DE fills with its registered name. This way, a program that Gnome ships with a default autostart entry, and has sense to autostart it only in Gnome sessions, includes a key in the .desktop file:

OnlyShowIn=GNOME;

Then, this program will not autostart in other DEs except Gnome.

Most known GUI apps that control/edit autostart entries are DE specific, or lack the ability to add/remove a DE in/from XDG_CURRENT_DESKTOP, being only able to Hide/Unhide the entry for all DEs (using key Hidden).

If a user wants to make such a program (.desktop file) to also start in a LxQt session, they can add LxQt in XDG_CURRENT_DESKTOP (semicolon separated) list, without affecting Gnome or other DEs sessions.

WMs OTOH, do not usually fill XDG_CURRENT_DESKTOP with any DE name, unless a distribution developer which provides a WM (i3, BSPWM, etc) profile, manually configures XDG_CURRENT_DESKTOP with a sensible DE (fake one, or add an unregistered one prefixed with X-). Then autostart utils follow the filters/directives of the .desktop files.

For example, I have constructed my personal DE and export XDG_CURRENT_DESKTOP=X-bsp-desktop in the init script, so I can enable/disable autostart programs with OnlyShowIn/NotShowIn keys per my needs.

More info at freedesktop menu-spec and autostart-spec or Archwiki.

Similar procedures apply for menu entries, which are sourced from /usr/share/applications/*.desktop files and equivalent (XDG_DATA_DIRS, XDG_DATA_HOME), populating standard DEs Applications menus.

I hope I helped :person_shrugging: :slightly_smiling_face:

1 Like

Thank you so much, taktikos-mou! :hugs:

Much of this is yet way over my head, but I want to keep learningā€¦

:v:

1 Like

Manual page is added.

Hopefully shortly, adding a PKGBUILD.

1 Like

Here is one for v.0.1.3

# Maintainer: Petros Samaras (petsam at gitlab)

pkgname=xde-start
_pkgname="$pkgname"
pkgver=0.1.3
pkgrel=1
pkgdesc="A powertool for .desktop files (run, list, modify)"
arch=('x86_64')
url="https://gitlab.com/petsam/$_pkgname"
license=('Apache2')
provides=($_pkgname)
conflicts=($_pkgname)
depends=('bash' 'coreutils' 'sed')
optdepends=('xdg-utils: open urls'
'desktop-file-utils: alternative desktop files editor'
'switcheroo-control: add context menu action for dgpu')
source=("git+$url.git")
sha256sums=('SKIP')

package() {
	cd $_pkgname
	# Install executable
	install -Dm755 "$_pkgname" "$pkgdir/usr/bin/$_pkgname"
	# Install man page
	gzip -kv9NS .gz xde-start.1
	install -Dm644 "${_pkgname}.1.gz" "$pkgdir/usr/share/man/man1/${_pkgname}.1.gz"

}
1 Like

I thought I try it out.

When running xde-start -L I get

Warning: Terminal command not found, or not valid: ' -e'
Missing argument(s) : 'No search paths are defined'
Use --help for proper usage

Ok, I see that much more must be specified to make it work.

Nevertheless, the not existing TERMINAL env var is not properly dealt with.

When running xde-start -Lmqn "*oculan*" -e GNOME -o PATH,NAME -x I get

grep: /usr/share/applications/oculante.desktop: Is a directory
sed: read error on /usr/share/applications/oculante.desktop: Is a directory
sed: read error on /usr/share/applications/oculante.desktop: Is a directory
sed: read error on /usr/share//applications/oculante.desktop: Is a directory
sed: read error on /usr/share//applications/oculante.desktop: Is a directory

So, it should be checked if a found .desktop file name isnā€™t a directory.

1 Like

Thanks. I will fix it.
Just for curiosity, what package is this file owned by?

FWIW it is really weird for a folder to be named with a .desktop extension, unless it is intentional to provoke utilities :rofl: :rofl: .

Edit: @manfredlotz I uploaded a fixed version and a PKGBUILD for the latest (git) development. Would you be so kind and test that the fix is working?

aur/oculante 0.6.64-1 (+0 0.00) (Installed)

1 Like

Now the oculante.desktop file gets ignored, presumably because the directory gets ignored. Not sure.

1 Like