diff --git a/ansible/roles/rust/defaults/main.yaml b/ansible/roles/rust/defaults/main.yaml index 30cc1e4..abcb9c8 100644 --- a/ansible/roles/rust/defaults/main.yaml +++ b/ansible/roles/rust/defaults/main.yaml @@ -1 +1,2 @@ -rust_date: "2022-10-14" +# Check that rust-analyzer is valid for date on https://rust-lang.github.io/rustup-components-history/ +rust_date: "2023-03-18" diff --git a/ansible/roles/waybar/files/waybar_scripts/waybar_battery_freebsd.bash b/ansible/roles/waybar/files/waybar_scripts/waybar_battery_freebsd.bash index 95debcf..0b596c0 100644 --- a/ansible/roles/waybar/files/waybar_scripts/waybar_battery_freebsd.bash +++ b/ansible/roles/waybar/files/waybar_scripts/waybar_battery_freebsd.bash @@ -25,18 +25,24 @@ while true; do else battery_icon="⚡" fi - elif [ $battery_percentage -le 20 ]; then - battery_icon="○"# ⚠ - elif [ $battery_percentage -le 40 ]; then - battery_icon="◔" - elif [ $battery_percentage -le 60 ]; then - battery_icon="◑" - elif [ $battery_percentage -le 80 ]; then - battery_icon="◕" + elif [ $battery_percentage -le 12 ]; then + battery_icon="⚠" + elif [ $battery_percentage -le 25 ]; then + battery_icon="▁" + elif [ $battery_percentage -le 37 ]; then + battery_icon="▂" + elif [ $battery_percentage -le 50 ]; then + battery_icon="▃" + elif [ $battery_percentage -le 62 ]; then + battery_icon="▄" + elif [ $battery_percentage -le 75 ]; then + battery_icon="▅" + elif [ $battery_percentage -le 87 ]; then + battery_icon="▆" elif [ $battery_percentage -lt 100 ]; then - battery_icon="●" + battery_icon="▇" else - battery_icon="●"# █▇▆▅▄▃▂▁ ⚠ ▕▅▏ + battery_icon="█" fi if [ $battery_percentage -le 15 ]; then diff --git a/ansible/roles/waybar/files/waybar_scripts/waybar_battery_linux.bash b/ansible/roles/waybar/files/waybar_scripts/waybar_battery_linux.bash index ed8b760..1aa5a64 100644 --- a/ansible/roles/waybar/files/waybar_scripts/waybar_battery_linux.bash +++ b/ansible/roles/waybar/files/waybar_scripts/waybar_battery_linux.bash @@ -13,33 +13,45 @@ function generate_battery_update { local battery_state=$(grep 'state:' <<<"$battery_status" | awk '{print $2}') local battery_percentage=$(grep 'percentage:' <<<"$battery_status" | awk '{print $2}') battery_percentage=${battery_percentage%\%} + set +e local time_remaining=$(grep 'time to empty:' <<<"$battery_status" | sed 's/\W*time to empty:\W*//g') local tooltip="$time_remaining until empty" if [ -z "$time_remaining" ]; then time_remaining=$(grep 'time to full:' <<<"$battery_status" | sed 's/\W*time to full:\W*//g') - tooltip="$time_remaining until full" + if [ -z "$time_remaining" ]; then + tooltip="fully charged" + else + tooltip="$time_remaining until full" + fi fi + set -e local battery_icon="" local class="" if [ $battery_state = "charging" ]; then if [ $battery_percentage -eq 100 ]; then - battery_icon="⚉" + battery_icon="⚡" else - battery_icon="⚇" + battery_icon="⚡" fi - elif [ $battery_percentage -le 20 ]; then - battery_icon="⚋" - elif [ $battery_percentage -le 40 ]; then - battery_icon="⚊" - elif [ $battery_percentage -le 60 ]; then - battery_icon="⚍" - elif [ $battery_percentage -le 80 ]; then - battery_icon="⚌" + elif [ $battery_percentage -le 12 ]; then + battery_icon="⚠" + elif [ $battery_percentage -le 25 ]; then + battery_icon="▁" + elif [ $battery_percentage -le 37 ]; then + battery_icon="▂" + elif [ $battery_percentage -le 50 ]; then + battery_icon="▃" + elif [ $battery_percentage -le 62 ]; then + battery_icon="▄" + elif [ $battery_percentage -le 75 ]; then + battery_icon="▅" + elif [ $battery_percentage -le 87 ]; then + battery_icon="▆" elif [ $battery_percentage -lt 100 ]; then - battery_icon="☱" + battery_icon="▇" else - battery_icon="☰" + battery_icon="█" fi if [ $battery_percentage -le 15 ]; then