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
  Search this Thread
Old 02-25-2011, 12:30 AM   #1
psionl0
Member
 
Registered: Jan 2011
Distribution: slackware_64 14.1
Posts: 722
Blog Entries: 2

Rep: Reputation: 124Reputation: 124
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, 12:49 AM   #2
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,467

Rep: Reputation: Disabled
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, 01:18 AM   #3
psionl0
Member
 
Registered: Jan 2011
Distribution: slackware_64 14.1
Posts: 722

Original Poster
Blog Entries: 2

Rep: Reputation: 124Reputation: 124
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, 01:35 AM   #4
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,467

Rep: Reputation: Disabled
Where are you putting those commands?
 
Old 02-25-2011, 02:05 AM   #5
psionl0
Member
 
Registered: Jan 2011
Distribution: slackware_64 14.1
Posts: 722

Original Poster
Blog Entries: 2

Rep: Reputation: 124Reputation: 124
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, 02:34 AM   #6
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,467

Rep: Reputation: Disabled
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, 01:00 AM   #7
psionl0
Member
 
Registered: Jan 2011
Distribution: slackware_64 14.1
Posts: 722

Original Poster
Blog Entries: 2

Rep: Reputation: 124Reputation: 124
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, 01:32 AM   #8
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
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, 02: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: 211

Rep: Reputation: 52
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 02:32 AM.
 
Old 02-27-2011, 03: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: 211

Rep: Reputation: 52
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 03:25 AM.
 
1 members found this post helpful.
Old 02-27-2011, 03: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: 211

Rep: Reputation: 52
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 03:58 AM.
 
Old 02-27-2011, 03: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: 211

Rep: Reputation: 52
screenshots here (scaled down to 400x300 from 1024x768 as upload size <256kB)
Attached Thumbnails
Click image for larger version

Name:	Screenshot-03.png
Views:	214
Size:	156.1 KB
ID:	6262   Click image for larger version

Name:	Screenshot-04.png
Views:	212
Size:	149.6 KB
ID:	6263  
 
Old 02-27-2011, 03: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: 211

Rep: Reputation: 52
close-up
Attached Thumbnails
Click image for larger version

Name:	Screenshot-06.png
Views:	144
Size:	52.3 KB
ID:	6264  
 
Old 02-27-2011, 04: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: 211

Rep: Reputation: 52
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 04:57 AM.
 
3 members found this post helpful.
Old 02-27-2011, 04: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: 211

Rep: Reputation: 52
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 01: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 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

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 02:02 AM.

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
Open Source Consulting | Domain Registration