Restructured DWL startup files

This commit is contained in:
2024-09-18 18:44:47 -07:00
parent d9cca35b59
commit 0ea7a9251f
10 changed files with 199 additions and 51 deletions

View File

@@ -5,35 +5,7 @@ function log_this() {
echo "$TSTMP : " $1 >> $DWL_LOG_FILE
}
log_this "Entourage: $XDG_RUNTIME_DIR - $DWL_TAGS_FILE"
NUM_DISPS=$(wlr-randr | grep -E "^\w+" | wc -l)
log_this "Entourage: Configuring ${NUM_DISPS} displays"
if [[ $NUM_DISPS > 1 ]]; then
# Dual screen
# wlr-randr --output HDMI-A-1 --on --pos 0,0 --output eDP-1 --on --pos 0,1050
# wlr-randr --output HDMI-A-1 --on --pos 0,0 --output eDP-1 --on --pos 2560,0
# With Dell 1920x1200 display - vertical arrangement
#
# .--------------------------------.
# | |
# | DELL 24" 1920x1200 |
# | (HDMI-A-1) |
# | |
# `--------------------------------'
# | |
# | LAPTOP 13" 1366x768 |
# | (eDP-1) |
# | |
# `-------------------------'
#
wlr-randr --output HDMI-A-1 --on --pos 0,0 --output eDP-1 --on --pos 300,1200
else
# Single laptop screen
wlr-randr --output HDMI-A-1 --off --output eDP-1 --on --pos 0,0
fi
log_this "Entourage: $XDG_RUNTIME_DIR"
# ----------------------------------------------------------
# Let DWL start
@@ -44,32 +16,24 @@ do
sleep 1
done
log_this "DWL ready!"
log_this "Entourage: $DWL_TAGS_FILE"
# ----------------------------------------------------------
# Background
# Background and support tasks
# ----------------------------------------------------------
# TODO: Consuimng too much CPU - keeps fan spinning
# swaybg --mode fill --image ~/.config/wallpaper.jpg &
# source ~/bin/dwl.wallpaper_setup
# ----------------------------------------------------------
# Lock when idle
# ----------------------------------------------------------
log_this "Entourage: Starting screen locker with 10min idle time"
swayidle -w timeout 600 swaylock &
source ~/bin/dwl.idle_setup
# ----------------------------------------------------------
# Redirect STDIN to STDOUT and pass along to tags script
# ----------------------------------------------------------
DWL_BAR=$DWL_BAR_PATH/somebar
log_this "Entourage: Configuring $(wlr-randr | grep -E "^\w+" | wc -l) displays"
source ~/bin/dwl.randr_setup
log_this "Entourage: Setting up notification"
source ~/bin/dwl.notification_setup
log_this "Entourage: Setting up MPD support"
source ~/bin/dwl.mpd_support_setup
export SOMEBAR_FIFO=$XDG_RUNTIME_DIR/somebar.fifo
mkfifo $SOMEBAR_FIFO -m666
log_this "Entourage: Starting somebar using $SOMEBAR_FIFO"
conky -c ~/.conkyrc > $SOMEBAR_FIFO &
(while read line
do
echo $line
done) | ($DWL_BAR -s $SOMEBAR_FIFO > $XDG_RUNTIME_DIR/somebar.log 2>&1)
source ~/bin/dwl.bar_setup