userxbw

session.sh

May 27th, 2019
449
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.95 KB | None | 0 0
  1. #!/bin/sh
  2. #
  3. # Default script for e16 session start/restart/stop management
  4. #
  5. # Assuming misc.session.enable_script is set and misc.session.script
  6. # points to this script it will be called with parameter
  7. #
  8. # - "init" first time an X-session (with e16) starts
  9. # - "start" every time e16 (re)starts
  10. # - "stop" when e16 exits without restarting
  11. #
  12. # On init, start, and stop the script will run any executable found in
  13. # ~/.e16/Init/, ~/.e16/Start/, and ~/.e16/Stop/, respectively.
  14. # These executables do not have to exit as they are called with '&' from here.
  15. #
  16. # NOTE:
  17. # In multi-display/screen setups the DISPLAY environment variable can be used
  18. # to differentiate.
  19. #
  20.  
  21. #echo $DISPLAY
  22.  
  23. RunApps() {
  24. local d;
  25.  
  26. d="$ECONFDIR/$1"
  27. test -d "$d" || return
  28.  
  29. for f in "$d"/*
  30. do
  31. if [ -x "$f" ]; then
  32. # echo $f
  33. case "$f" in
  34. *~) # Assume this is crap - skip
  35. ;;
  36. *.sh) # Scripts are executed in foreground
  37. "$f"
  38. ;;
  39. *) # Anything else is executed in background
  40. "$f" &
  41. ;;
  42. esac
  43. fi
  44. done
  45. }
  46.  
  47.  
  48. case "$1" in
  49. init)
  50. RunApps Init
  51. # Start DBUS session bus:
  52. if test -z "$DBUS_SESSION_BUS_ADDRESS" ; then
  53. {
  54. eval `dbus-launch --sh-syntax --exit-with-session`
  55. echo "setting: $DBUS_SESSION_BUS_ADDRESS" > ~/e16.log
  56. export $DBUS_SESSION_BUS_ADDRESS
  57. }
  58. else
  59. echo "alldone $DBUS_SESSION_BUS_ADDRESS" > ~/e16.log
  60. fi
  61. #Shutoff touch pad and touch screen
  62. xinput set-prop $(xinput | awk '/TouchPad/ {print $6}' | cut -d= -f2) "Device Enabled" 0 &
  63. xinput set-prop $(xinput | awk '/Digitizer/ {print $7}' | cut -d= -f2) "Device Enabled" 0 &
  64. wmix &
  65. wmCalClock &
  66. gkrellm &
  67. nm-applet &
  68. [[ -x /usr/bin/dropbox ]] && dropbox start &
  69. [[ -x /usr/bin/dropboxd ]] && dropboxd start &
  70. blueman-applet &
  71. qbittorrent &
  72. conky -c /home/userx/.config/conky/wo-conky-system-lua/WO-conky-system-lua-v3.conkyrc &
  73. ;;
  74. start)
  75. RunApps Start
  76.  
  77. ;;
  78. stop)
  79. RunApps Stop
  80. pkill -u $USER
  81. ;;
  82. esac
Advertisement
Add Comment
Please, Sign In to add comment