refractor plus additional click and long string functions
This commit is contained in:
parent
4b9d064b32
commit
492abcf744
@ -4,8 +4,7 @@
|
||||
|
||||
[[ "$BLOCK_BUTTON" == 1 ]] && LONG=true
|
||||
|
||||
|
||||
[[ "$BLOCK_BUTTON" == 2 ]] && amixer set $DEV toggle &> /dev/null
|
||||
[[ "$BLOCK_BUTTON" == 3 ]] && amixer set $DEV toggle &> /dev/null
|
||||
|
||||
amixer get $DEV | gawk -v LONG="$LONG" '
|
||||
match($0, /\[([0-9]+)\%\] \[(on|off)\]/, matches) {
|
||||
|
@ -22,6 +22,7 @@ cat "$DIR/brightness" "$DIR/max_brightness" | gawk -v MODE="$MODE" -v LONG="$LON
|
||||
load = ( cbr / mbr ) * 100
|
||||
if (LONG == "true") {
|
||||
printf("%d%\n", load)
|
||||
printf("%d%\n", load)
|
||||
} else {
|
||||
if (load < 100 / 9) {
|
||||
printf("▁\n▁\n")
|
||||
|
@ -45,7 +45,7 @@ cat $BATS | gawk -F '=' -v LONG="$LONG" '
|
||||
printf("%s%d%\n", status, charge)
|
||||
} else {
|
||||
if (charge < 100 / 9) {
|
||||
printf("\n")
|
||||
printf("%s▁\n", status)
|
||||
} else if (charge < 100 / 9 * 2 ) {
|
||||
printf("%s▁\n", status)
|
||||
} else if (charge < 100 / 9 * 3 ) {
|
||||
|
@ -1,8 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
[[ "$BLOCK_INSTANCE" =~ "long" ]] && LONG=true
|
||||
[[ "$BLOCK_INSTANCE" =~ "long" || "$BLOCK_BUTTON" == 1 ]] && LONG=true
|
||||
|
||||
[[ "$BLOCK_BUTTON" == 1 ]] && i3-sensible-terminal -e htop
|
||||
[[ "$BLOCK_BUTTON" == 2 ]] && i3-sensible-terminal -e htop
|
||||
|
||||
top -bn1 | gawk -v LONG="$LONG" '
|
||||
/^\%CPU/ {
|
||||
|
@ -1,8 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
[[ "$BLOCK_BUTTON" == 1 ]] && i3-sensible-terminal -e htop
|
||||
[[ "$BLOCK_BUTTON" == 2 ]] && i3-sensible-terminal -e htop
|
||||
|
||||
[[ "$BLOCK_INSTANCE" =~ "long" ]] && LONG=true
|
||||
[[ "$BLOCK_INSTANCE" =~ "long" || "$BLOCK_BUTTON" == 1 ]] && LONG=true
|
||||
|
||||
if [[ "$BLOCK_INSTANCE" =~ "ram" ]]; then
|
||||
TYPE='swap'
|
||||
|
@ -1,10 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
df | gawk '
|
||||
|
||||
[[ "$BLOCK_BUTTON" == 1 ]] && LONG=true
|
||||
|
||||
[[ "$BLOCK_BUTTON" == 3 ]] && i3-sensible-terminal -e ranger
|
||||
|
||||
df | gawk -v LONG="$LONG" '
|
||||
/\/$/ {
|
||||
free_storage = $4 / 1024^2
|
||||
load = gensub(/^([0-9]{1,3})%$/, "\\1", "g", $5)
|
||||
}
|
||||
END {
|
||||
if (LONG == "true") {
|
||||
if (free_storage < 1) {
|
||||
printf(" full \n")
|
||||
printf("full\n")
|
||||
@ -16,6 +23,27 @@ df | gawk '
|
||||
printf("%.0f M\n", free_storage / 1024)
|
||||
printf("%dM\n", free_storage / 1024)
|
||||
}
|
||||
} else {
|
||||
if (load < 100 / 9) {
|
||||
printf("▁\n▁\n")
|
||||
} else if (load < 100 / 9 * 2 ) {
|
||||
printf("▁\n▁\n")
|
||||
} else if (load < 100 / 9 * 3 ) {
|
||||
printf("▂\n▂\n")
|
||||
} else if (load < 100 / 9 * 4 ) {
|
||||
printf("▃\n▃\n")
|
||||
} else if (load < 100 / 9 * 5 ) {
|
||||
printf("▄\n▄\n")
|
||||
} else if (load < 100 / 9 * 6 ) {
|
||||
printf("▅\n▅\n")
|
||||
} else if (load < 100 / 9 * 7 ) {
|
||||
printf("▆\n▆\n")
|
||||
} else if (load < 100 / 9 * 8 ) {
|
||||
printf("▇\n▇\n")
|
||||
} else {
|
||||
printf("█\n█\n")
|
||||
}
|
||||
}
|
||||
if (free_storage > 20) {
|
||||
print("#04B431\n")
|
||||
} else if (free_storage > 15) {
|
||||
|
Reference in New Issue
Block a user