LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-04-2019, 09:15 PM   #1
flippi
LQ Newbie
 
Registered: Oct 2019
Posts: 5

Rep: Reputation: Disabled
Question 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
 
Old 10-05-2019, 02:19 AM   #2
ArfaSmif
Member
 
Registered: Oct 2008
Location: Brisbane Australia
Distribution: Fedora, Centos
Posts: 288

Rep: Reputation: 60
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.
 
Old 10-07-2019, 08:31 AM   #3
flippi
LQ Newbie
 
Registered: Oct 2019
Posts: 5

Original Poster
Rep: Reputation: Disabled
Red face

Quote:
Originally Posted by ArfaSmif View Post
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???

Last edited by flippi; 10-07-2019 at 08:34 AM.
 
Old 10-09-2019, 10:04 PM   #4
ArfaSmif
Member
 
Registered: Oct 2008
Location: Brisbane Australia
Distribution: Fedora, Centos
Posts: 288

Rep: Reputation: 60
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.

Last edited by ArfaSmif; 10-09-2019 at 10:05 PM. Reason: spelling mistake
 
Old 10-10-2019, 02:29 PM   #5
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 12,522
Blog Entries: 9

Rep: Reputation: 3393Reputation: 3393Reputation: 3393Reputation: 3393Reputation: 3393Reputation: 3393Reputation: 3393Reputation: 3393Reputation: 3393Reputation: 3393Reputation: 3393
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
anyone using GfxTablet to enable smartphone as digitizer? SaintDanBert Linux - Desktop 2 07-10-2014 04:02 PM
LXer: The Ultimate Sudo FAQ To Sudo Or Not To Sudo? LXer Syndicated Linux News 13 04-13-2013 01:36 AM
(Sudo) command can't run by sudo rahilmaknojia Linux - Server 8 06-25-2010 09:30 AM
Trying to get sudo to work in a .desktop icon command, under SUSE 10.1 DeekBeek Linux - Software 11 08-12-2006 08:17 PM
My Network Browsing desktop icon is gone > my network browsing desktop icon i kkempter SUSE / openSUSE 1 01-12-2006 12:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration