dotfiles/.xsession

57 lines
1.1 KiB
Bash

#!/bin/sh -x
cleanup() {
echo "Cleaning up..."
pkill dbus-daemon picom xbanish
rm -f ~/.Xauthority
rm -f ~/*.core
rm -rf ~/.local/share/Trash
}
trap cleanup INT TERM QUIT
export MOZ_USE_XINPUT2=1
export MOZ_ACCELERATED=1
export MOZ_WEBRENDER=1
export LANG=en_US.UTF-8
export PATH=$HOME/.local/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin:/usr/games
export QT_QPA_PLATFORMTHEME="qt5ct"
export QT_ENABLE_HIGHDPI_SCALING=1
export QT_SCALE_FACTOR=0.5
export NO_COLOR=1
# Load Xresources
xrdb < ~/.Xresources
# Set desktop background
hsetroot -solid darkgrey
# No bell
xset -b
# No mouse acceleration
xset m 0 0
# Map right alt to compose key
setxkbmap -option "compose:ralt"
# Map CapsLock to Control_L
setxkbmap -option "ctrl:nocaps"
# Launch DBUS for programs which need it
eval `dbus-launch --sh-syntax`
# Compositor
picom -b
# Hide cursor when typing
xbanish -i all &
# Auto-lock / auto-off screen
xidle -program "/usr/X11R6/bin/xlock -mode dclock -ncolors 2" -timeout 1800 &
xset dpms 1800 1800 1800
# Launch WM and block
cwm
# Run cleanup function on exit
cleanup