1

Trying to create a .desktop file for a program and it requires a universal username path so instead of Exec=/home/john/myscript.sh it's Exec=/home/$USER/myscript.sh.

in .desktop files you need an exact path and $USER does not work. Neither does $LOGNAME.

.Desktop EXEC universal home path

^This did not work either (the edited solution not the one voted as). Because this solution did not work, it is not relevant to this question.

Not sure what else to try. If someone could chime in it'd help a lot. Thank you.

Here is my desktop file

[Desktop Entry] Type=Application Encoding=UTF-8 Version=1.0 Terminal=false Exec=/bin/bash -c '/home/$USER/mycroft-core/start-mycroft.sh all' Name=Mycroft AI Icon=/usr/share/MycroftIcon/MycroftIcon.jpg X-GNOME-Autostart-enabled=true

Edit: I had a typo in my code the solution provided by @mchild works:

The solution is: Exec=/bin/bash -c '/home/$USER/myscript.sh'

John
  • 83

0 Answers0