LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices

Reply
 
Search this Thread
Old 08-18-2008, 11:12 PM   #1
mxcrowe
LQ Newbie
 
Registered: Aug 2008
Posts: 4

Rep: Reputation: 0
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
 
Old 08-19-2008, 05:54 AM   #2
Jevan
Member
 
Registered: May 2007
Location: Southeastern United States
Distribution: Crunchbang, Windows 8.1, Android 3/4
Posts: 34

Rep: Reputation: 16
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
 
Old 08-19-2008, 10:38 AM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,522

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

Good Luck !
 
Old 08-19-2008, 11:22 AM   #4
tredegar
Guru
 
Registered: May 2003
Location: London, UK
Distribution: Ubuntu 10.04, mostly
Posts: 6,007

Rep: Reputation: 366Reputation: 366Reputation: 366Reputation: 366
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.
 
Old 08-19-2008, 02:12 PM   #5
mxcrowe
LQ Newbie
 
Registered: Aug 2008
Posts: 4

Original Poster
Rep: Reputation: 0
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??
 
Old 08-19-2008, 03:43 PM   #6
geesh
Member
 
Registered: Feb 2004
Posts: 47

Rep: Reputation: 15
Have you made it executable?
 
Old 08-19-2008, 04:01 PM   #7
tredegar
Guru
 
Registered: May 2003
Location: London, UK
Distribution: Ubuntu 10.04, mostly
Posts: 6,007

Rep: Reputation: 366Reputation: 366Reputation: 366Reputation: 366
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.

Last edited by tredegar; 08-19-2008 at 04:02 PM.
 
Old 08-20-2008, 11:29 AM   #8
mxcrowe
LQ Newbie
 
Registered: Aug 2008
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by tredegar View Post
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.
 
Old 08-20-2008, 11:40 AM   #9
tredegar
Guru
 
Registered: May 2003
Location: London, UK
Distribution: Ubuntu 10.04, mostly
Posts: 6,007

Rep: Reputation: 366Reputation: 366Reputation: 366Reputation: 366
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.
 
Old 08-20-2008, 01:30 PM   #10
mxcrowe
LQ Newbie
 
Registered: Aug 2008
Posts: 4

Original Poster
Rep: Reputation: 0
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.
 
Old 08-21-2008, 04:39 PM   #11
tredegar
Guru
 
Registered: May 2003
Location: London, UK
Distribution: Ubuntu 10.04, mostly
Posts: 6,007

Rep: Reputation: 366Reputation: 366Reputation: 366Reputation: 366
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.
 
Old 04-11-2012, 12:30 PM   #12
steve02169
Member
 
Registered: Feb 2007
Location: Quincy, MA USA
Distribution: Fedora Core 6
Posts: 96

Rep: Reputation: 15
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.
 
  


Reply

Tags
kde, s2ram, suspend


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 desktop icons in KDE4 LXer Syndicated Linux News 0 06-17-2008 12:11 AM
GNOME doesn't create desktop icons for USB drives drigz Linux - Software 2 04-24-2006 11:41 AM
KDE desktop icons domecq Fedora 2 07-31-2004 08:04 PM
Mandrake KDE desktop icons non-functional Leeb Linux - Newbie 2 11-26-2003 07:32 AM
Kde and icons on desktop js72 Linux - Software 1 02-22-2003 02:10 AM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration