Thanks eso, the various info in your post actually got me to the solution… I want to mark your post as the solution since it technically contains the answers, but I’m summing everything up here plus some other details, and people can read this post and see that I credit you with the info I needed to solve the problem.
The 3 major problems were;
- KDE Menu doesn’t like quotes, but puts them in automatically if you use the button to browse to your file and the path contains spaces
- The path contains spaces
- The script needs the proper header
I thought Linux bash scripting and launching shortcuts was pretty much the same as Windows here, but it seems I’ve managed to escape the gory details until now, hence my utter confusion…
So - I realised a couple things that were obfuscating the truth and doing a good job of keeping me in the dark… first thing; I realised the only good example I have of a script being run by the KDE Menu is a script I didn’t write, it’s for 4kdownloader and the standalone version comes with a script you can run that just runs it in place. Opening it up, it seems it does some fancy stuff to run in place, it builds an absolute path to the executable (and also sets up some environment variables)
SCRIPT_DIR=`cd "$SCRIPT_DIR"; pwd` #make path absolute
SECONDLY - the path to that program, just so happens to not contain spaces! I think I purposefully set it up that way due to previous issues and seem to have forgotten that’s why I did it. OR I just got extremely lucky when I made this folder. It’s on an ntfs partition, and instead of “Program Files” it’s “Programs-Linux”
You’d think then, that KDE Menu would NOT insert those quotes itself when I use it’s own “browse” button??
THAT button right there, using that button to browse to your file, if that resulting path contains spaces, quotes will be inserted around the path! Which makes sense! Except that it seems KDE Menu doesn’t like quotes!
Why would it do that to itself? Anyway, moving on…
Ok so I copy my invoicer.sh script to my home folder (so it doesn’t have spaces in the path) and edit the script to cd into the project folder before starting the venv and running python. I make a shortcut to that in the KDE Menu. New error:
execvp: Exec format error
Searching the net for that shows me that the header of the bash file is wrong.
So the final script that works when I link it in a KDE Menu item, is…
cd "/home/domarius/My Files/Projects/Invoicer/work/Invoicer/"