It does work
...even tested it, but the launcher icon is unresponsive for about 7 seconds after you clicked. If you click again after these 7 seconds, it will work again.
This "break" is caused by the icon, waiting for a window to appear. This won' t be the case, since the appearing gnome-terminal
-window is "claimed" by the gnome-terminal
's launcher icon, and your "home-made" icon does not recognize the window as "his".
Solution?
You could solve the issue by adding a line to your launcher (14.04)
StartupWMClass=gnome-terminal
or (16.04):
StartupWMClass=gnome-terminal-server
however, only do this for reasons of testing, don't use this as a permanent solution; having mutiple .desktop
files, possibly claiming the same WM_CLASS
in their main command is a bad idea, it will cause clashes in how gnome-terminal
appears in the Unity launcher.
Better solution
Better add your script as a right-click option to the existing gnome-terminal
launcher:
- Copy the global
gnome-terminal
launcher from /usr/share/applications
to
~/.local/share/applications
:
cp /usr/share/applications/gnome-terminal.desktop ~/.local/share/applications
Open the file with gedit
:
gedit ~/.local/share/applications/gnome-terminal.desktop
Change the line:
Actions=New;
into:
Actions=New;My Script;
and add the section:
[Desktop Action My Script]
Name=My Script
Exec=gnome-terminal -e "bash /absolute/path/to/your/script.sh"
to the very end of the file. Then log out and back in, and you'll have your script available as a quicklist- shortcut in the gnome-terminal
launcher.
.desktop
file as described here ? Did you add theType=Application
and possiblyTerminal=true
bits ? Maybe Unity needs them.