0

i have installed a program via github in:
/home/user/folder/program.

to get this to run via the terminal i use the following commands.
cd folder
sudo ./program

but i would like to have a short cut and tried to make one via alacarte.
filled in the following data:

name: programname (is not the same as the actual name of the program in the folder)
command: /home/user/folder/program.
icon: changed the icon into a local file. icon.ico
clicked the: launch in terminal?

i now find the "programname" with the correct icon but when i try to run it a icon appears in the nautilus taskbar that starts to blink for a while and then disappears. Also no terminal is opened.

i assume this has to do with an error in the command line: just don't know how to correct it.

hope someone is willing to enlighten me on my error.

Kind regards

Matthieu

  • Please let me know if it doesn't work. – Jacob Vlijm Aug 02 '17 at 14:41
  • actually i read through that but i don't feel these have anything to do with each other or i must really not get it (which is quite possible), my icon name is actually icon.ico and that works perfectly.

    my question is about how to start a file via sudo ./program that is located in a folder/tree.

    – Matthieu Kints van Aug 02 '17 at 14:49
  • no problem, but do you have any idea on how i should adjust it to work? – Matthieu Kints van Aug 02 '17 at 15:10
  • it's cli, and needs to run from it's own directory (that's why i'm strugling). ii tried to run xprop WM_CLASS from a second terminal while running th program on a first terminal but all the respons i get is: WM_CLASS(STRING) = "gnome-terminal-server", "Gnome-terminal"

    [Desktop Entry] Comment= Terminal=true Name=ut71c Exec=/home/matt/ut71dmm/ut71dmm Type=Application Icon=/home/matt/ut71dmm/icon.ico did not add to launcher yet. also there is not a 2e file in the applications folder.

    – Matthieu Kints van Aug 02 '17 at 15:29
  • needs to run from it's own directiory as far as i know. not 100% certein of this though.

    tried to run that command again but point to the pointer to the file. but it just says nautilus as i actually point to a nautilus window. als i tried runnin two terminals again but now point to the 2e terminal but get the same "gnome-terminal-server" response

    – Matthieu Kints van Aug 02 '17 at 15:42
  • oke. I'll wait for someone else. thanks for the effort anyway. – Matthieu Kints van Aug 02 '17 at 16:03
  • *DO NOT* edit your post for the sole reason of bumping it to the main page. Only edit your question to add information, not for the sole reason of bumping it. Such bumps are frowned upon. – Thomas Ward Aug 03 '17 at 11:30
  • thank you for that info: that is exactly the reason why i added (bumped) so at least people would be aware of what i did and why. will not happen again. on the other side i believe commenting with bold, cursive capitals is commanly interpreted as agressive behavier and therefor also frowned upon. just saying. – Matthieu Kints van Aug 03 '17 at 12:28

1 Answers1

1

You can take inspiration from the similar question here.

You can call the application in the .desktop file as:

# Exec= gksudo -k -u root <absolute path to your executable>
Exec= gksudo -k -u root /home/user/folder/program
AmeyaVS
  • 536
  • just an additional question.. is there a way to incorporated the password in the command?

    i understand that generally this is not a good idea, safety wise. unfortunately this is a program that needs to be started and stopped frequently (but probabaly also manytimes outside the timeframe) so this will make me need to enter the password again and again. no i'm aware that one can change this time frame but i rather not (rather decrease it then increase).
    as even to the programmer says it is unfortunate that root access is need for this program.

    – Matthieu Kints van Aug 03 '17 at 13:13
  • ps: i tried to look for that in the linked page, did find rome references but not a real answer. – Matthieu Kints van Aug 03 '17 at 13:29
  • i tried: Exec= echo | gksudo -S -k -u root /home/user/folder/program, doesn't seem to work though – Matthieu Kints van Aug 03 '17 at 13:55
  • could this answer be helpfull? sounds dangerous though so i'd rather ask before i try. also in this particular case.. what would the correct command be. https://askubuntu.com/questions/159007/how-do-i-run-specific-sudo-commands-without-a-password – Matthieu Kints van Aug 03 '17 at 14:04