fix audio; add reverse color support
This commit is contained in:
parent
fcfd1eb70c
commit
1a59351a87
9
config
9
config
@ -9,10 +9,8 @@ interval=5
|
|||||||
label=☼
|
label=☼
|
||||||
# label=☀,☼,✱,✲,✳,✴,✵,✺
|
# label=☀,☼,✱,✲,✳,✴,✵,✺
|
||||||
signal=3
|
signal=3
|
||||||
# instance=color
|
|
||||||
|
|
||||||
# [iface]
|
# [iface]
|
||||||
# label=iface
|
|
||||||
|
|
||||||
# [storage]
|
# [storage]
|
||||||
# label=⛁
|
# label=⛁
|
||||||
@ -36,7 +34,6 @@ label=ϑ
|
|||||||
interval=2
|
interval=2
|
||||||
|
|
||||||
[ip]
|
[ip]
|
||||||
# label=ip
|
|
||||||
label=⎋
|
label=⎋
|
||||||
interval=once
|
interval=once
|
||||||
|
|
||||||
@ -45,18 +42,16 @@ interval=once
|
|||||||
# /sys/class/power_supply/BATx you can use the instance=x command
|
# /sys/class/power_supply/BATx you can use the instance=x command
|
||||||
[battery]
|
[battery]
|
||||||
label=~
|
label=~
|
||||||
# label=battery
|
# label=⟠, ⟰, ⟱, ⟲, ⟳, ⤋, ⤊,⎋,⚡,⌨,⌨
|
||||||
# ⟠, ⟰, ⟱, ⟲, ⟳, ⤋, ⤊,⎋,⚡,⌨,⌨
|
interval=60
|
||||||
# [battery]
|
# [battery]
|
||||||
# instance=1
|
# instance=1
|
||||||
interval=60
|
|
||||||
|
|
||||||
[audio]
|
[audio]
|
||||||
label=◍
|
label=◍
|
||||||
# label=♩,♪,♫,♬
|
# label=♩,♪,♫,♬
|
||||||
signal=1
|
signal=1
|
||||||
interval=once
|
interval=once
|
||||||
# instance=color
|
|
||||||
# separator_block_width=0
|
# separator_block_width=0
|
||||||
[audio]
|
[audio]
|
||||||
label=◎
|
label=◎
|
||||||
|
@ -32,7 +32,7 @@ else
|
|||||||
[[ -f "$COLORS" ]] && COLORS=true || COLORS=false
|
[[ -f "$COLORS" ]] && COLORS=true || COLORS=false
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# get $LOAD, $LONG_TEXT and $SHORT_TEXT
|
# get $LOAD, $LOAD_REVERSE, $LONG_TEXT and $SHORT_TEXT
|
||||||
source $HOME/.config/i3blocks/modules/${1}.sh
|
source $HOME/.config/i3blocks/modules/${1}.sh
|
||||||
|
|
||||||
# print text
|
# print text
|
||||||
@ -53,8 +53,17 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# print colors or black/white
|
# print colors or black/white
|
||||||
|
if [[ "$LOAD" = false ]]; then
|
||||||
|
echo "${BW[4]}"
|
||||||
|
else
|
||||||
for i in "${!BW[@]}"; do
|
for i in "${!BW[@]}"; do
|
||||||
if [[ $LOAD -lt $((($i+1) * $INTERVAL)) ]]; then
|
if [[ $LOAD -lt $((($i+1) * $INTERVAL)) ]]; then
|
||||||
|
if [[ "$REVERSE_COLOR" = true ]]; then
|
||||||
|
u=$((${#BW[@]}-$i))
|
||||||
|
[[ "$COLORS" = true ]] && echo "${COLOR[$u]}" || echo "${BW[$u]}"
|
||||||
|
else
|
||||||
[[ "$COLORS" = true ]] && echo "${COLOR[$i]}" || echo "${BW[$i]}"
|
[[ "$COLORS" = true ]] && echo "${COLOR[$i]}" || echo "${BW[$i]}"
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
fi
|
||||||
|
@ -18,5 +18,6 @@ while read -r LINE; do
|
|||||||
done <<< $(cat $BATS)
|
done <<< $(cat $BATS)
|
||||||
|
|
||||||
LOAD=$((${ENERGY_NOW} * 100 / ${ENERGY_FULL}))
|
LOAD=$((${ENERGY_NOW} * 100 / ${ENERGY_FULL}))
|
||||||
|
REVERSE_COLOR=true
|
||||||
LONG_TEXT="$STATUS$LOAD%"
|
LONG_TEXT="$STATUS$LOAD%"
|
||||||
SHORT_TEXT="$STATUS$LOAD"
|
SHORT_TEXT="$STATUS$LOAD"
|
||||||
|
Reference in New Issue
Block a user