diff --git a/misc/xsession b/misc/xsession old mode 100644 new mode 100755 index 7e15537..c5bc6f2 --- a/misc/xsession +++ b/misc/xsession @@ -1,50 +1,86 @@ #!/bin/yash - export TERM=xterm -export FXDE_DIR=/home/midfavila/.config/fxde -. /etc/profile -#. /home/midfavila/.config/shrc +load_configs() +{ + . /etc/profile + for file in /home/"${USER}"/.config/xresources/* + do xrdb -merge "${file}" + done +} +setup_daemons() +{ + #Don't use opengl on mobile devices. + if [ "$(hostname)" = "speculatores" ] + then picom -cCzfGD3 --shadow-exclude bounding_shaped --vsync --backend \ + xrender --no-use-damage & + else picom -cCzfGD3 --shadow-exclude bounding_shaped --vsync --backend \ + gl --no-use-damage & + fi -for file in /home/midfavila/.config/xresources/* -do - xrdb -merge "${file}" -done + #Manage clicks on the root window. + xclickroot -1 "$FXDE_DIR/fxde-core/config/menu" & + #Manage hotkeys. + sxhkd -c "$FXDE_DIR/fxde-core/config/sxhkdrc" & + + #Run Emacs in the background + emacs --daemon & + + #Start the screen-locker automatically. + xssstart slock & +} +start_ui() +{ + #Welcome chime. + aplay "${FXDE_DIR}/fxde-assets/audio/Login.wav" & + + #Set cursor. + xsetroot -xcf "${FXDE_DIR}/fxde-assets/cursors/${CURSOR}/cursors/left_ptr" 12 & + + #Set wallpaper. + xwallpaper --no-randr --stretch "${FXDE_DIR}/fxde-assets/wallpaper/${PAPE}" + + #Start our status bar. + "$FXDE_DIR/fxde-core/scripts/bar.sh"|lemonbar -b -F '#000000' -g26 + '#00000000' -f xft:family=Liberation:style=Mono:size=9: & + + #Spawn a system tray. + stalonetray --window-type desktop --icon-gravity N -v -t --grow-gravity S \ + -i 24 --geometry 1x1+0-17 & + + #Manage clicks on the root window. + xclickroot -1 "$FXDE_DIR/fxde-core/config/menu" & +} +############################################################################### +############################################################################### +## ## +## The actual config is below this. ## +## ## +############################################################################### +############################################################################### + +#Where do we look for assets? +FXDE_DIR=/home/midfavila/.config/fxde + +#What wallpaper to load? +PAPE=ori-thing.jpg + +#What cursor to load? +CURSOR=Lambda + +#What window manager to use? wm=shod -if [ $wm = fvwm ] -then - export FVWM_USERDIR=/home/midfavila/.config/fxde/fxde-core/;exec fvwm3 -elif [ $wm = wl ] -then - # Desktop settings. - FXDE_DIR=/home/midfavila/.config/fxde/ - PAPE="${FXDE_DIR}"/fxde-assets/wallpaper/landscape.jpg - CURSOR=Lambda - xwallpaper --no-randr --stretch "${PAPE}" & - xsetroot -xcf "${FXDE_DIR}"/fxde-assets/cursors//"${CURSOR}"/cursors/left_ptr 12 & - aplay "${FXDE_DIR}/fxde-assets/audio/Login.wav" & - xssstart slock & - xclock -digital -brief -twentyfour -render -geometry 50x10+0-0 & - stalonetray & - exec windowlab -active '#A0A0D0' -inactive '#D0D0D0' -empty '#D0D0D0' -elif [ $wm = shod ] -then - #Desktop settings. - PAPE="${FXDE_DIR}/fxde-assets/wallpaper/landscape.jpg" - CURSOR=Lambda - picom -cCzfGD3 --shadow-exclude bounding_shaped --vsync --backend glx \ - --no-use-damage& - xclickroot -1 $FXDE_DIR/fxde-core/config/menu & - $FXDE_DIR/fxde-core/scripts/bar.sh|lemonbar -b -F '#000000' -g265x16+0+0 -B \ - '#00000000' -f xft:family=Liberation:style=Mono:size=9: & - sxhkd -c $FXDE_DIR/fxde-core/config/sxhkdrc & - xwallpaper --no-randr --stretch "${PAPE}" & - xsetroot -xcf "${FXDE_DIR}"/fxde-assets/cursors/"${CURSOR}"/cursors/left_ptr 12 & - stalonetray --window-type desktop --icon-gravity N -v -t --grow-gravity S -i 24 \ - --geometry 1x1+0-17 & - xssstart slock & - exec shod -fi + + + + +#Initiate our session. +for phase in load_configs setup_daemons start_ui + do "${phase}" +done + +#Hand control to the window manager. +exec "${wm}"