diff --git a/ansible/roles/base/files/cleanup_temporary_files b/ansible/roles/base/files/cleanup_temporary_files index dd30936..71827a4 100644 --- a/ansible/roles/base/files/cleanup_temporary_files +++ b/ansible/roles/base/files/cleanup_temporary_files @@ -1,4 +1,4 @@ #!/usr/bin/env bash # # Delete temporary files on entire disk -find / -type f -name '*.orig' -delete -or -name '*~' -delete +find / -type f -name '*.orig' -delete -or -name '*~' -delete -print diff --git a/ansible/roles/sway/files/style.css b/ansible/roles/sway/files/style.css index 08510bf..1da6e35 100644 --- a/ansible/roles/sway/files/style.css +++ b/ansible/roles/sway/files/style.css @@ -50,6 +50,7 @@ #battery, #clock, #cpu, +#custom-available_memory, #custom-battery, #custom-clock, #idle_inhibitor, diff --git a/ansible/roles/sway/files/waybar_available_memory_freebsd b/ansible/roles/sway/files/waybar_available_memory_freebsd new file mode 100644 index 0000000..482ac06 --- /dev/null +++ b/ansible/roles/sway/files/waybar_available_memory_freebsd @@ -0,0 +1,32 @@ +#!/usr/bin/env bash +# +# Read memory usage in FreeBSD +set -euo pipefail +IFS=$'\n\t' +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +SLEEP_INTERVAL=${SLEEP_INTERVAL:-30} + +while true; do + page_size=$(sysctl -n hw.pagesize) + free_pages=$(sysctl -n vm.stats.vm.v_free_count) + free_bytes=$((page_size * free_pages)) + total_pages=$(sysctl -n vm.stats.vm.v_page_count) + free_percent=$((100 * free_pages / total_pages)) + text="" + + if [ $free_bytes > $((1024 * 1024 * 1024)) ]; then + text="$((free_bytes / 1024 / 1024 / 1024)) GiB" + fi + + tooltip="${free_percent}%" + + jq --unbuffered --compact-output <