Remove unnecessary background services and polling loops to improve battery life

This commit is contained in:
Luxferre committed 2026-10-27 08:08:05 +02:00
1 parent 726500085a
commit 68cf9c515b
17 files changed
+159 -22

No files matched your search

@@ -0,0 +1,4 @@
[D-BUS Service]
Name=org.freedesktop.UPower
Exec=/bin/false
User=root
@@ -46,12 +46,7 @@ if [ -n "$sysfs_dir" ] && [ -r "$sysfs_dir/capacity" ] && [ -r "$sysfs_dir/statu
*) state="unknown" ;;
esac
else
data="$(upower -i "$object" | grep . | sed -e 's|^ \+||' -e 's|: \+|:|')"
type="$(printf "%b" "$data" | grep -m1 -v : | sed -e 's|^ \+||')"
[ "$type" = "battery" ] || exit 0
name="$(printf "%b" "$data" | grep "^native-path:" | cut -d: -f2)"
state="$(printf "%b" "$data" | grep "^state:" | cut -d: -f2)"
percentage="$(printf "%b" "$data" | grep "^percentage:" | cut -d: -f2 | cut -d% -f1)"
exit 0
fi
if [ -z "$name" ] || [ -z "$state" ] || [ -z "$percentage" ] || [ "$state" = "unknown" ]; then
@@ -76,7 +76,6 @@ superctl start dunst
# load X11 dwm services
[ "$(command -v sxmo_xob)" ] && superctl start sxmo_xob
pidof -s sxmo_status_xsetroot.sh >/dev/null 2>&1 || superctl start sxmo-x11-status
[ "$(command -v bonsaid)" ] && superctl start bonsaid
if [ "$(command -v fcitx5)" ]; then
superctl start fcitx5
@@ -109,9 +108,6 @@ fi
# Start the desktop widget (e.g. clock)
pidof -s conky >/dev/null 2>&1 || DISPLAY=:0 CONKY_DPY=:0 conky -c /home/user/.config/sxmo/conky.conf -d >/dev/null 2>&1 </dev/null || true
# Monitor the battery
superctl start sxmo_battery_monitor
# It watch network changes and update the status bar icon by example
superctl start sxmo_networkmonitor
@@ -520,6 +520,7 @@ case "$1" in
set_state
set_time
set_inputmethod
sxmo_hook_battery.sh 2>/dev/null || true
;;
periodics) # 55 s loop
set_time