I want to make a button on my lxpanel to launch a program that prints out Hello World!
in a pop-up lxterminal, so I use the technique that I successfully implemented before in Debian 7, which is:
gedit /bin/hello.sh
(contents below):#!/bin/bash echo 'Hello World!';
gedit /usr/share/applications/hello1.desktop
(below):[Desktop Entry] Version=1.0 Type=Application Name=Hello1 Comment=Test the terminal running a command inside it Exec=lxterminal -e "/bin/hello.sh" StartupNotify=true Icon=utilities-terminal Terminal=true Categories=Utility;
Last I
chown
andchmod
both of the above files as below:-rwxr-xr-x 1 a adm 230 1月 1 13:02 /usr/share/applications/hello1.desktop* -rwxr-xr-x 1 a adm 240 1月 1 12:57 /usr/share/applications/hello1.desktop~* -rwxr-xr-x 1 a adm 194 1月 1 12:04 /usr/share/applications/hello.desktop* -rwxr-xr-x 1 a adm 195 1月 1 12:03 /usr/share/applications/hello.desktop~* -rwxrwxr-x 1 a adm 87 1月 1 12:35 /usr/share/applications//bin/hello.sh* -rwxrwxr-x 1 a a 87 1月 1 12:25 /usr/share/applications//bin/hello.sh~* -rwxrwxr-x 1 a adm 134 12月 13 09:56 /usr/share/applications//bin/hello_world.sh*
Unfortunately no matter what I do, the hello1.desktop
file only can open a blank lxterminal, and there is no output.
I am running Lubuntu 14.04 and have followed the following tutorials to link a desktop file to a *.sh script program:
- Create a .desktop file that opens and execute a command in a terminal
- Starting a script in a Desktop icon
- http://ubuntuforums.org/showthread.php?t=2194284
- http://lkubaski.wordpress.com/2012/06/29/adding-lxde-start-menu-and-desktop-shortcuts/
- http://forum.lxde.org/viewtopic.php?f=8&t=31647
- http://forum.lxde.org/viewtopic.php?f=26&t=31373
- https://bugs.launchpad.net/ubuntu/+source/lubuntu-default-settings/+bug/975152
I also made the following variations to hello1.desktop
:
- line 10 (last line) - I also tried it without a semi-colon.
- line 9 (the "Terminal" line) - tried "false"
line 6 (the "Exec" line) - tried these:
Exec=sh /bin/hello.sh; Exec=lxterminal -e “/bin/hello.sh” Exec=/bin/hello.sh Exec=sh -c /bin/hello.sh Exec=lxterminal -x sh -c 'echo hello' Exec=sh -c 'gnome-terminal echo hello' Exec=sh -c 'echo hello' Exec=sh /bin/hello.sh Exec=sh -c /bin/hello.sh
But in the end all are the same (except when Terminal=false
on line 9 there is no terminal, obviously).
I can see hello1
under System -> Accessories, but when I click on it still just a blank screen pops out. In debian 7.5 LXDE wheezy this is really easy to do successfully, but what is wrong in Lubuntu 14.04 to make it so much more difficult?
Andrew
ls
output? Why are there files like/usr/share/applications//bin/hello.sh
? Why are you adding system-level files to test this instead of user-level (i.e. in~/bin
and~/.local/share/applications
). How are you usinggedit
withoutsudo
to edit system-level files? Also note you have curly quotes in one of those exec lines:Exec=lxterminal -e “/bin/hello.sh”
(I know this is an old question - just voicing my concerns in case of similar questions in the future.) – wjandrea Feb 12 '19 at 20:35