LinuxQuestions.org
Help answer threads with 0 replies.
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-22-2004, 12:27 AM   #1
tuculover
LQ Newbie
 
Registered: Oct 2004
Posts: 7

Rep: Reputation: 0
Execute terminal commands from .desktop files


Hello,

I am trying to place an icon into the Computer folder on the desktop on FC2. The icon would link to my Windows XP/ My Documents folder. I have the partition mounting at startup to /mnt/windowsXP and I have a .desktop file created in /usr/share/applications (I think that puts it on the application launcher, but that's not my problem yet). Here's a copy of my .desktop file:

Code:
[Desktop Entry]
Encoding=UTF-8
Name=Windows XP
Comment=Access Windows Partition/My Documents
TryExec=nautilus
Exec=nautilus /mnt/windowsXP/Documents*/Wes/My*
Icon=gnome-fs-client
Terminal=false
Type=Application
Categories=Application;Core;X-Red-Hat-Base;
X-GNOME-Bugzilla-Bugzilla=GNOME
X-GNOME-Bugzilla-Product=nautilus
X-GNOME-Bugzilla-Component=general
X-Gnome-Bugzilla-OtherBinaries=nautilus-adapter;nautilus-content-loser;nautilus-sidebar-loser;nautilus-text-view;nautilus-throbber;
X-Desktop-File-Install-Version=0.4
OnlyShowIn=GNOME;
When I try to click the icon in the application menu, an error comes up saying that it cannot find /mnt/windowsXP/Documents*/Wes/My*. But if I run the exact same command from a terminal, a nautilus window comes up at the folder. I tried changing Terminal to true, but that didn't do anything.

If anyone has an idea of how to work this, I would appreciate it. Also if one knows where I need to put the file to make it show up in the Computer file and not in the applications menu.

Thanks all!
 
Old 10-22-2004, 07:37 AM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
I would suggest using autocompletion to get the expanded path name to the argument file and cut and paste it into the .desktop file.
 
Old 10-22-2004, 09:06 AM   #3
DertyolBA$HTARD
Member
 
Registered: Sep 2004
Location: USA
Distribution: Slackware 10
Posts: 86

Rep: Reputation: 15
I think jschiwal is right, it sounds like the spaces in the windows file name are throwing things outta whack.
 
Old 10-22-2004, 04:31 PM   #4
tuculover
LQ Newbie
 
Registered: Oct 2004
Posts: 7

Original Poster
Rep: Reputation: 0
I thought that using the wildcard would fix that. I agree that the spaces mess things up. If the wildcard doesn't do it, how do I set it up to auto complete?

Thanks for helping!
 
Old 10-22-2004, 05:25 PM   #5
DertyolBA$HTARD
Member
 
Registered: Sep 2004
Location: USA
Distribution: Slackware 10
Posts: 86

Rep: Reputation: 15
The tab key autocompletes in the bash shell, and I believe in most gui file managers as well.
 
Old 10-22-2004, 06:44 PM   #6
tuculover
LQ Newbie
 
Registered: Oct 2004
Posts: 7

Original Poster
Rep: Reputation: 0
How can I put a tab in a .desktop file? In a terminal I can type
Code:
nautilus /mnt/windowsXP/Documents*/Wes/My*
and I get a nautilus window that pops up at the right spot. So I know that the execute line works in a terminal. But it doesn't work in the .desktop file. That's where I want it to work though.
 
Old 10-22-2004, 06:49 PM   #7
tuculover
LQ Newbie
 
Registered: Oct 2004
Posts: 7

Original Poster
Rep: Reputation: 0
Okay, I just figured it out. Your hints on using auto-complete helped. If you use auto-complete it puts a forward slash in front of the spaces. So the command becomes nautilus /mnt/windowsXP/Documents\ and\ Settings/Wes/My\ Documents/

That works just fine. Now all I need to do is figure out where to put the .desktop file to make the icon disply in the computer folder on my desktop.

Thanks a lot for all the help!
 
  


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
making a script that opens terminal and enter commands into that terminal Cinematography Linux - General 8 12-16-2008 11:34 AM
how can execute some commands when a user logs out rddreamz Programming 2 05-25-2004 04:00 PM
C -how do i execute linux commands? ocularbob Programming 7 02-29-2004 02:51 PM
how to execute commands on login k4zau Linux - Software 3 10-12-2003 02:52 PM
Written commands hard to execute Rutnut Linux - Newbie 6 02-22-2001 01:19 AM


All times are GMT -5. The time now is 04:48 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