feat: optimized sbar, gammastep asia, wpdef

This commit is contained in:
ange 2025-04-30 02:41:45 +00:00
parent f48e958d44
commit 395119a0fe
Signed by: ange
GPG key ID: 9E0C4157BB7BEB1D
19 changed files with 159 additions and 157 deletions

32
.local/bin/wpdef Executable file
View file

@ -0,0 +1,32 @@
#!/bin/bash -e
json="$(pw-dump)"
function getdevs() {
jq -r ".[] | select(.info.props.\"media.class\" == \"Audio/$1\") | \"\(.id) \(.info.props.\"node.nick\")\"" <<< "$json"
}
function getdefault() {
jq -r ".[].metadata | select(.) | .[] | select(.key == \"default.configured.audio.$1\") | .value.name" <<< "$json"
}
function getnick() {
jq -r ".[].info.props | select(.\"node.name\" == \"$1\") | .\"node.nick\"" <<< "$json"
}
case "$1" in
s)
CLASS=Sink
;;
m)
CLASS=Source
;;
*)
exit 1
;;
esac
read -r id <<< "$(getdevs "$CLASS" | dmenu -l 16)"
wpctl set-default "$id"
kill -34 "$(cat "$XDG_RUNTIME_DIR/sbar/pid")"