2022-07-04 02:00:59 -05:00
|
|
|
#!/bin/sh
|
|
|
|
|
2022-11-10 14:48:01 -06:00
|
|
|
barwidth=20
|
2022-07-15 15:48:02 -05:00
|
|
|
|
2022-11-10 14:48:01 -06:00
|
|
|
# remove all current statusbars
|
2022-11-27 11:04:53 -06:00
|
|
|
# pgrep doesn't handle arguments for running commands
|
|
|
|
# shellcheck disable=2009
|
2022-11-10 14:48:01 -06:00
|
|
|
processes="$(ps aux | grep 'st -c' | grep 'status' | awk -F' ' '{print $2}')"
|
|
|
|
for i in $processes; do
|
2022-11-27 11:04:53 -06:00
|
|
|
pkill -P "$i" >/dev/null 2>&1
|
|
|
|
kill "$i"
|
2022-11-10 14:48:01 -06:00
|
|
|
done
|
2022-10-14 13:39:55 -05:00
|
|
|
|
2022-11-10 14:48:01 -06:00
|
|
|
# get all screens
|
|
|
|
screens="$(xrandr | grep ' connected' | sed 's/ primary//g' | awk -F' ' '{print $1 " " $3}')"
|
|
|
|
|
|
|
|
# for every screen, create a statusbar
|
|
|
|
IFS="
|
|
|
|
"
|
|
|
|
for i in $screens; do
|
2022-11-27 11:04:53 -06:00
|
|
|
screenstring=$(echo "$i" | awk -v a="$barwidth" -F'[ x+]' '{print $2 "x" a "+" $4 "+" $5}')
|
2022-11-10 14:48:01 -06:00
|
|
|
st -c statusbar -p -g "$screenstring" -e status &
|
|
|
|
done
|