Update modules.sh

This commit is contained in:
Gabubu 2022-04-12 16:44:05 +00:00 committed by GitHub
parent 1f70822e40
commit 2e4d1c6fbf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,11 +22,15 @@ module_user() {
export bar="${bar}${1}$(whoami)@$(cat /proc/sys/kernel/hostname)${2}" export bar="${bar}${1}$(whoami)@$(cat /proc/sys/kernel/hostname)${2}"
} }
module_vol() { module_vol_pa() {
export bar="${bar}${1}$(if command -v pamixer > NULL; then pamixer --get-volume; else amixer sget Master | awk -F'[][]' '/Mono:/ { print $2 }'; fi)${2}" export bar="${bar}${1}$(pamixer --get-volume)${2}"
} }
module_mic() { module_vol_alsa() {
export bar="${bar}${1}$(amixer sget Master | awk -F'[][]' '/Mono:/ { print $2 }')${2}"
}
module_mic_pa() {
export bar="${bar}${1}$(if pamixer --source 1 --get-mute | grep -q 'true'; then echo "OFF"; else echo "ON"; fi)${2}" export bar="${bar}${1}$(if pamixer --source 1 --get-mute | grep -q 'true'; then echo "OFF"; else echo "ON"; fi)${2}"
} }