LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 01-13-2018, 12:02 PM   #1
tnandy
Member
 
Registered: Oct 2003
Location: Tennessee
Distribution: Fedora 22, CentOS
Posts: 177

Rep: Reputation: 16
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?

[end question]
[begin rant]

The reason I'm asking this is I installed Neverwinter Nights using a pair of scripts named play-neverwinter-nights.sh and play-anything.sh that I found here:
https://wiki.dotslashplay.it/en/game...rwinter-nights

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.

[rant over]

Thanks!
 
Old 01-13-2018, 12:20 PM   #2
DavidMcCann
LQ Veteran
 
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Xubuntu
Posts: 5,411

Rep: Reputation: 1883Reputation: 1883Reputation: 1883Reputation: 1883Reputation: 1883Reputation: 1883Reputation: 1883Reputation: 1883Reputation: 1883Reputation: 1883Reputation: 1883
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.
 
Old 01-13-2018, 02:15 PM   #3
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 3,994
Blog Entries: 1

Rep: Reputation: 846Reputation: 846Reputation: 846Reputation: 846Reputation: 846Reputation: 846Reputation: 846
right mouse -> properties

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
 
Old 01-13-2018, 03:00 PM   #4
fatmac
Senior Member
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Posts: 3,292

Rep: Reputation: Disabled
Most games will be in the /usr/games directory.
 
Old 01-13-2018, 04:25 PM   #5
tnandy
Member
 
Registered: Oct 2003
Location: Tennessee
Distribution: Fedora 22, CentOS
Posts: 177

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by DavidMcCann View Post
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]

Type: desktop configuration file (application/x-desktop)
Size: 185 bytes (185 bytes)

Location: /home/TNAndy/Desktop
Volume: unknown

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.
 
Old 01-14-2018, 05:17 AM   #6
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 13,223
Blog Entries: 9

Rep: Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617
Quote:
Originally Posted by tnandy View Post
The specific problem is I don't know where, in the Linux directory tree, the command "neverwinter-nights" is located.
Code:
which neverwinter-nights
 
Old 01-14-2018, 12:17 PM   #7
DavidMcCann
LQ Veteran
 
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Xubuntu
Posts: 5,411

Rep: Reputation: 1883Reputation: 1883Reputation: 1883Reputation: 1883Reputation: 1883Reputation: 1883Reputation: 1883Reputation: 1883Reputation: 1883Reputation: 1883Reputation: 1883
Quote:
Originally Posted by tnandy View Post
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
 
1 members found this post helpful.
Old 01-22-2018, 09:57 PM   #8
tnandy
Member
 
Registered: Oct 2003
Location: Tennessee
Distribution: Fedora 22, CentOS
Posts: 177

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by ondoho View Post
Code:
which neverwinter-nights
Code:
$ which neverwinter-nights
/usr/local/games/neverwinter-nights
I assume those results give me the path to the object of the launcher.

THANK YOU, ondoho!

Last edited by tnandy; 01-22-2018 at 10:26 PM. Reason: I didn't understand the answer at first.
 
Old 01-22-2018, 10:14 PM   #9
tnandy
Member
 
Registered: Oct 2003
Location: Tennessee
Distribution: Fedora 22, CentOS
Posts: 177

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by DavidMcCann View Post
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
Code:
$ ls /Desktop
didn't work, but then I tried the following and found it.
Code:
$ ls ./Desktop
neverwinter-nights.desktop
$ pluma ./Desktop/neverwinter-nights.desktop
The contents of neverwinter-nights.desktop are:
Code:
#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Type=Application
Name=Neverwinter Nights
Name[fr]=Neverwinter Nights
Icon=neverwinter-nights
Exec=neverwinter-nights
Categories=Game
This is precisely what I was looking for! Now I have to figure out what all that stuff means, but at least I can mark this thread solved.

THANK YOU, DavidMcCann!
 
Old 01-23-2018, 10:25 PM   #10
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 3,994
Blog Entries: 1

Rep: Reputation: 846Reputation: 846Reputation: 846Reputation: 846Reputation: 846Reputation: 846Reputation: 846
$(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.
 
  


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
LXer: How to create multiple profiles for Unity launcher in Ubuntu using launcher-list-indicator LXer Syndicated Linux News 0 08-30-2016 06:30 PM
Long lag between clicking the Application Launcher icon and the launcher appearing in KDE alex14641 Slackware 2 03-28-2016 06:36 PM
[SOLVED] firefox launcher doesn't show icon on panel bar of slackware but launcher still there mshlinux Linux - Newbie 6 04-24-2013 11:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:44 PM.

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