From fd95dd8b8f72aa646bd505c504eba8c34dbc0097 Mon Sep 17 00:00:00 2001 From: Florian RICHER Date: Sat, 7 May 2022 00:08:56 +0200 Subject: [PATCH] Update dot_config/polybar/scripts/executable_polybar_bluetooth_speaker.sh Update dot_config/polybar/scripts/executable_polybar_custom_time.sh Update dot_config/polybar/scripts/executable_polybar_dunst_indicator.sh Update dot_config/polybar/scripts/executable_polybar_healthbar.sh Update dot_config/polybar/scripts/executable_polybar_net_indicator.sh Update dot_config/polybar/scripts/executable_polybar_net_speed.sh Update dot_config/polybar/scripts/executable_polybar_redshift_indicator.sh Update dot_config/polybar/scripts/executable_polybar_wifibar.sh --- .../scripts/executable_polybar_bluetooth_speaker.sh | 2 +- .../polybar/scripts/executable_polybar_custom_time.sh | 2 +- .../scripts/executable_polybar_dunst_indicator.sh | 4 ++-- .../polybar/scripts/executable_polybar_healthbar.sh | 9 +++++++-- .../polybar/scripts/executable_polybar_net_indicator.sh | 2 +- .../polybar/scripts/executable_polybar_net_speed.sh | 2 +- .../scripts/executable_polybar_redshift_indicator.sh | 2 +- dot_config/polybar/scripts/executable_polybar_wifibar.sh | 2 +- 8 files changed, 15 insertions(+), 10 deletions(-) diff --git a/dot_config/polybar/scripts/executable_polybar_bluetooth_speaker.sh b/dot_config/polybar/scripts/executable_polybar_bluetooth_speaker.sh index 3cc2943..21a3d44 100644 --- a/dot_config/polybar/scripts/executable_polybar_bluetooth_speaker.sh +++ b/dot_config/polybar/scripts/executable_polybar_bluetooth_speaker.sh @@ -7,7 +7,7 @@ # Author: machaerus # https://gitlab.com/machaerus -source colors.sh +source ~/.config/polybar/scripts/colors.sh bluetooth_speaker() { BT_DEVICE="1C:E6:1D:EF:0A:76" diff --git a/dot_config/polybar/scripts/executable_polybar_custom_time.sh b/dot_config/polybar/scripts/executable_polybar_custom_time.sh index 6986a2d..ba418d8 100644 --- a/dot_config/polybar/scripts/executable_polybar_custom_time.sh +++ b/dot_config/polybar/scripts/executable_polybar_custom_time.sh @@ -5,7 +5,7 @@ # Author: machaerus # https://gitlab.com/machaerus -source colors.sh +source ~/.config/polybar/scripts/colors.sh custom_time() { WEEKDAY=$(date +%A) diff --git a/dot_config/polybar/scripts/executable_polybar_dunst_indicator.sh b/dot_config/polybar/scripts/executable_polybar_dunst_indicator.sh index aee6b56..1bec290 100644 --- a/dot_config/polybar/scripts/executable_polybar_dunst_indicator.sh +++ b/dot_config/polybar/scripts/executable_polybar_dunst_indicator.sh @@ -5,7 +5,7 @@ # Author: machaerus # https://gitlab.com/machaerus -source colors.sh +source ~/.config/polybar/scripts/colors.sh dunst_notifications() { dunst_enabled=$(dunstctl is-paused) @@ -16,4 +16,4 @@ dunst_notifications() { fi echo $dunst_indicator } -dunst_notifications \ No newline at end of file +dunst_notifications diff --git a/dot_config/polybar/scripts/executable_polybar_healthbar.sh b/dot_config/polybar/scripts/executable_polybar_healthbar.sh index aaad7db..f26381b 100644 --- a/dot_config/polybar/scripts/executable_polybar_healthbar.sh +++ b/dot_config/polybar/scripts/executable_polybar_healthbar.sh @@ -12,7 +12,7 @@ # Original idea for calculating the battery % is not mine, unfortunately # I don't remember the source. -source colors.sh +source ~/.config/polybar/scripts/colors.sh healthbar_print() { @@ -50,6 +50,11 @@ healthbar_print() { battery_max=$(("$battery_max_0 + $battery_max_1")) battery_percent=$(("$battery_level * 100")) + + if [ "$battery_max" -eq "0" ]; then + exit 0 + fi + battery_percent=$(("$battery_percent / $battery_max")) # notify-send "Battery below 90%" @@ -101,4 +106,4 @@ healthbar_print() { fi } -healthbar_print \ No newline at end of file +healthbar_print diff --git a/dot_config/polybar/scripts/executable_polybar_net_indicator.sh b/dot_config/polybar/scripts/executable_polybar_net_indicator.sh index fbd3155..898d19d 100644 --- a/dot_config/polybar/scripts/executable_polybar_net_indicator.sh +++ b/dot_config/polybar/scripts/executable_polybar_net_indicator.sh @@ -6,7 +6,7 @@ # Author: machaerus # https://gitlab.com/machaerus -source colors.sh +source ~/.config/polybar/scripts/colors.sh net_print() { diff --git a/dot_config/polybar/scripts/executable_polybar_net_speed.sh b/dot_config/polybar/scripts/executable_polybar_net_speed.sh index b94bd0e..f0191cf 100644 --- a/dot_config/polybar/scripts/executable_polybar_net_speed.sh +++ b/dot_config/polybar/scripts/executable_polybar_net_speed.sh @@ -5,7 +5,7 @@ # Author: machaerus # https://gitlab.com/machaerus -source colors.sh +source ~/.config/polybar/scripts/colors.sh net_speed() { UP_NETSPEED=$(awk '{if(l1){printf "%6.1f", ($10-l2)/1024} else{l1=$2; l2=$10;}}' <(grep wlan0 /proc/net/dev) <(sleep 1; grep wlan0 /proc/net/dev)) diff --git a/dot_config/polybar/scripts/executable_polybar_redshift_indicator.sh b/dot_config/polybar/scripts/executable_polybar_redshift_indicator.sh index 5fd5e70..5ac401b 100644 --- a/dot_config/polybar/scripts/executable_polybar_redshift_indicator.sh +++ b/dot_config/polybar/scripts/executable_polybar_redshift_indicator.sh @@ -6,7 +6,7 @@ # Author: machaerus # https://gitlab.com/machaerus -source colors.sh +source ~/.config/polybar/scripts/colors.sh dunst_notifications() { dunst_enabled=$(dunstctl is-paused) diff --git a/dot_config/polybar/scripts/executable_polybar_wifibar.sh b/dot_config/polybar/scripts/executable_polybar_wifibar.sh index bbcddfc..45c576b 100644 --- a/dot_config/polybar/scripts/executable_polybar_wifibar.sh +++ b/dot_config/polybar/scripts/executable_polybar_wifibar.sh @@ -5,7 +5,7 @@ # Author: machaerus # https://gitlab.com/machaerus -source colors.sh +source ~/.config/polybar/scripts/colors.sh manabar_print() { ESSID=$(iwconfig wlan0 | grep ESSID | cut -d: -f2 | xargs)