LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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
 
Search this Thread
Old 02-25-2011, 01:30 AM   #1
psionl0
Member
 
Registered: Jan 2011
Distribution: slackware_64 14.1
Posts: 634
Blog Entries: 2

Rep: Reputation: 97
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?
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 02-25-2011, 01:49 AM   #2
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,211

Rep: Reputation: 293Reputation: 293Reputation: 293
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
 
Old 02-25-2011, 02:18 AM   #3
psionl0
Member
 
Registered: Jan 2011
Distribution: slackware_64 14.1
Posts: 634
Blog Entries: 2

Original Poster
Rep: Reputation: 97
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.
 
Old 02-25-2011, 02:35 AM   #4
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,211

Rep: Reputation: 293Reputation: 293Reputation: 293
Where are you putting those commands?
 
Old 02-25-2011, 03:05 AM   #5
psionl0
Member
 
Registered: Jan 2011
Distribution: slackware_64 14.1
Posts: 634
Blog Entries: 2

Original Poster
Rep: Reputation: 97
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.
 
Old 02-25-2011, 03:34 AM   #6
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,211

Rep: Reputation: 293Reputation: 293Reputation: 293
Yeah looks that way. I prefer to use keyboard to be honest. I don't pick the mouse up much these days.
 
Old 02-27-2011, 02:00 AM   #7
psionl0
Member
 
Registered: Jan 2011
Distribution: slackware_64 14.1
Posts: 634
Blog Entries: 2

Original Poster
Rep: Reputation: 97
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.
 
Old 02-27-2011, 02:32 AM   #8
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,776

Rep: Reputation: 481Reputation: 481Reputation: 481Reputation: 481Reputation: 481
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.
 
Old 02-27-2011, 03:31 AM   #9
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: 203

Rep: Reputation: 44
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
I believe a system restart is required after sudo changes in my experience - I maybe corrected on this though.

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.

Last edited by dh2k; 02-27-2011 at 03:32 AM.
 
Old 02-27-2011, 04:11 AM   #10
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: 203

Rep: Reputation: 44
To prevent accidental shutdown/restart etc, consider
Code:
if xmessage -center -buttons No:1,Yes:0 "Really shutdown?"; then sudo /sbin/halt; fi
or how my wbar entry looks for this
(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
c: if xmessage -center -buttons No:1,Yes:0 "Really shutdown?"; then sudo /sbin/halt; fi
t: Shutdown
the above xmessage could be replaced with any other dialog prompt to add better aesthetics - but I have kept this example to be compliant with a stock slackware installation.

Last edited by dh2k; 02-27-2011 at 04:25 AM.
 
1 members found this post helpful.
Old 02-27-2011, 04:29 AM   #11
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: 203

Rep: Reputation: 44
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
to prevent accidental logout via gui:
Code:
if xmessage -center -buttons No:1,Yes:0 "Really logout?"; then killall fluxbox; fi
to prevent accidental logout via terminal:
Code:
killall -i fluxbox
my wbar entry looks like this:
Code:
i: /usr/share/pixmaps/lucid/pngs/system-switch-user.png
c: if xmessage center -buttons No:1,Yes:0 "Really logout?"; then killall fluxbox; fi
t: Logout

Last edited by dh2k; 02-27-2011 at 04:58 AM.
 
Old 02-27-2011, 04:50 AM   #12
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: 203

Rep: Reputation: 44
screenshots here (scaled down to 400x300 from 1024x768 as upload size <256kB)
Attached Images
File Type: png Screenshot-03.png (156.1 KB, 32 views)
File Type: png Screenshot-04.png (149.6 KB, 31 views)
 
Old 02-27-2011, 04:54 AM   #13
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: 203

Rep: Reputation: 44
close-up
Attached Images
File Type: png Screenshot-06.png (52.3 KB, 21 views)
 
Old 02-27-2011, 05:53 AM   #14
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: 203

Rep: Reputation: 44
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
and change it to true:
Code:
session.screen0.allowRemoteActions:	true
restart fluxbox.


You may now use the fluxbox-remote command:
Code:
fluxbox-remote "RootMenu"
So, you could use fluxbox-remote "ANY_INTERNAL_FLUXBOX_COMMAND"

Again, here is my wbar entry:
Code:
i: /usr/share/pixmaps/lucid/pngs/system.png
c: fluxbox-remote "RootMenu"
t: Menu

Last edited by dh2k; 02-27-2011 at 05:57 AM.
 
3 members found this post helpful.
Old 02-27-2011, 05:56 AM   #15
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: 203

Rep: Reputation: 44
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 -

Last edited by dh2k; 02-27-2011 at 02:36 PM.
 
1 members found this post helpful.
  


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


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 04:18 PM
Standard commands give "-bash: open: command not found" even in "su -" and "su root" mibo12 Linux - General 4 11-11-2007 11:18 PM
Shell Script: Find "Word" Run "Command" granatica Linux - Software 5 07-25-2007 08:42 AM
KDE "Logout" and "Lock Session" menu restoration powah Linux - Software 3 03-29-2005 09:02 PM
KDE "Lock Session" and "Logout" menu restoration tcma Linux - Software 0 01-29-2005 12:12 PM


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

Main Menu
Advertisement
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