Shutting down with keybindings

Forum rules
Before you post please read how to get help

Shutting down with keybindings

Postby henpeckary on Sat Apr 09, 2011 4:44 pm

Hi, I was wondering if anyone could help, I'm trying to shutdown/poweroff with keybindings. I've edited the /etc/sudoers file and put the shortcut in my keys file but all to no avail. What am I doing wrong ? I got the rest of the keys working working no problem. Heres my keys file if anyone finds it useful - the only shortcut that doesn't work is the "halt" one.

OnDesktop Mouse2 :WorkspaceMenu
OnDesktop Mouse3 :RootMenu
KP_Add :NextWorkspace
KP_Subtract :PrevWorkspace

Control m :RootMenu
Alt m :HideMenus

KP_Insert :Maximize
KP_Delete :Minimize
KP_Enter :Fullscreen
Control k :KillWindow
Control c :Close
Control q :Exit
Control z :Exec sudo halt


Control e :ExecCommand eject
Control h :Exec thunar # Ctrl+h will bring up file manager
Control r :ExecCommand rhythmbox # Ctrl+r will bring up music player
Control b :ExecCommand deluge # Ctrl+b will bring up deluge
Control a :ExecCommand abiword # Ctrl+a will bring up abiword
Control f :ExecCommand firefox # Ctrl+f will bring up firefox
Control o :ExecCommand opera # Ctrl+o will bring up opera
Control t :ExecCommand lxterminal # Ctrl+t will bring up an lxterminal
Control l :ExecCommand leafpad # Ctrl+l will bring up leafpad
Control x :ExecCommand xfburn # Ctrl+x will bring up xfburn
Control p :ExecCommand picasa # Ctrl+p will bring up picasa

None Control Right :MoveRight 30
None Control Left :MoveLeft 30
None Control Up :MoveUp 30
None Control Down :MoveDown 30
None Alt Right :ResizeHorizontal 25
None Alt Left :ResizeHorizontal -25
None Alt Up :ResizeVertical -25
None Alt Down :ResizeVertical 25

KP_Prior :MoveTo 0 0 UpperRight -> snap to upper right workspace corner
KP_Home :MoveTo 0 0 UpperLeft -> snap to upper left workspace corner
KP_End :MoveTo 0 0 BottomLeft -> snap to bottom left workspace corner
KP_Next :MoveTo 0 0 BottomRight -> snap to bottom right workspace corner
KP_Begin :MoveTo 0 0 Center -> snap to center of workspace
KP_Right :MoveTo 0 0 RightCenter -> snap to right center of workspace
KP_Left :MoveTo 0 0 LeftCenter -> snap to left center of workspace
KP_8 :MoveTo 0 0 TopCenter -> snap to top center of workspace
KP_Down :MoveTo 0 0 BottomCenter -> snap to bottom center of workspace

#Volume. Will lower or raise volume by 5%. The third key binding will toggle mute.
None XF86AudioRaiseVolume :Exec amixer sset Master,0 5%+
None XF86AudioLowerVolume :Exec amixer sset Master,0 5%-
None XF86AudioMute :Exec amixer sset Master,0 toggle











Thanks
Tony
henpeckary
Level 1
Level 1
 
Posts: 5
Joined: Mon Apr 04, 2011 10:04 am

Linux Mint is funded by ads and donations.
 

Re: Shutting down with keybindings

Postby Alaric on Sat Apr 09, 2011 10:31 pm

I suppose it's because it requires 'sudo'? I tried ciao, instead of halt, and that brought up the shutdown pop-up, which isn't really what you're going for. Heck, I tried a few different things; interesting question and quite an extensive list of keys you've got there. Must be a keyboard warrior in the making. :)
LM 9 Isadora Fluxbox
Registered Linux User #533152
Alaric
Level 1
Level 1
 
Posts: 17
Joined: Sun Jan 02, 2011 5:13 pm
Location: Cleveland Ohio

Re: Shutting down with keybindings

Postby richyrich on Sat Apr 09, 2011 11:32 pm

couple of suggestions . .
Code: Select all
sudo /sbin/halt

Code: Select all
gksudo /sbin/halt
User avatar
richyrich
Level 13
Level 13
 
Posts: 4907
Joined: Mon May 04, 2009 8:31 pm
Location: Pirating somewhere along the North Saskatchewan River, Canada

Re: Shutting down with keybindings

Postby henpeckary on Sun Apr 10, 2011 3:34 pm

Hi, I tried those and still no luck, ah well - I'll keep trying and if i manage it I'll post back with the solution. Thanks anyway for the suggestions, it was worth a shot.

PS. I've noticed that whenever anyone else posts code it's always in that neat little code box. How do you get that ? - so I'm not copying and pasting code into the message area.

Tony.
henpeckary
Level 1
Level 1
 
Posts: 5
Joined: Mon Apr 04, 2011 10:04 am

Re: Shutting down with keybindings

Postby richyrich on Sun Apr 10, 2011 4:57 pm

One other to try :
Code: Select all
gksudo shutdown -P now


When you are in the edit window, they are the small buttons along the top of the text box. Just click quote or code, paste between the two squares [ code ] here [ / code ]

ps: when you changed commands, did you change the command in your visudo too ?
User avatar
richyrich
Level 13
Level 13
 
Posts: 4907
Joined: Mon May 04, 2009 8:31 pm
Location: Pirating somewhere along the North Saskatchewan River, Canada

Re: Shutting down with keybindings

Postby henpeckary on Sun Apr 10, 2011 5:51 pm

No I didn't, I just opened /etc as root and opened the sudoers file in leafpad. Whats visudo ? Sorry if it's a dumb question but I've never come accross it. just tried "visudo leafpad /etc/sudoers" and "visudo /etc/sudoers" and got "usage: visudo [-c] [-q] [-s] [-V] [-f sudoers]".
How do I use it to open the sudoers file ?

Thanks for your patience.
Tony
henpeckary
Level 1
Level 1
 
Posts: 5
Joined: Mon Apr 04, 2011 10:04 am

Re: Shutting down with keybindings

Postby richyrich on Sun Apr 10, 2011 6:00 pm

User avatar
richyrich
Level 13
Level 13
 
Posts: 4907
Joined: Mon May 04, 2009 8:31 pm
Location: Pirating somewhere along the North Saskatchewan River, Canada

Re: Shutting down with keybindings

Postby henpeckary on Sun Apr 10, 2011 6:38 pm

I'm kinda getting there. i've found that if I use ":ExecCommand gksudo poweroff" in my keys file then that works. It requires my password to shutdown but I can live with that for now till I suss it out, it's not perfect but it's still quicker than fiddling about with a track pad.

Tony.
henpeckary
Level 1
Level 1
 
Posts: 5
Joined: Mon Apr 04, 2011 10:04 am

Linux Mint is funded by ads and donations.
 

Return to Others

Who is online

Users browsing this forum: No registered users and 0 guests