You are not logged in.

#1 2011-06-14 03:57:48

awayand
Member
Registered: 2009-09-25
Posts: 398

[SOLVED] consolekit with dwm

Hello there,
I am trying to use xfce4-power-manager with dwm but I am failing to make it work properly as it needs policykit. Can someone help me figure out what to put in my .xinitrc so that when I auto-start xfce4-power-manager it is blessed with the necessary elevated rights to hibernate my laptop?

I have used awesome WM before with the ck-launch-session directive and then put my xfce4-power-manager into rc.lua to make it work, but it seems that dwm doesn't have an "autostart" mechanism (fortunately), so I have to go the "clean, efficient" way.

Anyone care to help enlighten me without telling me to rtfm? I have been on the wiki countless times including gentoo's wiki which is not too shabby, either, and even freedesktop's documentation. Looks like I am the only retarded one that still doesn't get how dbus works on an 80/20 basis. /endrant

Last edited by awayand (2011-06-15 04:19:44)

Offline

#2 2011-06-14 04:01:05

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,789

Re: [SOLVED] consolekit with dwm

Here is mine:

ewaller@odin:~ 1003 %cat .xinitrc

DEFAULT_SESSION=openbox
xset b off
setxkbmap -option ctrl:nocaps

case $WM in
kde)
    ck-launch-session dbus-launch startkde
    ;;
xfce4)
    ~/bin/xfce4&
    ck-launch-session dbus-launch startxfce4
    ;;
lxde)
    ~/bin/lxde&
    ck-launch-session dbus-launch startlxde
    ;;
*)
    ~/bin/openbox&
    ck-launch-session dbus-launch $DEFAULT_SESSION
    ;;
esac
ewaller@odin:~ 1004 %

I start xfce4 by commanding:
WM=xfce4 startx

Edit: Oh, the ~/bin/* files are environment specific start up files.

Last edited by ewaller (2011-06-14 04:02:30)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#3 2011-06-14 04:04:14

awayand
Member
Registered: 2009-09-25
Posts: 398

Re: [SOLVED] consolekit with dwm

right so let's say you start lxde that way, you will still have to start xfce4-power-manager *after* that, because if you started it before lxde with the ck-launch-session command, then xfce4-power-manager wouldn't have the necessary rights... Any way to get this working?

Offline

#4 2011-06-14 04:09:02

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,789

Re: [SOLVED] consolekit with dwm

I cheat tongue

ewaller@odin:~ 1003 %cat bin/xfce4  
#!/bin/bash
sleep 5
conky&
tilda&

I do start things afterwards.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#5 2011-06-14 04:53:47

awayand
Member
Registered: 2009-09-25
Posts: 398

Re: [SOLVED] consolekit with dwm

Shame on you!

Offline

#6 2011-06-15 04:04:10

awayand
Member
Registered: 2009-09-25
Posts: 398

Re: [SOLVED] consolekit with dwm

anyone else got an idea to fix this?

Offline

#7 2011-06-15 04:19:17

awayand
Member
Registered: 2009-09-25
Posts: 398

Re: [SOLVED] consolekit with dwm

Finally found a way. Here is what my .xinitrc looks like to make dwm work with console-/policykit:

exec ck-launch-session bash -c "xfce4-power-manager &
pcmanfm -d --desktop-off &  
stalonetray --kludges fix_window_pos,force_icons_size &  
dwmst"

Offline

#8 2011-06-15 06:24:10

Meyithi
Member
From: Wirral, UK
Registered: 2009-06-21
Posts: 550
Website

Re: [SOLVED] consolekit with dwm

Or you could do it the easy way and exec ck-launch-session script

#!/bin/sh
#
# ~/.xinitrc
#
# Executed by startx (run your window manager from here)

if [ -d /etc/X11/xinit/xinitrc.d ]; then
  for f in /etc/X11/xinit/xinitrc.d/*; do
    [ -x "$f" ] && . "$f"
  done
  unset f
fi

# exec gnome-session
# exec startkde
# exec startxfce4
# ...or the Window Manager of your choice

exec ck-launch-session dbus-launch --sh-syntax --exit-with-session ~/.bin/startdwm

and then everything in startdwm will have rights assigned.


The mind roams more freely in empty rooms.
dwm - colours - ncmpcpp - system
irc://irc.freenode.net:meyithi

Offline

#9 2011-06-15 13:47:18

awayand
Member
Registered: 2009-09-25
Posts: 398

Re: [SOLVED] consolekit with dwm

I like that one, will do that instead. thanks!

Offline

Board footer

Powered by FluxBB