Configuration_Files/misc/xsession

88 lines
2.3 KiB
Plaintext
Executable File

#!/bin/yash
export TERM=xterm
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
#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' -g265x16+0+0 \
-B '#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
#Initiate our session.
for phase in load_configs setup_daemons start_ui
do "${phase}"
done
#Hand control to the window manager.
exec "${wm}"