(12.04 LTS) I've got a BASH script that opens a number of gnome terminals. When I run the script from the cmdline
/usr/local/bin/myScript, it works great. (All windows pop open and run as expected.) After creating a quick launch button,
gnome-desktop-item-edit ~/Desktop/ --create-new the behavior changes. That is, only one terminal will open. When I close it, the next terminal will open, and so on. The problem is, I only get one terminal window at a time, not all of them at once.
The odd thing, launching the script from the button works fine, until I close the window that I used to create the button. From that point on, I get the one terminal at a time behavior. The quick launch button uses the same cmd that I use in the cmdline. (above)
Why is the button launch giving me different behavior from the cmdline?
Or a better question, how do I fix it?
The odd behavior is probably not due to the closing of the window that was used to create the button. After playing w/ it some more, a better description would be: When I close ALL the terminal windows, and launch the script w/ the button, I get the one window at a time behavior. If I have at least one terminal window open, it executes "almost" fine. One window is giving me a 'cmd not found' error. The cmd is in that windows directory. It runs fine if I repeat that same cmd in that window. (Again, the script runs fine if launched from the cmdline.)
The .desktop file:
#!/usr/bin/env xdg-open [Desktop Entry] Version=1.0 Type=Application Terminal=false Icon[en_US]=/usr/share/icons/gnome/32x32/apps/ksysguard.pgn Name[en_US]=Stuff Exec=/usr/local/bin/myScript Comment[en_US]=More_stuff Name=blue Comment=SomeStuff Icon=/usr/share/icons/gnome/32x32/apps/ksysguard.png
The one window @ a time is solved by changing
Terminal=true in .desktop above. The other issue of 'cmd not found' still remains. I confident it is a env difference issue. The cmdline-launch has many more
env entries than the button-launch. One obvious diff is the $PATH var. The cmd is not in the button-launch $PATH, but is for the cmdline-launch. This shouldn't matter as the script starts with:
SHLVL=2 make a difference?
I am not sure what other ENV var I should be looking at in this text.