VectorLinux
December 19, 2014, 06:37:21 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Visit our home page for VL info. To search the old message board go to http://vectorlinux.com/forum1. The first VL forum is temporarily offline until we can find a host for it. Thanks for your patience.
 
Now powered by KnowledgeDex.
   Home   Help Search Login Register  
Please support VectorLinux!
Pages: [1]
  Print  
Author Topic: Need Help adding desktop icon  (Read 1538 times)
Uta
Member
*
Posts: 20


« on: April 04, 2008, 08:26:54 am »

I am trying to add a desktop icon that when clicked will shutdown the laptop.
I am doing this to make it very easy for the person I am giving my laptop to, (elderly, limited mouse skills) to shutdown.
A howto would be great.
I am using 5.9 "LITE" (jwm)
I'd like to use the: /usr/share/icons/menu-Exit.png

Thanks.

Logged
M0E-lnx
Administrator
Vectorian
*****
Posts: 3195



« Reply #1 on: April 04, 2008, 10:43:07 am »

Easy way to do this would be to create a shutdown script
Code:
mcedit ~/.shutdown.sh
[code]
In the file, add these simple lines
[code]
#!/bin/bash
sudo /sbin/shutdown -t3 -h now
exit 0
[code]

If you are running PCMANFM with icons on the desktop here is what you do
open a terminal, cd to the ~/Desktop directory
make a copy of one of the .desktop files in it and name it "shutdown.desktop"
[code]
cp home.desktop shutdown.desktop
[code]
edit the file and change these lines
[code]
mcedit shutdown.desktop
Exec=sh ~/.shutdown.sh # This is the script you created previously
Name=Shutdown
Icon=/usr/share/icons/menu-Exit.png
Leave the rest of the file alone

That should give you your desktop icon...


This could be annoying though... if they mistakenly click the wrong icon, then you'd have them asking you to "fix" it all the time..[/code][/code][/code][/code][/code][/code]
Logged

Uta
Member
*
Posts: 20


« Reply #2 on: April 04, 2008, 02:01:36 pm »

First thank you for responding.
I think something is amiss in my desktop file. I had already deleted my home.desktop so had to work with an opera.desktop to create my shutdown.desktop file. It reads:

[Desktop Entry]
Encoding=UTF-8
Exec=sh ~/.shutdown.sh
Name=Shutdown
GenericName=shutdown
Icon=/usr/share/icons/menu-Exit.png
Terminal=false
Categories=GTK;System;Settings;
Type=Application
NotShowIn=KDE
--------------------------
double clicking does nothing.
--------------------------
my .shutdown.sh file is in my user's directory and reads:

#!/bin/bash
sudo /sbin/shutdown -t3 -h now
exit 0
---------------------------

Is my shutdown.desktop info wrong?
Logged
M0E-lnx
Administrator
Vectorian
*****
Posts: 3195



« Reply #3 on: April 04, 2008, 02:05:28 pm »

seems to be fine... try this in the exec line instead
Code:
Exec=sudo /sbin/shutdown -t3 -h now
[code]
That will bypass the script and see if that works
[/code]
Logged

Uta
Member
*
Posts: 20


« Reply #4 on: April 04, 2008, 02:12:03 pm »

<smiling>
It worked!
Thank you for your knowledge and patience--
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!