LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How Can I make A .desktop Icon For A Sudo Command To Open GfxTablet? (https://www.linuxquestions.org/questions/linux-newbie-8/how-can-i-make-a-desktop-icon-for-a-sudo-command-to-open-gfxtablet-4175662031/)

flippi 10-04-2019 09:15 PM

How Can I make A .desktop Icon For A Sudo Command To Open GfxTablet?
 
I am new here been trying to find a way to make a .desktop icon for the sudo command to open the program called GfxTablet but cannot get any info that actually works.

All the plethera of commands I have tried fail to launch tilix and or input a command, I have made lots of .desktop files launching programs them selves but never for a command line to be executed in sudo or none sudo.

All I know is the Exec line has to be precise in what it dictates to perform the operation.

If I try to launch the default terminal as in typing the Exec line to state Exec=tilix nothing happens at all, but if I go into say UXterm and type tilix then hit enter it opens, I tried changing the default terminal to one of 3 or 4 terminals on this build of disco dingo 19.04, but none launch from the Exec= line if it includes the folder location followed by the file name when I am writing the .desktop launcher. I am making it executable and running via open with Run Software option and also even dragging the .desktop file made into tilix.

The file I want to launch I don't know what file type it is or how to find that file type extension name, as I have done properties via right click which gives no name for file type there, or right clicking choosing the option to look at it's location to see it's path also gives no indication for a file extension.

The path to the file I want to make this .desktop launcher for is as follows: /home/pc/GfxTablet/driver-input/networktablet

networktablet is the file name I need to launch

launching the application which works in all terminals if typed in is as follows:

sudo ./networktablet


I have been at this 36 hrs plus now trying to figure it out I had been getting some intermittent help but that failed, it's driving me crazy, I want it to add the icon to the docky dock, as I am making my own customized distribution.

But I would like to transfer it to other machines if necissary at some stage when customized fully, so I need it to be saved when completed as a systemback backup to do that the easy way with everything as is ready to go, I want it on the dock when re-installing or installing to any machine and the ease of accessing it on any machine from the dock by simply clicking a icon for it as aposed to typing it in to launch all the time through a terminal I have to click and open first, the same for if I wish to add further commandlines to open one click instead of open a command shell then type it in, I would like to have them in the app search as well meaning they need to be a .desktop file in the .local/share/applications folder that much I have learned with making other launchers.

Please can someone help I am very new to linux as in days but am good with windows not so much in commandline but anything else, I just switched os's for good I prefer the security and the speed and fluidity of the ubuntu os.

I'm hoping for some help to come, so I can keep my hair as it is before I pull it all out lol

Thanks in advance

ArfaSmif 10-05-2019 02:19 AM

It's fairly likely that /home/pc/GfxTablet/driver-input is NOT in your PATH variable (type in "echo $PATH" will show you where your shell looks for commands to run.)

If you make a desktop icon with the following as the command

sudo /home/pc/GfxTablet/driver-input/networktablet

you will find that the command will work.

You have indicated that when you type in "sudo ./networktablet" the command runs. This indicates to me that you are actually already in the directory /home/pc/GfxTablet/driver-input (cd /home/pc/GfxTablet/driver-input) and therefore the command (networktablet) runs.

flippi 10-07-2019 08:31 AM

Quote:

Originally Posted by ArfaSmif (Post 6044031)
It's fairly likely that /home/pc/GfxTablet/driver-input is NOT in your PATH variable (type in "echo $PATH" will show you where your shell looks for commands to run.)

If you make a desktop icon with the following as the command

sudo /home/pc/GfxTablet/driver-input/networktablet

you will find that the command will work.

You have indicated that when you type in "sudo ./networktablet" the command runs. This indicates to me that you are actually already in the directory /home/pc/GfxTablet/driver-input (cd /home/pc/GfxTablet/driver-input) and therefore the command (networktablet) runs.

Thanks for this, I have tried to no avail prior the specific command, I am facing a major dilema in relation to having stupidly followed a guide that used chmod commands supposedly to allow it from a AskUbuntu post and it removed my permissions changed them all, I have been to hell and back but managed to resolve it all, the big issue is that the program no longer runs, and above all the theme works in basic nautilus but not if I sudo nautilus it looks like classic mode in windows, research tells me it's the look and feel found in root mode but I remember prior to the monumental destruction of the permissions that the sudo nautilus theme matched the custom theme and icons in the same as the standard nautilus command displayed those custom theme elements now all I have is bland basic creamy colored folder icons and barely any home folders like downloads and documants blah blah are not present in sudo nautilus like they are in basic nautilus??? Any idseas on that please.

this is what nautilus looks like none sudo

https://i.postimg.cc/Pxt3RYbK/Screen...7-13-24-38.png

And now when I type sudo nautilus it used to look like the above image exactly but now it looks like the below image?

https://i.postimg.cc/kXFykB4p/Screen...7-13-24-19.png

Needles to say I am gutted and above all confused to f@ck lol???

ArfaSmif 10-09-2019 10:04 PM

I have tried to answer your original post but your reply barely mention that. Your current post is difficult for me to understand. It sounds like you have multiple problems/confusions. It also seems that you have been jumping from a normal user account to the root account and therefore have a very inconsistent system set up. If it is at all possible I would start again and reinstall the operating system and use the root account only when it is required. Sorry but I can't help you at this stage because there is not enough information to proceed and your last post is very confusing to me.

ondoho 10-10-2019 02:29 PM

How Can I make A .desktop Icon For A Sudo Command
Literally answering that question.
  • write a script that does what you want
  • incl. that script to /etc/sudoers as one that doesn't require password input. Examples.
  • only when all that works, add the Exec=/full/path/to/script to your .desktop


All times are GMT -5. The time now is 06:22 AM.