#!/bin/bash ## ## WM/DE independent Session Ender ## Rationale: I was using a Fusion Standalone session ## and quickly realized there was no way to log out ## of my current session without killing the X server. ## This script allows us to do that, regardless of WM/DE. ## ## By: PiklesOnFire ## Location of Zenity: ZenLoc="/usr/bin/zenity" ## Location of Xmessage: XmesLoc="/usr/bin/xmessage" function Quit { exit 0 } function Error { exit 1 } ## This cleanly ends only the current user's session: function EndSession { skill -TERM -u $(whoami)& sleep 5 && skill -KILL -u $(whoami) && ## Following line only added for bash compatibility Quit } ## Check for Zenity, if fail, check for Xmessage, ## if fail, exit with error function CheckLoc { if [ -f $ZenLoc ]; then ZenPrompt else if [ -f $XmesLoc ]; then XPrompt else Error fi fi } ## Use Xmessage to confirm: function XPrompt { answer=$(xmessage "Are you sure you want to end your current session? " \ -buttons yes,no -print) if [ $answer = "yes" ]; then EndSession else Quit fi } ## Use Zenity to confirm: function ZenPrompt { zenity --question --title "Log Off Confirmation" \ --text "Are you sure you want to end your current session?" if [ "$?" -eq "0" ]; then EndSession else Quit fi } CheckLoc
Prompts before killing the session ;]
So we don't have accidental log outs.
Added a couple lines to kill compiz; as it remained after exiting to the display manager preventing me from launching other sessions not using compiz.
#!/bin/bash
##
## WM/DE independent Session Ender
## Rationale: I was using a Fusion Standalone session
## and quickly realized there was no way to log out
## of my current session without killing the X server.
## This script allows us to do that, regardless of WM/DE.
##
## By: PiklesOnFire
## User Defined Locations:
## Location of Zenity:
ZenLoc="/usr/bin/zenity"
## Location of Xmessage:
XmesLoc="/usr/bin/xmessage"
## End Editable Content
## Do not edit Below this line unless you are fixing a bug
## Or adding/changing functionality
function Quit {
exit 0
}
function Error {
exit 1
}
## This cleanly ends only the current user's session:
function EndSession {
killall compiz & #added these lines to end running compiz
sleep 1 && #before switching to DM
skill -TERM -u $(whoami)&
sleep 5 &&
skill -KILL -u $(whoami) &&
## Following line only added for bash compatibility
Quit
}
## Check for Zenity, if fail, check for Xmessage,
## if fail, exit with error
function CheckLoc {
if [ -f $ZenLoc ]; then
ZenPrompt
else
if [ -f $XmesLoc ]; then
XPrompt
else
Error
fi
fi
}
## Use Xmessage to confirm:
function XPrompt {
answer=$(xmessage "Are you sure you want to shutdown? " \
-buttons yes,no -print)
if [ $answer = "yes" ]; then
EndSession
else
Quit
fi
}
## Use Zenity to confirm:
function ZenPrompt {
zenity --question --title "Log Off Confirmation" \
--text "Are you sure you want to end your current session?"
if [ "$?" -eq "0" ]; then
EndSession
else
Quit
fi
}
CheckLoc
I'm a Newbie but it did the job. Feel free to suggest better implementation.
Edit --
Perhaps I should have read my lxdm wiki with more care before posting as it has a fixed my problem (LXDM) without my edit as well. Whoops!
#!/bin/bash
#
# ~/.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 ck-launch-session dbus-launch $HOME/.xstart
and .xstart : ## make executable by chmod +x .xstart
#!/bin/sh
export BROWSER=firefox
export DE=gnome
(sleep 3 && /usr/bin/nm-applet --sm-disable) &
xbindkeys &
emerald &
tint2 &
adeskbar &
volumeicon -b &
nitrogen --restore &
compiz ccp
if [ -d /etc/X11/xinit/xinitrc.d ]; then
for f in /etc/X11/xinit/xinitrc.d/*; do
[ -x "$f" ] && . "$f"
done
unset f
fi
export BROWSER=firefox-aurora
export DE=xfce
(sleep 3 && /usr/bin/nm-applet --sm-disable) &
xbindkeys &
#emerald &
tint2 &
adeskbar &
/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &
volumeicon -b &
nitrogen --restore &
exec ck-launch-session dbus-launch fusion-icon
using radeon HD 5770 with xorg ati drivers and kms.
in the start-compiz.sh script
But it does not work...
Any idea ?
Thx
]]>Adding
# D-Bus
if which dbus-launch >/dev/null && test -z "$DBUS_SESSION_BUS_ADDRESS"; then
eval "$(dbus-launch --sh-syntax --exit-with-session)"
fi
doesn't break anything, but it doesn't fix it either.
Should I be using the inittab method of starting X or the ~/.bash_profile
]]>I'm working on setting up compiz standalone on my laptop. It's working well but i'm having one issue. Since I'm running on my laptop, I want something to monitor/control my power settings. The only options I've found are gnome-power-manager and xfce4-power-manager. I've tried both, but I get errors about my dbus session service not being started. I tried adding dbus-launch -ssh -syntax --exit-with-session to my .xinitrc but had no change. I've also got similar errors with other applications, such as Rkward (a frontend for R statistics). Any idea what is missing here? Or is there a better option to use besides gnome or xfce power-manger?
Thanks in advance.
Try ad this to the top of you .xinitrc:
# D-Bus
if which dbus-launch >/dev/null && test -z "$DBUS_SESSION_BUS_ADDRESS"; then
eval "$(dbus-launch --sh-syntax --exit-with-session)"
fi
The only options I've found are gnome-power-manager and xfce4-power-manager. I've tried both, but I get errors about my dbus session service not being started.
Did you start dbus in your rc.d?
]]>exec ck-launch-session dbus-launch compiz ccp
Might be worth a shot to see if that makes a difference--I have no idea if it does or not. I do know I don't have any dbus errors with Rkward.
]]>Thanks in advance.
]]>Thanks!
]]>When enabling compiz as the window manager, all the cool plugins work, but I lose the ability to do anything in the actual window. I can't scroll, can't type, can't move within the window itself. I can grab, minimize, resize and maximize just fine... but that's all I can do. I have no idea what setting to turn on to fix this. I have tried the gconf integration options, all the window and utility settings within compiz. If anybody could shed some light on this, I would appreciate it. I'm sure that things are actually happening in the windows, because popups and tooltips show (and I can tell that scrolling is technically working by where the tooltip is on the screen before and after attempting to scroll) but I guess nothing is rendering properly within the windows once compiz is running as the WM. Thanks in advance!
(this happens with Compiz as standalone or as addon to XFCE)
Figured out my own issue.... I had to turn off the LOOSE BINDING option! (running on an ATI Mobility RadeonHD 4250) Now if I could just get the wallpaper plugin to work...
]]>and only get fusion-start.sh to run with:
exec ck-launch-session /usr/local/bin/start-fusion.sh
i use slim.
]]>