Misc changes

This commit is contained in:
2021-08-02 00:27:54 -06:00
parent 2de9e2388e
commit f0458e61b5
9 changed files with 59 additions and 17 deletions

View File

@@ -1,3 +0,0 @@
#!/usr/bin/env zsh
volnoti-show $(sudo macbook_brightness.py -c "$@" -p)

View File

@@ -1,8 +1,8 @@
#!/usr/bin/env zsh
#!/usr/bin/env sh
dbus-send --session \
dbus-send --session \
--dest=$1 \
--type=method_call \
--print-reply \
$2 \
--type=method_call \
--print-reply \
$2 \
org.freedesktop.DBus.Introspectable.Introspect | tail -n +2 | sed -e "s/^ *string//"

View File

@@ -1,4 +1,3 @@
#!/usr/bin/env zsh
#!/usr/bin/env sh
get_sink_input_info.hs | jq 'select(.application_process_id == "'"$thePID"'")'

View File

@@ -1,3 +1,3 @@
#!/usr/bin/env sh
XDG_CURRENT_DESKTOP='Unity' $@
XDG_CURRENT_DESKTOP='Unity' "$@"

View File

@@ -270,3 +270,29 @@ function all_after_char {
echo ${line##*$1}
done;
}
function pasink {
pacmd stat | awk -F": " '/^Default sink name: /{print $2}'
}
function pavolume {
pacmd list-sinks |
awk '/^\s+name: /{indefault = $2 == "<'"$(pasink)"'>"}
/^\s+volume: / && indefault {print $5; exit}' | grep -Eo "[0-9]*"
}
function paismuted {
pactl list sinks | grep "$(pasink)" -A 10 | grep Mute | grep -q yes
}
function pashowvolume {
if paismuted; then
volnoti-show -m
else
volnoti-show "$(min $(pavolume) 100)"
fi
}
function pashowinputbypid {
get_sink_input_info.hs | jq 'select(.application_process_id == "'"$1"'")'
}