scripts reorganize
This commit is contained in:
16
scripts/hypr-scripts/waybar.sh
Executable file
16
scripts/hypr-scripts/waybar.sh
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env nix-shell
|
||||
#! nix-shell -i bash --packages killall envsubst waybar
|
||||
|
||||
#kill old instance
|
||||
kill $(ps aux | grep '[w]aybar -c /tmp/waybar-config' | awk -F' ' '{print $2}')
|
||||
while pgrep -u $UID -x waybar > /dev/null; do
|
||||
sleep 1;
|
||||
killall -q waybar
|
||||
kill $(ps aux | grep '[w]aybar -c /tmp/waybar-config' | awk -F' ' '{print $2}')
|
||||
done
|
||||
|
||||
IFS=$'\t\n'
|
||||
MONITOR=$(hyprctl monitors -j | jq -r '.[] | select(.x==0 and .y==0) | .name') envsubst < ~/.config/waybar/config > /tmp/waybar-config
|
||||
unset IFS
|
||||
|
||||
waybar -c /tmp/waybar-config &
|
||||
Reference in New Issue
Block a user