Xde-start - a powertool for .desktop files

FWIW I checked the AUR package and there is no reason for a subfolder. I will report it to the packager, as it seems a typo or copy/paste mistake.

The file is installed in a subdir, and IIRC my script has a limitation for subfolders.

I was going to fix it in a later stage, as such cases are super rare, even if correct by protocol. So, time is up :smile: .

It would be easiest if you only look at files with a name *.desktop.

What is about the TERMINAL variable?

This message

Warning: Terminal command not found, or not valid: ' -e'

isn’t really good.

IMHO, this

cRunInTerminal="${XDE_TERMINAL:-$TERMINAL} -e"

is bad. Setting a default values to something which might not exist cannot be proper.

1 Like

I agree. Thanks for the feedback. It motivates me!!! :laughing:
I’ll fix it as well.

It’s a known workaround for the need of a default terminal application. Several DEs look for it, but not all. XDE_TERMINAL is from my own project.

I uploaded fixes for both issues (TERMINAL message and subfolders lookup).
Would you confirm it works now, please?

xde-start -Lmqn "*ocu*" -e GNOME -o PATH,NAME -x gives first

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

which is bad.

Then it gives


which is good.

A general recommendation from my side when doing bash or whatever scripts.
Use at least

set -eu

in the beginning which is always helpful to avoid unwanted errors.

1 Like

Fixed! Thank you very much!
I wish there were more like you, so I would have improved much faster. :person_shrugging:

I was caught in the usual trap of Programmer testing his own program, on his own system :laughing: .

I used to test like that in the past. I have to be more humble and do it again :slightly_frowning_face: .

1 Like

Now things are looking good.

Using set -eu requires more things to consider.

First set -u isn’t so complicated as you have to make sure that you don’t have undefined variables.

set -e is more tricky.

For example. Imagine in your script you have a command mycmd where it is ok if it returns 0 or <> 0 (means errror).

In such a case you could code

mycmd || true

A very good info about these things provide http://redsymbol.net/articles/unofficial-bash-strict-mode/

1 Like