How do I run "menu" and "logout" from the command line in fluxbox?
Wbar is mostly just a piece of eye-candy. Nevertheless, I have included a "start" (slackware logo) button and an exit button.
The problem is, neither of these buttons work. The start button should bring up the fluxbox menu but so far the only way I have found to bring up this menu is by right-clicking on the screen. Similarly, the only way to logout and go back to the login screen seems to be via the fluxbox menu. Running "exit" from the command line only exits the terminal of course. I can't find any information on this by googling. Has anybody researched this and found any answers? |
I use keyboard shortcuts for the menu:
Mod1 space :rootMenu in ~/.fluxbox/keys I think the command to exit is Exit but I haven't used that one |
neither :rootMenu, rootMenu or Exit do anything ("command not found").
I need to be able to invoke programs that will run the root menu or bring the system back into the login screen as required. |
Where are you putting those commands?
|
Ultimately, these commands will be run by clicking on the appropriate button in Wbar. Programs invoked by Wbar can also be invoked from the command line within a terminal screen.
This is the method that you would use to set background in fluxbox ("fbsetbg"). Unfortunately, the makers of fluxbox seem to have made menu and logout internal commands instead. |
Yeah looks that way. I prefer to use keyboard to be honest. I don't pick the mouse up much these days.
|
Hmmmm, it appears that nobody has an answer to this. It's not a biggie - just a minor disappointment. I seldom use the buttons anyway since most of the time the screen is covered by an app. 99% of the time I use the right click to run the menu and for the most part, fluxbox rocks.
Sooner or later though, I will have to learn how to set up fvwm2 - unless something like openbox is a little more flexible. |
Those commands are inetrnal to fluxbox, so they are not available to external programs like the terminal or wbar. fluxbox would need something like rpc or soap method support for that.
|
the shutdown / restart can easily be done with enabling appropriate sudo for users
add (or uncomment if already there) as root at terminal "visudo", Code:
%users ALL = NOPASSWD: /sbin/halt, /sbin/reboot, /sbin/shutdown -h now Halt/shutdown system: then point your wbar button to "sudo /sbin/halt" Reboot/Restart: then point your wbar button to "sudo /sbin/reboot" Hmm. I have never used a logout from fluxbox usinga button method - will update if I can get that working. |
To prevent accidental shutdown/restart etc, consider
Code:
if xmessage -center -buttons No:1,Yes:0 "Really shutdown?"; then sudo /sbin/halt; fi (newbies, see the command line starting "c: " ) (newbies, don't copy the icon path - that is personalised for my system "i: " ) Code:
i: /usr/share/pixmaps/lucid/pngs/system-shutdown.png |
To logout via a button:
Easiest, cheapest (scruffiest) way I can think of from top of head would be to kill the instance "fluxbox" process. Code:
killall fluxbox Code:
if xmessage -center -buttons No:1,Yes:0 "Really logout?"; then killall fluxbox; fi Code:
killall -i fluxbox Code:
i: /usr/share/pixmaps/lucid/pngs/system-switch-user.png |
2 Attachment(s)
screenshots here (scaled down to 400x300 from 1024x768 as upload size <256kB)
|
1 Attachment(s)
close-up
|
Fluxbox menu can be called from command line/wbar button/run dialog:
First, one must enable fluxbox remote commands; in your fluxbox init file, ~/.fluxbox/init (by default) find the line: Code:
session.screen0.allowRemoteActions: false Code:
session.screen0.allowRemoteActions: true You may now use the fluxbox-remote command: Code:
fluxbox-remote "RootMenu" Again, here is my wbar entry: Code:
i: /usr/share/pixmaps/lucid/pngs/system.png |
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 |
All times are GMT -5. The time now is 06:27 PM. |