From dea54213365e0e240fb202baec20e6266e07d1c3 Mon Sep 17 00:00:00 2001 From: urosm Date: Thu, 8 Feb 2024 15:34:05 +0100 Subject: [PATCH] update scripts --- .local/bin/fuzzel_open.sh | 3 --- .local/bin/status.sh | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.local/bin/fuzzel_open.sh b/.local/bin/fuzzel_open.sh index 1fb53af..7917b95 100755 --- a/.local/bin/fuzzel_open.sh +++ b/.local/bin/fuzzel_open.sh @@ -1,7 +1,5 @@ #!/bin/sh -set -x - while getopts "he:" arg; do case $arg in e) @@ -17,7 +15,6 @@ while getopts "he:" arg; do esac done - shift $(($OPTIND - 1)) file="$(find ${1:-$HOME} ! \( \( $excludes \) -prune \) -print0\ diff --git a/.local/bin/status.sh b/.local/bin/status.sh index 1aff08e..716e663 100755 --- a/.local/bin/status.sh +++ b/.local/bin/status.sh @@ -6,10 +6,10 @@ while true do printf [ swaymsg -t get_inputs | jq -Mcj '[.[] | select(.type=="keyboard")][0] | {"full_text":.xkb_active_layout_name,"urgent":.xkb_active_layout_index}, ","' - cat /sys/class/power_supply/BAT0/capacity | jq -Mcj '{"full_text":.}, ","' + makoctl list | jq -Mcj '.data[] | if length>0 then {"full_text":([length, .[0].summary.data] | join(": ")),"urgent":(.[0].urgency.data == 2)}, "," else "" end' + cat /sys/class/power_supply/BAT0/capacity | jq -Mcj 'if .<20 then {"full_text":.,"urgent":true} else {"full_text":.} end, ","' date +%c | jq -RMcj '{"full_text":.}, ","' swaymsg -t get_tree | jq -Mcj '.nodes[] | select(.name=="__i3").nodes[] | select(.name=="__i3_scratch").floating_nodes | {"full_text":length,"urgent":length}, ","' - makoctl list | jq -Mcj '.data[][0] | {"full_text":(.summary.data // 0),"urgent":((.urgency.data // 0) == 2)}, ","' printf ], timeout 1 swaymsg -t subscribe '["input","binding"]' >/dev/null done