diff options
| author | Anhgelus Morhtuuzh <anhgelus.morhtuuzh@gmx.com> | 2023-07-25 23:46:05 +0200 |
|---|---|---|
| committer | Anhgelus Morhtuuzh <anhgelus.morhtuuzh@gmx.com> | 2023-07-25 23:46:05 +0200 |
| commit | c57e8ab185623510e527400a34d729b313daffc4 (patch) | |
| tree | 7b67d44894255ce4810d8074d68fce88f66d37d0 /config/polybar/pwidgets/launch.sh | |
| parent | 9f004955033387eebf3f58aec2501fba5020f307 (diff) | |
feat(polybar): update polybar style
Diffstat (limited to 'config/polybar/pwidgets/launch.sh')
| -rwxr-xr-x | config/polybar/pwidgets/launch.sh | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/config/polybar/pwidgets/launch.sh b/config/polybar/pwidgets/launch.sh new file mode 100755 index 0000000..c5659f7 --- /dev/null +++ b/config/polybar/pwidgets/launch.sh @@ -0,0 +1,68 @@ +#!/usr/bin/env sh + +DIR="$HOME/.config/polybar/pwidgets" + +kill_bar() { + # Terminate already running bar instances + killall -q polybar + + # Wait until the processes have been shut down + while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done +} + +## Main +if [[ "$1" == "--main" ]]; then + kill_bar + polybar -q primary -c $DIR/main.ini & + polybar -q secondary -c $DIR/main.ini & + polybar -q top -c $DIR/main.ini & + +## Apps +elif [[ "$1" == "--apps" ]]; then + kill_bar + polybar -q primary -c $DIR/apps.ini & + polybar -q secondary -c $DIR/apps.ini & + +## System +elif [[ "$1" == "--system" ]]; then + kill_bar + polybar -q primary -c $DIR/system.ini & + polybar -q secondary -c $DIR/system.ini & + +## Mpd +elif [[ "$1" == "--mpd" ]]; then + kill_bar + polybar -q primary -c $DIR/mpd.ini & + polybar -q secondary -c $DIR/mpd.ini & + +## Workspaces +elif [[ "$1" == "--ws" ]]; then + kill_bar + polybar -q primary -c $DIR/workspace.ini & + polybar -q secondary -c $DIR/workspace.ini & + +## CPU +elif [[ "$1" == "--cpu" ]]; then + kill_bar + polybar -q primary -c $DIR/cpu.ini & + polybar -q secondary -c $DIR/cpu.ini & + +## Memory +elif [[ "$1" == "--memory" ]]; then + kill_bar + polybar -q primary -c $DIR/memory.ini & + polybar -q secondary -c $DIR/memory.ini & + +## Filesystem +elif [[ "$1" == "--fs" ]]; then + kill_bar + polybar -q primary -c $DIR/fs.ini & + polybar -q secondary -c $DIR/fs.ini & + +else + cat <<- _EOF_ + No widget specified, Available widgets: + --main --apps --system --mpd + --ws --cpu --memory --fs + _EOF_ +fi |
