LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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-07-2006, 11:42 PM   #1
tybaldchina
LQ Newbie
 
Registered: Dec 2002
Posts: 7

Rep: Reputation: 0
configuring desktop icon to run a program with wine


I recently got a program that I sorely missed to run on my now full time linux box using the latest wine update. The only way I can figure to run it is to use command line. Is there a way to configure a desktop icon to run this program using wine?

Now that I've got it to run, I'll be using it alot so an icon would just be a little more convenient.

Even a way to use an alias instead of the long command line negotiation to the directory. I'm still a bit of a noob if you haven't guessed yet.

Jeff
 
Old 01-08-2006, 04:12 PM   #2
GrueMaster
Member
 
Registered: Aug 2005
Location: Oregon
Distribution: Kubuntu.
Posts: 848

Rep: Reputation: 30
The easiest thing to do, is create a shell script to run the program, then call the shell from the icon. Here is an example:

# cat cstrike.sh

#!/bin/sh
#########
#
# Script to launch Half-Life v1.5
#
cd /wine/Sierra/Half-Life
wine --managed --winver win98 --debugmsg -all hl.exe -- hl.exe -console -w 1024 -game $6 +connect $8

Then, adding an icon to the desktop depends on the desktop you are using (KDE, Gnome, Etc). For KDE, right click on the desktop, select Create New->Link to Application. The control box that comes up will have 3 tabs; General, Permissions, and Appication. In the General tab, You can change the name of the icon in the text window, and you can change the icon it'sself by clicking on it (it will look like a gear), and selecting a different icon. Don't worry about the permissions tab. In the Application tab, enter a description and optional comment for the application, and enter the full path and file name of the script created earlier in the command field. You can also specify the starting directory for thie application, but it is not necessary. You can also add mime types so that if you click on a file with the associated extension, it will launch the program. Save when you're done, then click on the icon to launch the program.

Optionally, you could also enter the entire wine commandline into the command field above, but this way you can add to the script if needed, and it won't get lost as easily. I usually put the scripts in the same directory as the wine directory the program is installed in (/home/<user>/.wine/c_drive/Program Files/<Some Program>).

Hope this helps. If you are using a different desktop, let me know.
 
Old 01-16-2006, 01:32 PM   #3
tybaldchina
LQ Newbie
 
Registered: Dec 2002
Posts: 7

Original Poster
Rep: Reputation: 0
thanks Gruemaster

I learned a lot about scripts from your post and then researching it as an option. However, at the bottom of this thread there were some posts that were listed as related. I swear I searched for similar questions before posting this and those ones never showed up. One actually gave me an answer that works very well. Just putting quotes around the route to the executable worked...

instead of

wine /home/jeff/.wine/drive_c/Program Files/Wenlin3/WENLIN.EXE

use this

wine "/home/jeff/.wine/drive_c/Program Files/Wenlin3/WENLIN.EXE"

in the launcher line of the icon properties.

I don't know why the quotes make it work but I'll take it.
I'll use my newfound scripts knowledge for something else.

Jeff

p.s. I'm using gnome but I espect this would work for any launcher.
 
Old 01-17-2006, 12:18 AM   #4
GrueMaster
Member
 
Registered: Aug 2005
Location: Oregon
Distribution: Kubuntu.
Posts: 848

Rep: Reputation: 30
The quotes allow spaces to be in the commandline. Otherwise a space would have to have a backslash in front of it like so:

wine /home/jeff/.wine/drive_c/Program\ Files/Wenlin3/WENLIN.EXE

Basically, use quotes to keep a parameter intact that would otherwise be interpreted by the shell (like ? or *).

My script is really only usefull if you need to pass parameters to both wine and your program, and if wine has a hard time dying (the script can kill wineserver on exiting if needed). It's also usefull for some games that use a preloaded app like PunkBuster (anticheating software) to be loaded first.
 
  


Reply



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
Ho do I install desktop icon for installed program? dbet Linux - Newbie 5 12-13-2003 11:58 PM
How to add desktop icon that launches program? registering Linux - Software 3 10-23-2003 04:48 PM
a desktop icon for wine Tomasfuego Linux - Software 2 07-16-2003 03:28 PM
Running wine from desktop icon Roy-Svork Linux - Software 5 06-22-2003 05:37 PM
Creating Desktop Program Icon ss109 Linux - General 4 03-15-2002 11:26 AM

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

All times are GMT -5. The time now is 12:12 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
Open Source Consulting | Domain Registration