how to get a desktop "luncher" icon that runs a specified program in lxterminal??
Posted: Fri Nov 10, 2017 11:08 pm
I am trying to create a shortcut (launcher) icon on my desktop in LXDE
that, when it is double-clicked will (1) run a terminal
window, (I require LXTerminal with a white background),
and (2) execute the command specified in my shortcut
desktop file which is: /usr/local/lib/mlab/mlab (This
should run the specified executable mlab in the Terminal
window that has been started in step (1).
1. I used google to find a way to create
a "shortcut" (aka "launcher") icon on my LXDE desktop, including
visiting lxde forum links.
There were several confusing and incomplete
posts, none of which dealt with this exact issue (a desktop icon
for launching an executable in a Terminal window).
[I have played around with many permutations with no success.]
2. I clicked in the "background" to get a menu, and selected "Create
new", this offered a sub-menu; I choose "empty file" I was prompted for
the filename, and I entered mlabt1
This created an "page-of-lines" icon on the desktop labeled
"mlabt1"
3. I right-clicked on this new mlabt1 icon, and selected properties in
the pop-up menu. The information window that appeared said this icon
corresponds to an empty file in ~/Desktop/ with permissions 334.
I changed these permissions to 775.
4. I inserted the following text into this file: (suggested by web-posts)
[Desktop Entry]
Name=mlabt1
Type=Application
Exec=sh /usr/local/lib/mlab/mlab
Terminal=true
Path=/home/knott
GenericName=MLAB
X-KeepTerminal=true
The mlabt1 icon changed immediately to a "gear".
[In fact, it is unneccessary to go through click create new, properties,
etc. All one needs to do is create a file in ~/Desktop with the
(hopefully) appropriate content using emacs or any other editor.]
5. I double-clicked on the mlabt1 icon and a proper LXterminal window
pops-up!! BUT the mlab program specified in the Exec-line
was NOT run! There is a bash prompt in the terminal window, and
if I type "mlab", the program runs.
6. I edited the file ~/Desktop/mlabti to change the
Exec-line to: Exec=/usr/local/lib/mlab/mlab and double-clicked to try to
run mlab. No joy. The terminal window popped-up with a bash prompt
as before!
7. So what's missing?
There seem to be at least three places where such "shortcut files go.
~/Desktop/
~/.local/share/applications/
/usr/share/applications/
I copied mlabt1 into ~/.local/share/applications/ -- nothing
new appeared. I rebooted. Still no presence of mlabt1 from
the /local/share/applications directory.
8. So what am I doing wrong? [And by the way, is there a document that
describes the LXDE "desktop" program and all the files it uses, whate
tey are for, and where they live, etc.??]
Is being able to get a shortcut to run a program in a
new terminal window impossible? Is this a bug?
In the file below, I take Name=mlabt1 to mean specifiying the label on
the icon appearing in the Desktop. I take Path=/home/knott to
specify my working directory (and indeed, that is what pwd in the
new terminal window shows). I have no idea what GenericName=MLAB and
X-KeepTerminal=true really mean.
[Desktop Entry]
Name=mlabt1
Type=Application
Exec=/usr/local/lib/mlab/mlab
Terminal=true
Path=/home/knott
GenericName=MLAB
X-KeepTerminal=true
So where should I put a launcher file, and what should be in it??
Does it need a special name? By the way there is a
permissions tab on the properties window for an icon, I changed the
appropriate enties to 'Anyone'. It made no difference.]
I need step-by-step instructions if anyone has them>
Thanks, garyknott@gmail.com
that, when it is double-clicked will (1) run a terminal
window, (I require LXTerminal with a white background),
and (2) execute the command specified in my shortcut
desktop file which is: /usr/local/lib/mlab/mlab (This
should run the specified executable mlab in the Terminal
window that has been started in step (1).
1. I used google to find a way to create
a "shortcut" (aka "launcher") icon on my LXDE desktop, including
visiting lxde forum links.
There were several confusing and incomplete
posts, none of which dealt with this exact issue (a desktop icon
for launching an executable in a Terminal window).
[I have played around with many permutations with no success.]
2. I clicked in the "background" to get a menu, and selected "Create
new", this offered a sub-menu; I choose "empty file" I was prompted for
the filename, and I entered mlabt1
This created an "page-of-lines" icon on the desktop labeled
"mlabt1"
3. I right-clicked on this new mlabt1 icon, and selected properties in
the pop-up menu. The information window that appeared said this icon
corresponds to an empty file in ~/Desktop/ with permissions 334.
I changed these permissions to 775.
4. I inserted the following text into this file: (suggested by web-posts)
[Desktop Entry]
Name=mlabt1
Type=Application
Exec=sh /usr/local/lib/mlab/mlab
Terminal=true
Path=/home/knott
GenericName=MLAB
X-KeepTerminal=true
The mlabt1 icon changed immediately to a "gear".
[In fact, it is unneccessary to go through click create new, properties,
etc. All one needs to do is create a file in ~/Desktop with the
(hopefully) appropriate content using emacs or any other editor.]
5. I double-clicked on the mlabt1 icon and a proper LXterminal window
pops-up!! BUT the mlab program specified in the Exec-line
was NOT run! There is a bash prompt in the terminal window, and
if I type "mlab", the program runs.
6. I edited the file ~/Desktop/mlabti to change the
Exec-line to: Exec=/usr/local/lib/mlab/mlab and double-clicked to try to
run mlab. No joy. The terminal window popped-up with a bash prompt
as before!
7. So what's missing?
There seem to be at least three places where such "shortcut files go.
~/Desktop/
~/.local/share/applications/
/usr/share/applications/
I copied mlabt1 into ~/.local/share/applications/ -- nothing
new appeared. I rebooted. Still no presence of mlabt1 from
the /local/share/applications directory.
8. So what am I doing wrong? [And by the way, is there a document that
describes the LXDE "desktop" program and all the files it uses, whate
tey are for, and where they live, etc.??]
Is being able to get a shortcut to run a program in a
new terminal window impossible? Is this a bug?
In the file below, I take Name=mlabt1 to mean specifiying the label on
the icon appearing in the Desktop. I take Path=/home/knott to
specify my working directory (and indeed, that is what pwd in the
new terminal window shows). I have no idea what GenericName=MLAB and
X-KeepTerminal=true really mean.
[Desktop Entry]
Name=mlabt1
Type=Application
Exec=/usr/local/lib/mlab/mlab
Terminal=true
Path=/home/knott
GenericName=MLAB
X-KeepTerminal=true
So where should I put a launcher file, and what should be in it??
Does it need a special name? By the way there is a
permissions tab on the properties window for an icon, I changed the
appropriate enties to 'Anyone'. It made no difference.]
I need step-by-step instructions if anyone has them>
Thanks, garyknott@gmail.com