dotconf/.xsession

123 lines
2.7 KiB
Plaintext
Raw Permalink Normal View History

2020-08-17 17:09:18 -06:00
#!/bin/sh
2021-08-30 10:41:10 -06:00
export OHMYKSH_DIR=${HOME}/src/ohmyksh
. ${OHMYKSH_DIR}/ohmy.ksh
2020-08-17 17:09:18 -06:00
2021-12-02 09:07:42 -07:00
set -A my_paths -- \
/usr/ports/infrastructure/bin \
~/bin \
~/go/bin \
/usr/local/plan9/bin
paths "${my_paths[@]}"
2021-10-02 08:38:57 -06:00
mv ~/Downloads ~/.tdownloads && \
mkdir ~/Downloads
rm -rf ~/.tdownloads &
2020-08-17 17:09:18 -06:00
# Disable coredumps
#ulimit -Sc 0
2020-08-17 17:09:18 -06:00
cat /dev/null > ~/.xsession-errors
LC_CTYPE="en_US.UTF-8"
TERM=screen-256color
BROWSER=$(which xdg-open 2>/dev/null)
export LC_CTYPE TERM BROWSER
2020-08-17 17:09:18 -06:00
2021-12-02 09:07:42 -07:00
TIMEOUT=$(cat ~/.xtimeout 2> /dev/null || echo "300")
2020-08-17 17:09:18 -06:00
OS=$(uname)
LPREFIX=/usr/local
wmanager=$(cat ~/.wmanager 2> /dev/null || echo "/usr/X11R6/bin/cwm")
if [ $OS != "OpenBSD" ]; then
LPREFIX=/usr
fi
2021-08-30 10:41:10 -06:00
load_extension fonts
which keychain 2>&1 > /dev/null && load_extension keychain
2020-08-17 17:09:18 -06:00
xrdb -merge -load ~/.Xresources &
if [ -x ${LPREFIX}/bin/dbus-launch -a -z "${DBUS_SESSION_BUS_ADDRESS}" ]; then
eval `dbus-launch --sh-syntax --exit-with-session`
fi
case "$wmanager" in
/home/qbit/bin/juicebox)
xsetroot -solid black
;;
2021-06-21 07:58:12 -06:00
/usr/X11R6/bin/cwm|/usr/local/bin/spectrwm)
2020-08-17 17:09:18 -06:00
while true; do ~/bin/bar; sleep 3; done | lemonbar-xft -d \
-f "$Go Mono:pixelsize=12" \
-B "#FFFFEA" \
-F "#000000" | sh &
2021-12-02 09:07:42 -07:00
xidle -delay 5 -program "/usr/X11R6/bin/xlock" -timeout $TIMEOUT &
/usr/X11R6/bin/xcompmgr &
2020-08-17 17:09:18 -06:00
;;
2021-08-28 16:51:21 -06:00
/usr/local/bin/xfce4-session)
dbus-monitor --session "type='signal',interface='org.xfce.ScreenSaver'" | \
while read x; do
case "$x" in
*"boolean true"*)
echo "Locked - clearing keys"
/usr/bin/ssh-add -D;
/usr/local/bin/rbw lock;
/usr/local/bin/sudo -K
;;
esac
done &
;;
2020-08-17 17:09:18 -06:00
/usr/local/bin/awesome)
xsetroot -solid black
;;
xmonad)
hsetroot -center ~/.background.jpg &
xidle -delay 5 -program "/usr/X11R6/bin/xlock" -timeout $TIMEOUT &
2020-08-17 17:09:18 -06:00
;;
/usr/X11R6/bin/fvwm)
2021-12-16 09:59:07 -07:00
echo "fvwm init from InitFunction"
2020-08-17 17:09:18 -06:00
;;
esac
if [ -f ~/.Xmodmap ]; then
xmodmap ~/.Xmodmap &
fi
if [ -d /usr/local/plan9/ ]; then
pgrep -q fontsrv || (/usr/local/plan9/bin/fontsrv &)
pgrep -q plumber || (/usr/local/plan9/bin/plumber &)
fi
sctd 3500 &
for tool in tpb xbanish scmpc autocutsel keychain fido; do
if [ -e "${LPREFIX}/bin/${tool}" ]; then
case "${i}" in
sctd)
${LPREFIX}/bin/sctd 3500
;;
tpb)
${LPREFIX}/bin/tpb -d
;;
keychain)
${LPREFIX}/bin/keychain --gpg2 --inherit any --agents ssh,gpg -q -Q
keychain_conf="$HOME/.keychain/$(uname -n)-sh"
# shellcheck source=/home/qbit/.keychain/slip.bold.daemon-sh
[ -e "${keychain_conf}" ] && . ${keychain_conf}
# shellcheck source=/home/qbit/.keychain/slip.bold.daemon-sh-gpg
[ -e "${keychain_conf}-gpg" ] && . ${keychain_conf}-gpg
;;
*)
${LPREFIX}/bin/${tool} &
;;
esac
fi
done
exec "$wmanager"