Files
dotfiles/.local/bin/screen-layout
T
Daniele Fucini 4e431d6710 Make xmobar and trayer 24px tall and match trayer's background to xmobar
xmobar was auto-sized (17px) and trayer 18px; both are now 24px. trayer only
honours --tint with --transparent, so it drew the GTK background instead.
2026-10-26 17:55:26 +01:00

27 lines
954 B
Bash
Executable File

#!/bin/bash
# Sets up the outputs, wallpaper and trayer for whatever monitors are connected.
# Called by xmonad at startup and on monitor (dis)connect, and by `movie` on exit.
# --keep-wallpaper redraws the current wallpaper instead of picking new random ones.
if xrandr --query | grep -q '^HDMI-1-0 connected'; then
xrandr --output HDMI-1-0 --preferred --primary --output eDP-1 --right-of HDMI-1-0 --preferred
tray=1
else
xrandr --output eDP-1 --preferred --primary --output HDMI-1-0 --off
tray=0
fi
if [[ $1 == --keep-wallpaper ]]; then
~/.fehbg --keep
else
~/.fehbg
fi
# Replace any running trayer, so there's never more than one
pkill -x trayer
while pgrep -x trayer > /dev/null; do sleep 0.1; done
trayer -l --edge top --align right --SetDockType true \
--SetPartialStrut true --expand true --widthtype request \
--transparent true --alpha 0 --tint 0x24283b --height 24 --monitor "$tray" > /dev/null 2>&1 &
disown