Merge pull request #3 from GabubuAvailable/master

modified module_vol and added module_mic
This commit is contained in:
Emily Daemon 2022-04-12 19:59:27 +03:00 committed by GitHub
commit ac36dadf63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 2 deletions

View File

@ -32,3 +32,4 @@ precmd() {
export CSI=$'\e'"["
export PROMPT="${CSI}s${CSI}1;$((LINES-1))r${CSI}$LINES;1f%S%1v%s${CSI}K${CSI}u${PROMPT}"
```

View File

@ -18,7 +18,7 @@ export maildir=""
#module_uptime "Up: " " | "
#module_ram "RAM: " " | "
#module_user "User: " " | "
#module_alsa "Vol: " " | "
#module_vol "Vol: " "% | "
#module_kernel "Kernel: " " | "
#module_loadavg "Load Avg.: " " | "
#module_weather "Weather: " " | "

View File

@ -22,10 +22,18 @@ module_user() {
export bar="${bar}${1}$(whoami)@$(cat /proc/sys/kernel/hostname)${2}"
}
module_alsa() {
module_vol_pa() {
export bar="${bar}${1}$(pamixer --get-volume)${2}"
}
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}"
}
module_kernel() {
export bar="${bar}${1}$(sed "s/version // ; s/ (.*//" /proc/version)${2}"
}