LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
LinkBack Search this Thread
Old 02-27-2011, 09:48 AM   #16
ewsmith
Member
 
Registered: Oct 2010
Location: Weesatche, Texas
Distribution: Slackware
Posts: 72

Rep: Reputation: 7

Quote:
Originally Posted by dh2k View Post
EDIT:
Thinking about this I would probably recommend just invoking the (fluxbox-remote "FLUXBOX_INTERNAL_COMMAND") command;

then it is upto you to consider the system shutdown which would require updating the sudoers file (visudo as root).


So to summarise:
Code:
i: /usr/share/pixmaps/lucid/pngs/system.png
c: fluxbox-remote "RootMenu"
t: Menu


i: /usr/share/pixmaps/lucid/pngs/system-switch-user.png
c: if xmessage center -buttons No:1,Yes:0 "Really logout?"; then fluxbox-remote "Exit"; fi
t: Logout


i: /usr/share/pixmaps/lucid/pngs/system-shutdown.png
c: if xmessage -center -buttons No:1,Yes:0 "Really shutdown?"; then sudo /sbin/halt; fi
t: Shutdown
So, be sure to change/personalise the icon paths and this will work -
or you could have the button execute a bash script that creates a dialog and askes you.
on my openbox i use this:
Code:
#!/bin/bash

gxmessage "Are you sure you want to shut down your computer?" -center -title "Take action" -font "Sans bold 10" -default "Cancel" -buttons "_Cancel":1,"_Log out":2,"_Reboot":3,"_Shut down":4 >/dev/null 

case $? in
        1)
                echo "Exit";;
        2)
                openbox --exit;;
        3)
                sudo /sbin/shutdown -r now;;
        4)
                sudo /sbin/shutdown -hP now;;
esac
just replace the commands to match your system.
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 02-27-2011, 12:54 PM   #17
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,725

Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
So, fluxbox does have a 'remote' feature -great to hear it. Using that would be the method to most closely match what the OP asked for.
 
Old 02-27-2011, 01:09 PM   #18
dh2k
Member
 
Registered: Jan 2006
Distribution: Slackware 13.0 (KDE 3.5.10 from 12.2; Xfce 4.6; Fluxbox); Slackware 13.1 (KDE 4.5)
Posts: 201

Rep: Reputation: 42
yeah, that seems so - however the dev's at fluxbox roll it out disabled by default - I would like to look into why this is so. I guess some slim to none security issue (like a hacker script to invoke the command and the user logout/Exit) maybe - maybe not?


Should really email this upstream as it is a really good feature of fluxbox - only for it to be disabled by default - will update.

Last edited by dh2k; 02-27-2011 at 01:35 PM.
 
Old 02-27-2011, 02:01 PM   #19
dh2k
Member
 
Registered: Jan 2006
Distribution: Slackware 13.0 (KDE 3.5.10 from 12.2; Xfce 4.6; Fluxbox); Slackware 13.1 (KDE 4.5)
Posts: 201

Rep: Reputation: 42
I asked at #fluxbox on freenode.org and they pointed out it is mentioned in manual pages "man fluxbox-remote"
Quote:
fluxbox-remote(1) uses the X11 protocol to communicate with fluxbox(1). Therefore, it is possible for any user with access to the X(7) server to use fluxbox-remote(1). For this reason, several key commands have been disabled. Users should be aware of the security implications when enabling fluxbox-remote(1), especially when using a forwarded X(7) connection.
Can any mod' or slack-guru put this into laymans? e.g. what type of user could get access to my X session?
 
Old 03-02-2011, 12:46 AM   #20
psionl0
Member
 
Registered: Jan 2011
Distribution: slackware_64 14.0
Posts: 505
Blog Entries: 2

Original Poster
Rep: Reputation: 67
This is just what I was looking for dh2k. I have decided to leave the shutdown commands for the menu only and only use the buttons for logging out. It works great now.

Thanks for your assistance.

Last edited by psionl0; 03-02-2011 at 12:49 AM.
 
  


Reply


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I disable "shutdown" and "restart" options in KDE logout screen for all users? maxgsp Linux - Distributions 1 12-12-2008 03:18 PM
Standard commands give "-bash: open: command not found" even in "su -" and "su root" mibo12 Linux - General 4 11-11-2007 10:18 PM
Shell Script: Find "Word" Run "Command" granatica Linux - Software 5 07-25-2007 07:42 AM
KDE "Logout" and "Lock Session" menu restoration powah Linux - Software 3 03-29-2005 08:02 PM
KDE "Lock Session" and "Logout" menu restoration tcma Linux - Software 0 01-29-2005 11:12 AM


All times are GMT -5. The time now is 01:25 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