diff --git a/.config/polybar/bar.ini b/.config/polybar/bar.ini index 6314b4a..05167af 100644 --- a/.config/polybar/bar.ini +++ b/.config/polybar/bar.ini @@ -60,7 +60,7 @@ font-4 = "NotoSans-Regular:size=28:weight=bold:antialias=true;-11 font-5 = "FontAwesome:size=21:antialias=true;4" font-6 = "Font Awesome 6 Brands-Regular-400:size=32:antialias=true;1" -modules-left = polywins +modules-left = polytasks modules-center = custom_date modules-right = updates cpu_bar memory_bar docker vpn network_status network_usage syncthing_status pulseaudio tray diff --git a/.config/polybar/launch.sh b/.config/polybar/launch.sh index b0f1d88..7f50108 100755 --- a/.config/polybar/launch.sh +++ b/.config/polybar/launch.sh @@ -1,10 +1,12 @@ #!/usr/bin/env bash -[ -f ~/.config/polybar/bar.env ] && . ~/.config/polybar/bar.env +POLYBAR_PATH=~/.config/polybar + +[ -f $POLYBAR_PATH/bar.env ] && . $POLYBAR_PATH/bar.env export TERMINAL_CMD=${TERMINAL_CMD:-"kitty --class=info --override='foreground=#c69026' "} export BROWSER_CMD=${BROWSER_CMD:-"firefox"} -export WM_CONTROL=${WM_CONTROL:-"~/.config/polybar/scripts/switch_window_state"} +export WM_CONTROL=${WM_CONTROL:-"$POLYBAR_PATH/scripts/switch_window_state"} export ROFI_THEME=${ROFI_THEME:-orange} function wait_for_polybar @@ -25,12 +27,21 @@ function kill_polybar wait_for_polybar stopped } +function compile_src +{ + pushd $POLYBAR_PATH/scripts/src/polytasks || return + echo "Compiling polytasks..." + go build -buildvcs=false -ldflags="-s -w" -o $POLYBAR_PATH/scripts/polytasks . + popd || return +} + function launch_polybar { for monitor in $(polybar --list-monitors | cut -d":" -f1); do export MONITOR=$monitor - polybar top -c ~/.config/polybar/bar.ini >/dev/null & + polybar top -c $POLYBAR_PATH/bar.ini >/dev/null & done + compile_src wait_for_polybar started } diff --git a/.config/polybar/modules.ini b/.config/polybar/modules.ini index 932fffd..609396e 100644 --- a/.config/polybar/modules.ini +++ b/.config/polybar/modules.ini @@ -147,9 +147,9 @@ tail = true interval = 5 click-left = $TERMINAL_CMD yay -Suy & -[module/polywins] +[module/polytasks] type = custom/script -exec = ~/.config/polybar/scripts/polywins 2>/dev/null +exec = ~/.config/polybar/scripts/polytasks format =