#!/usr/bin/env bash
dbus-update-activation-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP DISPLAY
waybar &
# wlr-randr ...
nm-applet &
blueman-applet &
emacs --daemon &
# do not error! Also turn on the internal monitor if this failed.
wlr-randr \
--output DP-9 --pos 0,0 \
--output DP-8 --pos 3840,0 \
--output DP-7 --pos 1920,0 \
--output eDP-1 --off || wlr-randr --output eDP-1 --on
swayidle -w \
timeout 300 '~/.sessions/wlopm-all-screens off' \
resume '~/.sessions/wlopm-all-screens on' \
\
timeout 1800 'loginctl suspend' \
timeout 30 'makoctl mode -a idle' \
resume 'makoctl mode -r idle' \
\
before-sleep 'swaylock -Ff' \
lock 'swaylock -Ff' &