1
0
mirror of https://github.com/dcarrillo/dotfiles.git synced 2025-10-01 07:19:09 +00:00

[polybar] Add polytasks module

This commit is contained in:
2025-09-27 12:51:08 +02:00
parent 022647ddf4
commit 9fd1c3757a
6 changed files with 332 additions and 6 deletions

View File

@@ -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
}