[SOLVED] How do I find the target of a desktop launcher? How do I edit an existing launcher?
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How do I find the target of a desktop launcher? How do I edit an existing launcher?
In Windows, all you have to do is right click on a menu or desktop shortcut and click properties. One of the resulting tabs tells you what directory and what program or batch file the shortcut supposed to run.
I have not found any way to see the target of linux launchers in either the applications menu or my desktop. Where do I look for the path and target of a launcher?
If it matters, I am using the mate desktop on devuan linux.
The next thing I want to do is make an existing launcher point to a shell script rather than a program. How do I edit a launcher?
Running these scripts resulted in a launcher, Applications -> Games -> Neverwinter Nights. The thing is, there is a massive amount of user created downloadable content that goes with the pre-canned game, and I needed to know where the game was installed in order to add this content. As far as I can tell, the launcher gives no clue where the program (or whatever) it points to is installed. I had to decipher the install scripts to find where the game was installed. Fortunately, I was able to locate the directory where Neverwinter is installed.
The reason I want to edit the Neverwinter Nights launcher is I want to change the CD keys based upon the userid. I have multiple licenses for use in multiplayer mode. Each license corresponds to a set of CD keys. If I can change the CD keys based upon the userid that is logged on, that means whoever the user is, he or she gets presented with the proper avatar they created in the game independent of the computer where they are sitting. It would be fairly straightforward to write a shell script to switch out the CD keys file depending on the userid.
That's odd, because right-clicking works for me. The launcher file will be in the ~/Desktop folder. You'll probably find you can't edit one working from the file-manager, but you can from the terminal:
$ pluma Desktop/whatever.desktop
The menu uses .desktop files, which are probably in ~/.config/autostart or somewhere like that.
If it's in the desktop icons / taskbar / and such. In the menu it can depend on the distro. For debian based ones, menu / libremenu manages the menu items. Normally with menu entries in /usr/share/menu/. But depending on the environment it could be other places like a .menu file in /etc/xdg/menus/ (XFCE4?). YMMV
That's odd, because right-clicking works for me. The launcher file will be in the ~/Desktop folder. You'll probably find you can't edit one working from the file-manager, but you can from the terminal:
$ pluma Desktop/whatever.desktop
The menu uses .desktop files, which are probably in ~/.config/autostart or somewhere like that.
OK, when I right-click on either the launcher on the Desktop or the file in /home/TNAndy/Desktop, I do get a window named "Neverwinter Nights Properties". It contains the following on the "Basic" tab:
[The icon picture]
Name: Neverwinter Nights
Description: [blank]
Command: neverwinter-nights
Comment: [blank]
Accessed: Sat 13 Jan 2018 10:00:24 AM EST
Modified: Sat 13 Jan 2018 10:00:23 AM EST
There's an Emblems tab with a bunch of generic icons.
There's a Permissions tab that says I own it (read and write) and everyone else can only read it.
The Notes tab is blank.
What I glean from this is the launcher name is "Neverwinter Nights". The location of the launcher is /home/TNAndy/Desktop. The target command is "neverwinter-nights".
The specific problem is I don't know where, in the Linux directory tree, the command "neverwinter-nights" is located. I found the directory /usr/local/share/games/neverwinter-nights where all the game files are located, but not the shell script "neverwinter-nights" that appears to be the target of the launcher. Well, I assume "neverwinter-nights" is a shell script since the Linux executable is called nwmain .
When I tried to edit the launcher, there were no contents to the file--it was blank.
$ pluma /home/TNAndy/Desktop/"Neverwinter Nights"
There was nothing there.
By the way, for this discussion, I substituted "TNAndy" for my actual user name which obviously contains no capital letters.
When I tried to edit the launcher, there were no contents to the file--it was blank.
$ pluma /home/TNAndy/Desktop/"Neverwinter Nights"
There was nothing there.
Do this to find the name of the desktop file, which is not going to be "Neverwinter Nights" and which will have the extension .desktop
$ ls /Desktop
$(which) includes the $PATH and the executable that it defaults to. The one that it finds "first". The one that will execute if you ONLY enter the executables name on the command line. There could be multiple versions of said executable, and changing the $PATH variable sequence can make it "default" to a different one. Not that there are, but if one user starts X and another launches that executable, there "could be" differences. Unlikely though. Except for dev types that might put $HOME/compiled/thing/ in $PATH before /usr/src/ and /usr/local/src/ while "testing" changes. Although these days a VM or filesystem with snapshots might be the path of least resistance. Except in work environments where a developer is just another "user" with "some" access to things like a compiler.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.