Click to See Complete Forum and Search --> : creating desktop icons to run shell commands


kooda
12-08-2003, 05:12 PM
There are few things that I regularly do in the shell that I would like to create a single click solution on my desktop to do. They are typically starting an app (xine or opera) or mounting my ipod.

Basically I want it to : open Konsole, run the text i usually punch in, then close the console.
I have had a look at a couple of the Icons there & cant seem to make much sence of them. :confused:

I'm running Suse 8.2 with KDE 3.1

Thanks in advance.

:)

ciphrix
12-08-2003, 05:18 PM
Just create a new shortcut and in the properties where it says "Command" or something to that effect, type in what you would normally type in the console.

bosox79
12-08-2003, 05:31 PM
Originally posted by ciphrix
Just create a new shortcut and in the properties where it says "Command" or something to that effect, type in what you would normally type in the console.

I think a better option might be to create a link to an application;) or you can create the link by dragging the icon to the desktop if the application is already in one of your kde menus:D

ciphrix
12-08-2003, 05:50 PM
Well, yeah... but I thought if I said "create a new link to the application" it might be confusing since technically what he's trying to do IS create a link to the application.

As far as dragging and dropping the app from the menu, that will also work assuming it's in your menu. Since he is running the commands from a console I was under the assumption there is no menu link.

bosox79
12-08-2003, 06:45 PM
Originally posted by ciphrix
Well, yeah... but I thought if I said "create a new link to the application" it might be confusing since technically what he's trying to do IS create a link to the application.

As far as dragging and dropping the app from the menu, that will also work assuming it's in your menu. Since he is running the commands from a console I was under the assumption there is no menu link.

if these are apps like xine or opera depending on the distro these may have menu items already. I don't know for sure because I have never run SUSE and as far as shortcut vs link I just thought it would be less confusing to use the exact menu names:D you are correct though about the processes

kooda
12-09-2003, 10:15 AM
They didnt create menu entries when I installed them. For Opera & Xine I searched in Konquorer & found the executible (or rather what Konquorer told was the executable) & CTRL+SHIFT dragged it to the desktop & them edited the icon etc. Much like I would have done in windoze.
The mount ipod 1 is going to be a little more entertaining though.
Thanks for your help, I'll tell you how I get on.

mrBen
12-09-2003, 10:20 AM
IIRC if you right-click the desktop in KDE 3.1, you get a host of options; one of those should be to create a shortcut to a device (like an iPod) - you'll probably have to enter the mount point and maybe the device file, but it should do it all for you.......

snuck
12-09-2003, 10:34 AM
gtkpod will autmatically mount your ipod, though you do have to enable in the preferances. Check it out here (http://gtkpod.sourceforge.net/).

snuck

kooda
12-09-2003, 12:10 PM
COOL!

Had a bit of hunt around & found a download for most distros here:

http://rpm.pbone.net/index.php3/stat/4/idpl/548160/com/gtkpod-0.51-1.i586.rpm.html

Thanks.

hlrguy
12-09-2003, 12:33 PM
What I usually do is simply create a script that I then call with the icon. The command line entry in icon is not true bash, and things like &, ';' don't work. Here is an example of a script that I use to start xmms as root with the nighest priority. I created a desktop icon that executes

su - root -c xmmshigh
with the EXECUTE in Shell set to true

In /usr/bin, xmmshigh contains

more highxmms
#!/usr/bin/expect

spawn nohup nice --20 xmms %F &

expect {
-re "root]# " { send "sleep 5\r"}
}

expect {
"nohup: appending output to " { send "sleep 5\r"}
}

What this does, opens a console, prompts me for root's password, executes the script, xmms comes up, the console disappears. NOTE: The sleep 5 is usually required because the app must be fully running BEFORE the console closes. So, a simple script to execute some functions would be

cd /wherever
kscd -p &
openoffice &
sleep 5
exit

Then you can simply link to the app which is the script.

I have many. Even automated a multiwindow VNC connect over SSH into the server at work. I click an icon, two xterms pop up, set things up, VNC connects, both the xterms disappear.

hlrguy