Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- if test -z "$DBUS_SESSION_BUS_ADDRESS";
- then
- eval "$(dbus-launch --sh-syntax --exit-with-session)"
- fi
- startx &
- #compiz --replace ccp & wmpid=$!
- fusion-icon & wmpid=$!
- sleep 1
- # we use xfce4-session as backend, but do not start xfdekstop and xfwm
- if command -v xfconf-query > /dev/null; then
- use_xfce4_session=true
- failesafe_session_name=$(xfconf-query -c xfce4-session -p /general/FailsafeSessionName)
- num_client=$(xfconf-query -c xfce4-session -p "/sessions/${failesafe_session_name}/Count")
- xfwm_client_num=0
- xfdesktop_client_num=0
- for i in $(seq 0 $((num_client - 1))); do
- if xfconf-query -c xfce4-session -p "/sessions/${failesafe_session_name}/Client${i}_Command" | grep "xfwm4" > /dev/null; then
- # note down the number and replace this entry with a empty command
- xfwm_client_num=${i}
- xfconf-query -c xfce4-session -p "/sessions/${failesafe_session_name}/Client${i}_Command" -a -t string -s "true"
- elif xfconf-query -c xfce4-session -p "/sessions/${failesafe_session_name}/Client${i}_Command" | grep "xfdesktop" > /dev/null; then
- # note down the number and replace this entry with a empty command
- xfdesktop_client_num=${i}
- xfconf-query -c xfce4-session -p "/sessions/${failesafe_session_name}/Client${i}_Command" -a -t string -s "true"
- fi
- done
- fi
- if ${use_xfce4_session}; then
- xfce4-session &
- # wait for xfce to be fully loaded (there should be a more elegant way to do this)
- sleep 5;
- # reset the modified entry
- xfconf-query -c xfce4-session -p "/sessions/${failesafe_session_name}/Client${xfwm_client_num}_Command" -r
- xfconf-query -c xfce4-session -p "/sessions/${failesafe_session_name}/Client${xfdesktop_client_num}_Command" -r
- elif [ -f /home/husixu/.compiz-session ]; then
- source /home/husixu/.compiz-session &
- else
- xterm &
- fi
- # Wait for wm
- wait $wmpid
- # properly logout xfce4 session
- if ${use_xfce4_session}; then
- xfce4-session-logout
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement