LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (http://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   How do you create functional desktop icons in KDE? (http://www.linuxquestions.org/questions/linux-desktop-74/how-do-you-create-functional-desktop-icons-in-kde-663740/)

mxcrowe 08-18-2008 11:12 PM

How do you create functional desktop icons in KDE?
 
I'm trying to create a desktop icon to a simple command. Since I'm having trouble getting the KDE buttons for "suspend to RAM" to work properly, but I can successfully issue the command "s2ram -f" from a terminal window, I thought maybe the easiest thing would be to create a desktop icon that runs a simple file with "sudo s2ram -f" in it. Then I could just click the file on my desktop and have the system go to sleep.
Can anyone walk me through how to do this? I'm assuming this would be a sort of desktop configuration file. (KDE 4.0.4 on SUSE 11.0)
Thanks!
Michael

Jevan 08-19-2008 05:54 AM

I am not sure how to make a launcher in KDE 4 (I still use KDE 3.5). However, you should be able to use the .desktop file below. Copy and paste it into a text editor and save it as as Suspend to RAM.desktop in your Desktop folder.

Code:

[Desktop Entry]
Version=1.0
Encoding=UTF-8
Type=Application
Name=Suspend to RAM
Comment=
Categories=Application;
Exec=sudo s2ram -f
Icon=
Terminal=false
StartupNotify=false


knudfl 08-19-2008 10:38 AM

In Kmenuedit ==> command = 'kmenuedit' you
can make all the entries, you want.

Good Luck !

tredegar 08-19-2008 11:22 AM

Code:

[Desktop Entry]
Version=1.0
Encoding=UTF-8
Type=Application
Name=Suspend to RAM
Comment=
Categories=Application;
Exec=kdesu s2ram -f
Icon=
Terminal=false
StartupNotify=false

For this to work reliably, I think you'll need to use kdesu here.

mxcrowe 08-19-2008 02:12 PM

Thanks for the replies. I tried making such a launcher as suggested, but when I click it, I just get the bouncing icon for about 30 seconds, then nothing. The system does not go into suspend to RAM. It seems to be doing something for a while, but who know what? Am I close, or is this just impossible??

geesh 08-19-2008 03:43 PM

Have you made it executable?

tredegar 08-19-2008 04:01 PM

Quote:

Am I close, or is this just impossible??
With linux, almost anything is possibe ;)

Quote:

Have you made it executable?
He doesn't know how to (but should learn about this)

Meanwhile here are step-by-step instructions for a newbie:

R-click on an empty bit of your desktop.
In the menu that pops up, click on Create New -> then Link to application
Type in Suspend instead of the default blue Link to application. Just type, (blued text is replaced by what you type) or use the backspace / delete keys if you must.
Click on the Application Tab
Description: Enter Suspend
Comment: Enter Suspend
Command: Enter kdesu s2ram -f
Click OK

Click on your new icon (it looks like a blue gear)
It works?
If yes, you can give it a better icon:

R-Click the Suspend icon on your desktop
Click on Properties
Click the blue gear icon in the new "Properties" window that opens.
Decide upon a more suitable icon from those offered.
Click on it.
Click OK
Click OK

You are done.
Sigh.

mxcrowe 08-20-2008 11:29 AM

Quote:

Originally Posted by tredegar (Post 3253026)
He doesn't know how to (but should learn about this)

Actually, he does know how to, but checking or unchecking the "is executable" box makes no difference to the behavior.
Furthermore, there is no "Create new" option on right click of my desktop, which of course I tried long before I posted the question. If it were that easy, I would have done it long ago. My desktop is (KDE 4.0.4 >= 20080505) "release 15.2" - on right click it gives me (run command, add widgets, add panel, configure desktop, etc.). None of these seem to lead to the creation of a desktop config file.
I just created the file from scratch, called it suspend.desktop and check it's properties against existing desktop config files. I subsequently tried every combination of property settings I could think of on the permissions and application tabs. Selecting "run in terminal" seems to pop a window up briefly, but does not put the system into suspend.

tredegar 08-20-2008 11:40 AM

Then I suspect the problem lies with KDE4.0.4

KDE4 is still undergoing heavy development, and many things just "don't work" yet, or are broken.
You could argue that it is "not fit for release", but the developers are following the "Release early, release often" philosophy.

You may have to be patient.

mxcrowe 08-20-2008 01:30 PM

That's quite possible. I was toying with upgrading to 4.1, but wanted to get familiar with the system using as stable a desktop as I could. Maybe I should try Gnome? I still may do the KDE 4.1 upgrade prior to the official release in SUSE 11.1.
Anyway, I continued playing around with things, and it looks like one can create "starter" icons on this desktop by clicking "Add Widgets" and choosing "Generic Icon". However, the properties tab only shows permissions, not application, so I'm not sure how to actually make it do anything.
In the meantime, I have continued experimenting with the suspend to RAM issue using pw-utils and kpowersave, and it looks like I might have it working. That was the main issue, but it would still be nice to know how to easily create runnable icons on the desktop.

tredegar 08-21-2008 04:39 PM

If you want a stable desktop you should stick with KDE 3.5.x for the next six months at least. Creating functional icons on your desktop is easy with KDE 3.5.x (See post #7 above). So, indeed, is just about everything else: It's a highly functional and stable desktop, but it is not going to be developed any further: What you have is it.

As I said, KDE 4.x is still under development: By all means use it, but some things will be broken.

steve02169 04-11-2012 12:30 PM

update and correction
 
I found this thread in google and wanted to update it even though it's old. It is probably not relevant to the original poster (after four years) but others may find this helpful.
Code:

chmod +x nameofscript
would make the script executable.
Since KDE4 by default doesn't have icons on the desktop you need to navigate to the username/home/Desktop folder to follow the instructions with dolphin or konqueror. Right clicking an empty space there will give you the option to
Create New -> Link to Application
You can then follow the advice in the previous post, it worked for my script.


All times are GMT -5. The time now is 03:43 AM.