snips/dwl.session

38 lines
1.0 KiB
Plaintext
Raw Normal View History

2021-05-16 18:31:19 +00:00
#!/usr/bin/env bash
export WLR_LIBINPUT_NO_DEVICES=1
export PATH=~/bin:$PATH
export DWLTAGS_FILE=/tmp/dwl.tags.$USER.out
# export DWLTAGS_FMT=TXT # Waybar uses this
export DWLTAGS_FMT=DZEN
# Clean up
ps aux | grep $USER | grep wl_show_bars | awk '{ print $2 }' | xargs -n 1 kill -9
ps aux | grep $USER | grep dtao | awk '{ print $2 }' | xargs -n 1 kill -9
rm $DWLTAGS_FILE
(/usr/local/bin/dwl | dwltags.pl) &
# Let DWL start
while [ ! -e "$XDG_RUNTIME_DIR/wayland-0.lock" ]
do
echo "DWL getting ready..."
sleep 1
done
echo "DWL ready!"
# Top bar for displaying DWL tags
# TODO: Dependency - needs inotify-tools package
inotifywait -q -m -e close_write $DWLTAGS_FILE |
(cat $DWLTAGS_FILE ;
while read -r filename event; do
cat $DWLTAGS_FILE
done) | dtao -z -z -ta l -h 22 -fn 'Iosevka Term:style=Regular:size=12' &
# Bottom bar for displaying context information
(conky -c ~/.conkyrc) | dtao -b -z -z -ta r -h 20 -fn 'Iosevka Term:style=Regular:size=12' &
# Background
swaybg --mode fill --image ~/.config/wallpaper.jpg &