waybar changes 2

This commit is contained in:
cnst
2024-12-27 16:48:09 +01:00
parent 10716da678
commit ee165333ba
7 changed files with 0 additions and 335 deletions

View File

@@ -1,21 +0,0 @@
#!/bin/sh
output() {
if [ -f "$HOME/decrypted/.lock" ]; then
printf '{"text": ""}\n'
else
printf '{"text": ""}\n'
fi
}
check() {
[ ! -d "$HOME/decrypted" ] && return
output
inotifywait -q "$HOME/decrypted/.lock" > /dev/null 2>&1
output
inotifywait -q "$HOME/decrypted" > /dev/null
check
}
check

View File

@@ -1,18 +0,0 @@
#!/bin/sh
check() {
[ ! -d "$HOME/.mail" ] && return
notmuch new > /dev/null
count="$(notmuch count 'tag:unread')"
tooltip="There are $count new emails"
if [ "$count" = "0" ]; then
printf '{"text": ""}\n'
else
printf '{"text": "%s", "tooltip": "%s", "alt": "icon"}\n' "$count" "$tooltip"
fi
inotifywait -q -e move -e create -e delete "$HOME/.mail/cnst/INBOX/cur" > /dev/null
check
}
check

View File

@@ -1,7 +0,0 @@
#!/usr/bin/env bash
output="$(progress -q)"
text="$(printf "%s" "$output" | sed 's/\[[^]]*\] //g' | awk 'BEGIN { ORS=" " } NR%3==1 { op=$1 } NR%3==2 { pct=($1+0); if (op != "gpg" && op != "coreutils" && pct > 0 && pct < 100) { print op, $1 } }')"
tooltip="$(printf "%s" "$output" | perl -pe 's/\n/\\n/g' | perl -pe 's/(?:\\n)+$//')"
printf '{"text": "%s", "tooltip": "%s"}\n' "$text" "$tooltip"

View File

@@ -1,7 +0,0 @@
#!/usr/bin/env bash
if pgrep -x wf-recorder >/dev/null; then
printf '{"text": "  "}\n'
else
printf '{"text": ""}\n'
fi

View File

@@ -1,37 +0,0 @@
#!/bin/bash
socket="${XDG_RUNTIME_DIR:-/run/user/$UID}/yubikey-touch-detector.socket"
while true; do
touch_reasons=()
if [ ! -e "$socket" ]; then
printf '{"text": "Waiting for YubiKey socket"}\n'
while [ ! -e "$socket" ]; do sleep 1; done
fi
printf '{"text": ""}\n'
while read -n5 cmd; do
reason="${cmd:0:3}"
if [ "${cmd:4:1}" = "1" ]; then
touch_reasons+=("$reason")
else
for i in "${!touch_reasons[@]}"; do
if [ "${touch_reasons[i]}" = "$reason" ]; then
unset 'touch_reasons[i]'
break
fi
done
fi
if [ "${#touch_reasons[@]}" -eq 0 ]; then
printf '{"text": ""}\n'
else
tooltip="YubiKey is waiting for a touch, reasons: ${touch_reasons[@]}"
printf '{"text": "  ", "tooltip": "%s"}\n' "$tooltip"
fi
done < <(nc -U "$socket")
sleep 1
done