Advertisement
Guest User

Untitled

a guest
Mar 24th, 2019
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.98 KB | None | 0 0
  1. #!/bin/bash
  2. if test -z "$DBUS_SESSION_BUS_ADDRESS";
  3. then
  4. eval "$(dbus-launch --sh-syntax --exit-with-session)"
  5. fi
  6.  
  7. startx &
  8. #compiz --replace ccp & wmpid=$!
  9. fusion-icon & wmpid=$!
  10.  
  11. sleep 1
  12.  
  13. # we use xfce4-session as backend, but do not start xfdekstop and xfwm
  14. if command -v xfconf-query > /dev/null; then
  15. use_xfce4_session=true
  16. failesafe_session_name=$(xfconf-query -c xfce4-session -p /general/FailsafeSessionName)
  17. num_client=$(xfconf-query -c xfce4-session -p "/sessions/${failesafe_session_name}/Count")
  18.  
  19. xfwm_client_num=0
  20. xfdesktop_client_num=0
  21. for i in $(seq 0 $((num_client - 1))); do
  22. if xfconf-query -c xfce4-session -p "/sessions/${failesafe_session_name}/Client${i}_Command" | grep "xfwm4" > /dev/null; then
  23. # note down the number and replace this entry with a empty command
  24. xfwm_client_num=${i}
  25. xfconf-query -c xfce4-session -p "/sessions/${failesafe_session_name}/Client${i}_Command" -a -t string -s "true"
  26. elif xfconf-query -c xfce4-session -p "/sessions/${failesafe_session_name}/Client${i}_Command" | grep "xfdesktop" > /dev/null; then
  27. # note down the number and replace this entry with a empty command
  28. xfdesktop_client_num=${i}
  29. xfconf-query -c xfce4-session -p "/sessions/${failesafe_session_name}/Client${i}_Command" -a -t string -s "true"
  30. fi
  31. done
  32. fi
  33.  
  34. if ${use_xfce4_session}; then
  35. xfce4-session &
  36.  
  37. # wait for xfce to be fully loaded (there should be a more elegant way to do this)
  38. sleep 5;
  39.  
  40. # reset the modified entry
  41. xfconf-query -c xfce4-session -p "/sessions/${failesafe_session_name}/Client${xfwm_client_num}_Command" -r
  42. xfconf-query -c xfce4-session -p "/sessions/${failesafe_session_name}/Client${xfdesktop_client_num}_Command" -r
  43. elif [ -f /home/husixu/.compiz-session ]; then
  44. source /home/husixu/.compiz-session &
  45. else
  46. xterm &
  47. fi
  48.  
  49. # Wait for wm
  50. wait $wmpid
  51.  
  52. # properly logout xfce4 session
  53. if ${use_xfce4_session}; then
  54. xfce4-session-logout
  55. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement