#!/usr/bin/env bash
set -e
. "$HOME/bin/x11-go"
if is-lower-res; then
sleep 2s
case "$(myhostname)" in
duff)
gohead set left middle right
;;
*)
gohead set main
;;
esac
fi
run-wingo-environment &
# Wait for Wingo to start before doing other things that generally require
# a WM to be present below. e.g., Starting the bottom dock in `video`.
while ! pgrep '^wingo$'; do
sleep 0.1s
done
# I'm not sure why this is needed, but when the mode needs to be
# changed, we need to wait a bit more time. Otherwise the mode doesn't
# actually seem to be changed. It ends up being too quick after X11
# starts? I suppose we could change the default mode in a static X11
# configuration, but this is fine in practice.
# if is-lower-res; then
# sleep 2s
# fi
startup
# Most things jsut want to boot to one main monitor, but duff is my special
# triple monitor setup.
case "$(myhostname)" in
duff)
video left middle right &
;;
*)
video main &
;;
esac
variety &
dunst &
ag-blueberry-tray &
restart-compositor &
1password \
--silent \
--force-device-scale-factor=1.5 \
--log=debug &> /tmp/1password.log &
if cmd-exists nm-applet; then
nm-applet &
fi
if is-laptop; then
autobright &
# I can't remember why I do this for my laptop.
(volume mute ; volume mute) &
# An agent to make the fingerprint sensor work.
/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &
(
ssh-add-keys
relink-ssh-auth-sock
systemctl --user start mount-nas
) &
elif is-media; then
# Show some nice icons for our media PCs.
idesk &
(
# The media PCs have a passwordless ssh key
# that grants them access to the NAS. But it
# needs to be in the agent for it to work.
ssh-add ~/.ssh/id_rsa
# Ensure we've re-linked our ssh auth socket.
relink-ssh-auth-sock
) &
fi
while true; do sleep 86400s; done