Preconfigure Abjects IRC, refresh status bar charge icon and clock, update live device
- Ship ~/.config/sxmo/irc_servers.tsv (home and /etc/skel) with Abjects (irc.abjects.net, TLS port 6697) auto-joining #bananarchy, and change the compiled irc.so defaults to the same network; rebuild and mirror irc.so. - Republish the charge icon together with a fresh clock on battery events, force the icon on state_change and forced battery refreshes, and add a lightweight refresh action called after an NTP clock step. - Update the connected phone: sync network time, apk update plus apk upgrade -a, deploy the overlay and restart xirc; verify the status bar clock and charge icon; rebuild the a1108 / dejavu image. - Guard the new IRC and status bar paths in check-rebuild.sh and sync README, MANUAL, AGENTS and the a1108 changelog.
This commit is contained in:
1 parent
8448b6465f
commit
fb091749f0
13 files changed
+139
-11
No files matched your search
@@ -0,0 +1 @@
|
||||
Abjects irc.abjects.net 6697 1 bananarchy bananarchy Bananarchy Linux User #bananarchy 1
|
||||
|
@@ -0,0 +1 @@
|
||||
Abjects irc.abjects.net 6697 1 bananarchy bananarchy Bananarchy Linux User #bananarchy 1
|
||||
|
@@ -77,6 +77,18 @@ synced() {
|
||||
[ -n "$ref" ] && [ "$ref" != "00000000" ]
|
||||
}
|
||||
|
||||
refresh_statusbar() {
|
||||
# chronyd can step the clock by decades (e.g. from a 1970 RTC to network
|
||||
# time). Republish the status bar clock and charge icon as the X session
|
||||
# user so they do not stay stale until the next 300 s periodic tick.
|
||||
su user -s /bin/sh -c '
|
||||
HOME=/home/user DISPLAY=:0 XDG_RUNTIME_DIR=/run/user/10000 \
|
||||
SXMO_WM=dwm SXMO_STATUS_NAME=default SXMO_STATE=/run/user/10000/sxmo.state \
|
||||
PATH=/usr/share/sxmo/default_hooks:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin \
|
||||
sxmo_hook_statusbar.sh refresh
|
||||
' >/dev/null 2>&1 || true
|
||||
}
|
||||
|
||||
# refresh re-resolves pool names asynchronously. Keep retrying while DNS is
|
||||
# still down; the boot caller allows a minute, later network events a few
|
||||
# seconds. No stamp is written on failure, so the next event can retry.
|
||||
@@ -137,6 +149,7 @@ sync_now() {
|
||||
i=0
|
||||
while [ "$i" -lt "$SYNC_WAIT" ]; do
|
||||
if synced; then
|
||||
refresh_statusbar
|
||||
printf 'Network time synced: %s\n' "$(date -u '+%Y-%m-%d %H:%M:%S UTC')"
|
||||
return 0
|
||||
fi
|
||||
@@ -149,10 +162,10 @@ sync_now() {
|
||||
|
||||
case "${1:-status}" in
|
||||
boot|network-up)
|
||||
trigger "$1"
|
||||
trigger "$1" && refresh_statusbar
|
||||
;;
|
||||
force)
|
||||
trigger force
|
||||
trigger force && refresh_statusbar
|
||||
;;
|
||||
sync)
|
||||
sync_now
|
||||
|
||||
Binary file not shown.
@@ -134,6 +134,13 @@ if [ "$(id -u)" = "0" ]; then
|
||||
chown 10000:10000 "$CACHE_FILE" "$SET_LED_PATH" "${XDG_RUNTIME_DIR:-/run/user/10000}/sxmo.led.lock" 2>/dev/null || true
|
||||
fi
|
||||
|
||||
# A forced refresh (unlock, state change, post-sync) must republish the
|
||||
# charge icon even when its value is unchanged: sxmo_status.sh skips
|
||||
# unchanged values, which would otherwise leave a stale icon on the bar.
|
||||
if [ "$FORCE_UPDATE" = "1" ]; then
|
||||
rm -f "$ICON_FILE" 2>/dev/null || true
|
||||
fi
|
||||
|
||||
sxmo_hook_statusbar.sh battery "$name" "$state" "$percentage"
|
||||
if [ "$(id -u)" = "0" ]; then
|
||||
chown -R 10000:10000 "${XDG_RUNTIME_DIR:-/run/user/10000}/sxmo_status" 2>/dev/null || true
|
||||
|
||||
@@ -511,6 +511,11 @@ case "$1" in
|
||||
battery)
|
||||
shift
|
||||
set_battery "$@"
|
||||
# A charger/capacity event must republish both the charge icon and the
|
||||
# clock: sxmo_status.sh skips unchanged values, so force the root-name
|
||||
# refresh instead of relying on the file comparison alone.
|
||||
set_time
|
||||
force_bar=1
|
||||
;;
|
||||
time)
|
||||
is_screen_dark && exit 0
|
||||
@@ -530,15 +535,26 @@ case "$1" in
|
||||
# display-on; dmenu reads these files directly after unlock.
|
||||
set_time
|
||||
force_bar=1
|
||||
# Refresh the charge icon unconditionally: the unlock hook can race ahead
|
||||
# of the backlight, so is_screen_dark() may still report a dark panel
|
||||
# while the statusbar is already being republished.
|
||||
sxmo_hook_battery.sh force 2>/dev/null || true
|
||||
if ! is_screen_dark; then
|
||||
set_inputmethod
|
||||
if [ -z "$SXMO_NO_MODEM" ]; then
|
||||
set_modem
|
||||
fi
|
||||
set_network wifi wlan0
|
||||
sxmo_hook_battery.sh force 2>/dev/null || true
|
||||
fi
|
||||
;;
|
||||
refresh)
|
||||
# Lightweight post-sync refresh: after chronyd steps the clock (e.g.
|
||||
# from a 1970 RTC to network time), republish the clock and charge icon
|
||||
# without the modem/NetworkManager queries of state_change.
|
||||
set_time
|
||||
force_bar=1
|
||||
sxmo_hook_battery.sh force 2>/dev/null || true
|
||||
;;
|
||||
periodics) # 300 s loop (U3): no QMI/D-Bus polls on every tick
|
||||
if is_screen_dark || [ -f /tmp/bananarchy_screen_locked ]; then
|
||||
exit 0
|
||||
|
||||
Reference in new issue
Block a user