feat: optimized sbar, gammastep asia, wpdef
This commit is contained in:
parent
f48e958d44
commit
395119a0fe
19 changed files with 159 additions and 157 deletions
32
.local/bin/wpdef
Executable file
32
.local/bin/wpdef
Executable 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")"
|
Loading…
Add table
Add a link
Reference in a new issue