LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 09-03-2022, 05:09 AM   #1
_peter
Member
 
Registered: Sep 2014
Location: paris
Distribution: slackware
Posts: 314

Rep: Reputation: Disabled
How to suspend or hibernate in fluxbox ?


Hello,
what are the ways to suspend my laptop when running X11 with fluxbox on slackware64-15.0 ?
i don't want to use sudo or install third-party stuff.
currently moving from non-root user desktop to tty3/root, then
Code:
loginctl suspend
kde5 w/ plasma does that nicely because it's a full desktop manager i guess.
 
Old 09-03-2022, 05:22 AM   #2
LuckyCyborg
Senior Member
 
Registered: Mar 2010
Posts: 3,559

Rep: Reputation: 3426Reputation: 3426Reputation: 3426Reputation: 3426Reputation: 3426Reputation: 3426Reputation: 3426Reputation: 3426Reputation: 3426Reputation: 3426Reputation: 3426
Quote:
Originally Posted by _peter View Post
Hello,
what are the ways to suspend my laptop when running X11 with fluxbox on slackware64-15.0 ?
i don't want to use sudo or install third-party stuff.
currently moving from non-root user desktop to tty3/root, then
Code:
loginctl suspend
kde5 w/ plasma does that nicely because it's a full desktop manager i guess.
That Fluxbox is so old that when it was invented, that there was no suspend yet.

It's like living in a cottage in the middle of forest, and wondering why you do not have hot water.

Yes, certainly living rustically has it's down sides. It's not like living in New York. So, no hot water for you!
 
Old 09-03-2022, 05:59 AM   #3
_peter
Member
 
Registered: Sep 2014
Location: paris
Distribution: slackware
Posts: 314

Original Poster
Rep: Reputation: Disabled
ok, fluxbox wasn't build with suspend in mind you say, noted.
fluxbox stability has a lot of value and it's only 22 years old.
Code:
XF86LaunchA :Exec loginctl suspend                                                                                                         < -- not working
XF86PowerOff :Exec dbus-send --system --print-reply --dest="org.freedesktop.UPower" /org/freedesktop/UPower org.freedesktop.UPower.Suspend < -- dead after elogind was adopted ?
what i fail to understand is the implication of the elogind into things like suspend in fluxbox : no more suspend for non-root user ?


: )
Quote:
Originally Posted by LuckyCyborg View Post
Yes, certainly living rustically has it's down sides.
strongly disagree, living rustically, within one's means, is way better that the the tyranny of modernity (collapsing before our eyes)
admitting i smiled at your reply given the rigid top-down idea of frugality in this country.
 
Old 09-03-2022, 06:18 AM   #4
Tonus
Senior Member
 
Registered: Jan 2007
Location: Paris, France
Distribution: Slackware-15.0
Posts: 1,407
Blog Entries: 3

Rep: Reputation: 514Reputation: 514Reputation: 514Reputation: 514Reputation: 514Reputation: 514
Isn't loginctl a user thing as well ?
Is your user a member of the default groups ?

For what it worths, config files are under /etc with defaults commented out. If needed I'll look in my machine this evening to see how my user script handles this in my i3wm setup.
 
1 members found this post helpful.
Old 09-03-2022, 06:22 AM   #5
marav
LQ Sage
 
Registered: Sep 2018
Location: Gironde
Distribution: Slackware
Posts: 5,421

Rep: Reputation: 4160Reputation: 4160Reputation: 4160Reputation: 4160Reputation: 4160Reputation: 4160Reputation: 4160Reputation: 4160Reputation: 4160Reputation: 4160Reputation: 4160
Salut _peter


Quote:
Originally Posted by _peter View Post
ok, fluxbox wasn't build with suspend in mind you say, noted.
fluxbox stability has a lot of value and it's only 22 years old.
Code:
XF86LaunchA :Exec loginctl suspend                                                                                                         < -- not working
XF86PowerOff :Exec dbus-send --system --print-reply --dest="org.freedesktop.UPower" /org/freedesktop/UPower org.freedesktop.UPower.Suspend < -- dead after elogind was adopted ?
Right
IIRC these features were part of pm-utils, which was removed when elogind was introduced

But, loginctl suspend should work as long as your user is in the "power" group

Last edited by marav; 09-03-2022 at 06:27 AM.
 
1 members found this post helpful.
Old 09-03-2022, 06:28 AM   #6
_peter
Member
 
Registered: Sep 2014
Location: paris
Distribution: slackware
Posts: 314

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Tonus View Post
Isn't loginctl a user thing as well ?
Is your user a member of the default groups ?
indeed, user can run "loginctl suspend" but it does nothing ? i looked that way some months ago but couldn't suspend as a non-root user.
here are the groups guys.
Code:
users lp wheel floppy audio video cdrom plugdev power netdev scanner
merci

Last edited by _peter; 09-03-2022 at 06:29 AM. Reason: month(s)
 
Old 09-03-2022, 06:40 AM   #7
gauchao
Member
 
Registered: Dec 2009
Location: Veneto
Distribution: Slackware64
Posts: 366

Rep: Reputation: 143Reputation: 143
Fluxbox user here - I don't hibernate or suspend my machines, but you might take a look here to create a submenu without su: [post #24]

Otherwise, you can do it manually from a terminal:

Fluxbox is rock solid and easy to handle. I have been using it at home and at work since 2007 and it has never failed. Adjust it to your needs.
 
Old 09-03-2022, 06:50 AM   #8
_peter
Member
 
Registered: Sep 2014
Location: paris
Distribution: slackware
Posts: 314

Original Poster
Rep: Reputation: Disabled
thanks gauchao, the dbus-send way cannot be used anymore.
Quote:
dbus-send --system --print-reply --dest="org.freedesktop.UPower" /org/freedesktop/UPower org.freedesktop.UPower.Suspend
will re-read this thread where "loginctl" seems to work for users logged in plasma.
https://www.linuxquestions.org/quest...er-4175696586/
 
Old 09-03-2022, 10:53 AM   #9
giomat
Member
 
Registered: Jul 2017
Posts: 339

Rep: Reputation: 239Reputation: 239Reputation: 239
Quote:
Originally Posted by _peter View Post
thanks gauchao, the dbus-send way cannot be used anymore.


will re-read this thread where "loginctl" seems to work for users logged in plasma.
https://www.linuxquestions.org/quest...er-4175696586/
This happens because the xinitrc.kde file that launches plasma uses dbus-launch to start the session, thus setting all the required dbus variables, while the xinitrc.fluxbox file only checks for the old consolekit2 (ck). You could try modifying the xinitrc.fluxbox file putting something like
Code:
dbus-launch --sh-syntax --exit-with-session /usr/bin/startfluxbox
I had to do this with i3 once and it worked fine.
 
Old 09-03-2022, 01:13 PM   #10
keithpeter
Member
 
Registered: Nov 2015
Location: 52:30N 1:55W
Distribution: Slackware 15.0, OpenBSD 7.4
Posts: 310

Rep: Reputation: Disabled
I have Slackware 15.0 32bit full install less xfce4 and kde on a core duo Thinkpad X60. I've set inittab 4 so boots into the xde login. The last stanza of the .xsession file written by xwmconfig when I chose fluxbox is like this...

Code:
# Start the window manager:
if [ -z "$DESKTOP_SESSION" -a -x /usr/bin/ck-launch-session ]; then
  exec ck-launch-session /usr/bin/startfluxbox
else
  exec /usr/bin/startfluxbox
fi
The /usr/bin/ck-launch-session file does not exist on Slackware 15.0. but /usr/bin/dbus-run-session does exist. The startfluxbox script itself includes

Code:
# Start DBUS session bus:
if [ -z "\$DBUS_SESSION_BUS_ADDRESS" ]; then
   eval \$(dbus-launch --sh-syntax --exit-with-session)
fi
My user belongs to the following groups (default set from adduser I think, not sure). As you can see my user is in the power group.

Code:
bash-5.1$ groups
users lp floppy audio video cdrom input plugdev power netdev scanner
And the loginctl suspend command just works when issued as user, as does the loginctl shutdown. I don't use hibernate to disk as I have a smallish SSD in this machine.

The dbus stuff seems to be starting itself

Code:
bash-5.1$ pstree | grep dbus
     |-at-spi-bus-laun-+-dbus-daemon
     |-2*[dbus-daemon]
     |-dbus-launch
And setting the inittab default run level to 3 and rebooting, logging in and then using startx makes no difference. loginctl suspend still works.

Last edited by keithpeter; 09-03-2022 at 01:20 PM. Reason: Trying inittab 3
 
2 members found this post helpful.
Old 09-03-2022, 01:44 PM   #11
_peter
Member
 
Registered: Sep 2014
Location: paris
Distribution: slackware
Posts: 314

Original Poster
Rep: Reputation: Disabled
thanks,

files&settings are as you described at my end keithpeter.
what do you mean by xde login ?
here it's init 4 with sddm then from the login window:
- X11 for fluxbox
- Plasma for kde.

how many lines in your /usr/bin/startfluxbox 69 ? with #!/bin/sh in line 1 and 36 ?

can't get loginctl suspend top work under Plasma with a non-root user belonging to the power group.
 
Old 09-03-2022, 02:42 PM   #12
keithpeter
Member
 
Registered: Nov 2015
Location: 52:30N 1:55W
Distribution: Slackware 15.0, OpenBSD 7.4
Posts: 310

Rep: Reputation: Disabled
Quote:
Originally Posted by _peter View Post
thanks,

files&settings are as you described at my end keithpeter.
what do you mean by xde login ?
Er - I meant xdm, the graphical login program, apologies for typo.

As the Thinkpad X60 does not have kde/plasma or xfce4 on it, when you set the option to run level 4 in /etc/inittab, you get the very plain xdm graphical login.

Quote:
Originally Posted by _peter View Post
here it's init 4 with sddm then from the login window:
- X11 for fluxbox
- Plasma for kde.
On my X220 Thinkpad, I have a full install of 15.0 64 bit. I can suspend using loginctl suspend from a konsole window within the KDE/plasma session. I don't have an entry for fluxbox in the graphical login screen that comes with kde - I take it that is sddm.

Then I ran xwmconfig within konsole and set the window manager to fluxbox, then logged out and selected 'xsession default' from the list of options. I got fluxbox, and I could suspend using loginctl suspend from an xterm window.

Finally, I exited from fluxbox, and set the session back to plasma X11 without changing xwmconfig. And I got kde/plasma and loginctl suspend still works.

Quote:
Originally Posted by _peter View Post
how many lines in your /usr/bin/startfluxbox 69 ? with #!/bin/sh in line 1 and 36 ?
Yes, on both machines here 69 lines total, first line is #!/bin/sh and line 36 is also #!/bin/sh.

Quote:
Originally Posted by _peter View Post
can't get loginctl suspend top work under Plasma with a non-root user belonging to the power group.
Works here on both a full slackware64 15.0 install with KDE and on the Slackware 32 bit with fluxbox only, no plasma or xfce.

Both these old laptops have intel integrated graphics and suspend on lid close 'just works' on both. The X220 is booting in legacy bios (the X60 only has a bios of course). On both machines the kernel suspend variables show this...

Code:
bash-5.1$ cat /sys/power/state
freeze mem disk
bash-5.1$ cat /sys/power/mem_sleep
s2idle [deep]
Not sure where to go from here but my X220 has a complete fresh 15.0 install that was updated today if anyone can think of any other possible differences to explore. I'll look in tomorrow UK am.
 
1 members found this post helpful.
Old 09-03-2022, 03:14 PM   #13
_peter
Member
 
Registered: Sep 2014
Location: paris
Distribution: slackware
Posts: 314

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by keithpeter View Post
Then I ran xwmconfig within konsole and set the window manager to fluxbox, then logged out and selected 'xsession default' from the list of options.
Finally, I exited from fluxbox, and set the session back to plasma X11 without changing xwmconfig.
yes and yes for the for step by step.

Code:
$cat /sys//power/state 
freeze mem disk
$cat /sys//power/mem_sleep 
s2idle [deep]
at this stage it's my setup that is suspicious as it works elsewhere with native kde/plasma and xsession default. will try to re-install Slackware on another drive.

Code:
$ps -ef | grep dbu
message+  1065     1  0 11:10 ?        00:00:01 /usr/bin/dbus-daemon --system
e      11487  9836  0 22:08 pts/3    00:00:00 grep dbu
sddm   17337     1  0 13:53 ?        00:00:00 dbus-launch --autolaunch f5d6b96c37feb3dbf0c9d88c61fe9571 --binary-syntax --close-stderr
sddm   17338     1  0 13:53 ?        00:00:00 /usr/bin/dbus-daemon --syslog-only --fork --print-pid 5 --print-address 7 --session
root   17379  1189  0 13:54 ?        00:00:00 /usr/libexec/sddm-helper --socket /tmp/sddm-auth9fcf7be7-dcb8-4eaf-9af1-634ffcde6966 --id 5 --start dbus-run-session /usr/bin/startplasma-x11 --user e
e      17390 17379  0 13:54 ?        00:00:00 dbus-run-session /usr/bin/startplasma-x11
e      17403 17390  0 13:54 ?        00:00:02 dbus-daemon --nofork --print-address 4 --session
e      17528     1  0 13:54 ?        00:00:00 /usr/bin/gmenudbusmenuprox
 
Old 09-03-2022, 08:59 PM   #14
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,372
Blog Entries: 28

Rep: Reputation: 6162Reputation: 6162Reputation: 6162Reputation: 6162Reputation: 6162Reputation: 6162Reputation: 6162Reputation: 6162Reputation: 6162Reputation: 6162Reputation: 6162
Fluxbox's age is irrelevant, but Fluxbox's flexibility is very relevant.

You can try finding the correct command line command for suspend and add it to the Fluxbox menu. I did it once a long time ago. I think it's pm-suspend. Like I said, it's been a while and I can't remember whether I needed something like gksu to make it work.

With SystemD, I believe that the command is systemctl suspend.

Alternatively, you can simply issue the command from the console.

Last edited by frankbell; 09-03-2022 at 09:01 PM. Reason: Correct a boo-boo
 
3 members found this post helpful.
Old 09-03-2022, 10:51 PM   #15
enorbet
Senior Member
 
Registered: Jun 2003
Location: Virginia
Distribution: Slackware = Main OpSys
Posts: 4,808

Rep: Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446
Why not just drop to runlevel 3?
 
1 members found this post helpful.
  


Reply



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
To hibernate or not to hibernate? Lysander666 Slackware 23 06-09-2020 06:49 AM
Hibernate one distro, de-hibernate another Ulysses_ Linux - Software 8 12-28-2010 09:34 AM
13.1 Beta1 :: KDE SC 4.4.3 :: pm-hibernate works, KDE hibernate just locks the screen zordrak Slackware 7 05-12-2010 03:55 AM
cli hibernate works but gnome panel hibernate fails BCarey Linux - Desktop 1 06-08-2007 10:21 AM
Fluxbox error /usr/share/fluxbox/nls/en_GB/fluxbox.cat humbletech99 Debian 2 12-29-2005 10:16 AM

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

All times are GMT -5. The time now is 08:38 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
Open Source Consulting | Domain Registration