From 7d9ba2beb53e35d4e05eb70b77bfd7ed23eb1ed5 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Mon, 26 Jan 2026 18:05:51 -0600 Subject: chore(dwm): remove 17 unused X11 scripts Keep only scripts actually used or useful for DWM: - airplanemodetoggle - toggle WiFi/Bluetooth - brightness - backlight control (bound to XF86 keys) - colorpick - X11 color picker - dmenuexitmenu - logout/shutdown menu (Mod+Shift+Q) - dmenuunicode - emoji picker - screenshotmenu - screenshot tool - toggle-touchpad - touchpad toggle (Mod+F9) - wallsearch - wallpaper search/download Removed scripts not referenced in DWM config.def.h or sxhkdrc: audioselect, battery_monitor, bookfind, displayselect, dmenuhandler, dmenumount, dmenumountcifs, dmenurecord, dmenuumount, exitmenu, monitor, prompt, recordnow, remaps, samedir, setbg, td-toggle Co-Authored-By: Claude Opus 4.5 --- dotfiles/dwm/.local/bin/battery_monitor | 52 --------------------------------- 1 file changed, 52 deletions(-) delete mode 100755 dotfiles/dwm/.local/bin/battery_monitor (limited to 'dotfiles/dwm/.local/bin/battery_monitor') diff --git a/dotfiles/dwm/.local/bin/battery_monitor b/dotfiles/dwm/.local/bin/battery_monitor deleted file mode 100755 index dc8d5ea..0000000 --- a/dotfiles/dwm/.local/bin/battery_monitor +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env bash -# battery_monitor -# Intended to be run via .xinitrc -# - Exit automatically if no battery (desktop) -# - When below 15%, warn user of low battery -# - When below 10%, suspend within 10 seconds if not charging -# -# Craig Jennings - -# check if acpi is installed -if ! command -v acpi &> /dev/null; then - echo "acpi is not installed. Cannot continue. Exiting...." - exit 1 -fi - -# exit if a battery exists -if [ ! -d "/sys/class/power_supply/BAT0" ] && [ ! -d "/sys/class/power_supply/BAT1" ]; then - echo "Acpi is installed but no battery detected. Assuming this is a desktop and exiting...." - exit 1 -fi - -while true; do - # Get the current battery percentage using acpi - battery_percentage=$(acpi -b | awk -F ', ' '{print $2}' | tr -d '%') - # battery_percentage=$(acpi -b | awk -F ', ' '{print $2}' | sed 's/%//') - - # When below 10%, suspend within 10 seconds if not charging - if [ "$battery_percentage" -lt 11 ] && ! acpi -a | grep -q "on-line" ; then - # Send a notification of sleeping in 10 seconds - notify-send -u critical "Critical Battery" "Battery is at $battery_percentage%. System entering sleep in 30 seconds." - - # sleep for 10 seconds, then abort if charging - sleep 30 - - # Check if the system is charging (AC adapter connected) - if acpi -a | grep -q "on-line"; then - notify-send "Charging" "The system is now charging. No action taken." - else - notify-send -u critical "Critical Battery" "Putting the system to sleep." - sudo systemctl suspend - fi - fi - - # When below 15%, warn user - if [ "$battery_percentage" -lt 15 ] && ! acpi -a | grep -q "on-line" ; then - # Send a notification using notify-send and dunst - notify-send -u critical "Low Battery" "Battery is at $battery_percentage%. System will automatically sleep at 10%." - fi - - # Sleep for 5 minutes before checking again - sleep 300 -done -- cgit v1.2.3