LinuxQuestions.org
Review your favorite Linux distribution.
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 08-06-2019, 08:53 AM   #1
phalange
Member
 
Registered: May 2018
Distribution: Slackware, Nixos, Arch, Centos
Posts: 179

Rep: Reputation: Disabled
Window manager fails to respect system policies


I run spectrwm on a full -Current install, but I like to run XFC4-Power-Manager which is included in the default Slackware install.

Calling
Code:
xfce-power-manager &
from my .xinitrc starts the power-manager, but I still get an error "power manager not authorized" pop-up when the system sleeps. I found a thread elsewhere that suggested calling
Code:
/usr/lib/polkit-1/polkit-agent-helper-1 &
directly from .xinitrc but this doesn't eliminate the error in my case.

Does anyone know what else to load in my xinitrc? When I run xfce4, everything works as expected.

I'm using
Code:
exec ck-launch-session dbus-launch --exit-with-session /usr/bin/spectrwm
.
 
Old 08-06-2019, 09:31 AM   #2
GazL
LQ Guru
 
Registered: May 2008
Posts: 5,116
Blog Entries: 18

Rep: Reputation: 2798Reputation: 2798Reputation: 2798Reputation: 2798Reputation: 2798Reputation: 2798Reputation: 2798Reputation: 2798Reputation: 2798Reputation: 2798Reputation: 2798
I don't like that method of starting window managers, it's caused me issues in the past. This is how I do it.

xsession/xinitrc:
Code:
#!/bin/sh
# xinitrc.fvwm2

userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap

# merge in defaults and keymaps

[ -f "$sysresources" ]   &&   xrdb -merge "$sysresources"
[ -f "$sysmodmap" ]      &&   xmodmap "$sysmodmap"
[ -f "$userresources" ]  &&   xrdb -merge "$userresources"
[ -f "$usermodmap" ]     &&   xmodmap "$usermodmap"

if [ -z "$DESKTOP_SESSION" -a -x /usr/bin/ck-launch-session ]; then
  exec ck-launch-session /usr/bin/startfvwm2
else
  exec /usr/bin/startfvwm2
fi
startfvwm2:
Code:
#!/bin/sh
#  startfvwm2 v1.0

##  Start DBUS session bus                                            ##
if [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then
   eval $(dbus-launch --sh-syntax --exit-with-session)
fi

##  Start Window Manager
exec /usr/bin/fvwm2
Just swap it to run spectrumwm instead of fvwm2 and stick the "xfce-power-manager &" before the exec line. I think your problem is that you're starting power-manager too early (before dbus).
 
Old 08-06-2019, 10:52 AM   #3
average_user
Member
 
Registered: Dec 2010
Location: Warsaw, Poland
Distribution: Slackware
Posts: 411

Rep: Reputation: 161Reputation: 161
There is no need to start polkitd manually, man polkit says
Quote:
Users or administrators should never need to start this daemon as it will be automatically started by dbus-
daemon(1) or systemd(1) whenever an application calls into the service.
What does the following command do:
Code:
dbus-send --system --print-reply     --dest="org.freedesktop.UPower"     /org/freedesktop/UPower     org.freedesktop.UPower.Suspend
What is the value of XDG_SESSION_COOKIE?

Last edited by average_user; 08-06-2019 at 10:54 AM.
 
Old 08-06-2019, 02:14 PM   #4
phalange
Member
 
Registered: May 2018
Distribution: Slackware, Nixos, Arch, Centos
Posts: 179

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by average_user View Post
There is no need to start polkitd manually, man polkit says

What does the following command do:
Code:
dbus-send --system --print-reply     --dest="org.freedesktop.UPower"     /org/freedesktop/UPower     org.freedesktop.UPower.Suspend
What is the value of XDG_SESSION_COOKIE?
The dbus-send command results in complete system lockup. The screen goes black and the keyboard is unresponsive. I invoked the command twice and had to force restart via the power button.
 
Old 08-06-2019, 02:19 PM   #5
average_user
Member
 
Registered: Dec 2010
Location: Warsaw, Poland
Distribution: Slackware
Posts: 411

Rep: Reputation: 161Reputation: 161
Well it works with Asus Z97-A motherboard I have and I thought this is how xfce invokes sleep without root. For example, I use this to hibernate:
Code:
dbus-send --system --print-reply     --dest="org.freedesktop.UPower"     /org/freedesktop/UPower     org.freedesktop.UPower.Hibernate
 
Old 08-06-2019, 08:53 PM   #6
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware-current
Posts: 5,239

Rep: Reputation: 1898Reputation: 1898Reputation: 1898Reputation: 1898Reputation: 1898Reputation: 1898Reputation: 1898Reputation: 1898Reputation: 1898Reputation: 1898Reputation: 1898
Apparently spectrwm supports an autorun file, so I would try starting the power manager from there.
 
Old 08-09-2019, 02:50 PM   #7
phalange
Member
 
Registered: May 2018
Distribution: Slackware, Nixos, Arch, Centos
Posts: 179

Original Poster
Rep: Reputation: Disabled
So to wrap up this thread, I had to abandon running xfce4-power-manager from spectrwm. This was a rabbit hole of useless complexity getting the xdg suite to work, and may not be fully possible in any event from this window manager.

I also experimented with replacing XFWM with spectrwm which works, and which provides the services xfce4 gets (like power manager et al.), but this setup completely mangles XFCE4, and I sometimes run stock XFCE4 so this was off the table.

At last, I simply addressed my power management needs in the acpi_handler.sh script, with help from this post https://www.linuxquestions.org/quest...op-4175586386/.

Everything I need is present in the kernel and acpi thus far. In this scenario the simplest solution was far and away the best.

Thanks to all for your suggestions.
 
  


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
Virt-manager: can't change "System policies" hakan56 Slackware 0 06-19-2010 03:06 PM
system sync command behavior with respect to file deletions. mmccaff1 Linux - Kernel 3 07-07-2009 11:20 AM
Defining Operating System Policies. Lenux78 Linux - Security 2 03-09-2008 04:47 PM
What's the best X-Window System window manager in your opinion? t3gah Linux - Software 9 12-16-2006 10:10 PM
Howto change system password policies (passwd length, complexity) tisource Linux - Security 3 09-06-2005 12:01 AM

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

All times are GMT -5. The time now is 12:56 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration