PDA

View Full Version : [SOLVED] Can't make desktop entry execute a command in terminal



Mortesins93
July 9th, 2011, 09:47 AM
Hello,
I created this custom desktop entry in Lubuntu 11.04 which doesn't work:


[Desktop Entry]
Name=DocumentiAxel
Exec=sudo pcmanfm /mnt/data/.DocumentiAxel
Terminal=true
Type=Application
Icon=/usr/share/icons/elementary/places/48/folder.svg

If I change it like this:

[Desktop Entry]
Name=DocumentiAxel
Exec=gksudo pcmanfm /mnt/data/.DocumentiAxel
Terminal=false
Type=Application
Icon=/usr/share/icons/elementary/places/48/folder.svg


It works, but I want it to run in terminal. I tried creating other entries but they never work if I put "Terminal=true" even if the execution command works in the terminal if I paste it manually.
Why is this?
Hope you can help me.

koleoptero
July 9th, 2011, 11:17 AM
Try changing the exec to something like:

Exec=gnome-terminal -e "gksudo pcmanfm /mnt/data/.DocumentiAxel"

If you use some other terminal then change the gnome-terminal with whatever that is (xfce4-terminal, terminator, etc).

Mortesins93
July 10th, 2011, 05:42 PM
Thank you so much, it works even though I don't get why it can't be automatically run in the terminal like in Ubuntu and Xubuntu. Anyways, I had searched around and I knew the command lxterminal -e would open a terminal and then run a command but I forgot about the "". Thank you so much again.

koleoptero
July 10th, 2011, 05:47 PM
Thank you so much, it works even though I don't get why it can't be automatically run in the terminal like in Ubuntu and Xubuntu. Anyways, I had searched around and I knew the command lxterminal -e would open a terminal and then run a command but I forgot about the "". Thank you so much again.

Glad I could help :) The "" are needed if the command contains spaces, if you just wanted to run for example top, you wouldn't need them :)

Mortesins93
July 10th, 2011, 05:50 PM
Ok, thanks that make more sense