Xfce Forum

Sub domains
 

You are not logged in.

#1 2024-10-12 16:01:30

advice1010
Member
Registered: 2023-02-19
Posts: 105
LinuxChrome 126.0

Is it possible to use HOME environment variable in launch commands

I thought I was able to get this to work in the past but now this no longer seems to work when I tried this.
I was wondering if it is possible to use the $HOME environment variable in launch commands?
For example lets say you create a launcher in your Whisker Menu for an application found in your HOME directory, if it contains the absolute path to that application it works fine, if in Whisker Menu you right click on that program and choose "Edit Application"
The "Edit Launcher" dialog will show up and in the "Command:" field I am not able to replace the /home/<username>/ with $HOME.
When I do I get an error dialog that reads

Failed to execute "$HOME/<commands path/name>"
Failed to execute child process "$HOME/<commands path/name>" (No such file or directory)

There are no spaces in the path/application name but I tried both with and without quotes
$HOME/<commands path/name>
"$HOME/<commands path/name>"

If anyone has any ideas please let me know.
Thank You

Offline

#2 2024-10-12 20:44:24

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,481
LinuxFirefox 131.0

Re: Is it possible to use HOME environment variable in launch commands

Try embedding the command in a sh or bash subshell. For example:

bash -c "$HOME/command_path/name"

...or expand $HOME - I don't believe the built-in interpreter supports variable expansion.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.007 seconds, 7 queries executed - Memory usage: 524.35 KiB (Peak: 530.86 KiB) ]