Finalize verified 2720 Flip release source and untrack image outputs
This commit is contained in:
1 parent
2a3078e42c
commit
1c011b360a
121 files changed
+8467
-686
No files matched your search
@@ -69,8 +69,30 @@ rm -f "$XDG_RUNTIME_DIR/sxmo.led.lock" "$XDG_RUNTIME_DIR"/sxmo_bat_state_* 2>/de
|
||||
# of idle blanking, or /etc/bananarchy-no-deep-standby to opt out of suspend.
|
||||
rm -f "$XDG_CACHE_HOME/sxmo/sxmo.nosuspend"
|
||||
[ -n "${DBUS_SESSION_BUS_ADDRESS:-}" ] && printf "%s\n" "$DBUS_SESSION_BUS_ADDRESS" > "$XDG_RUNTIME_DIR/dbus.bus"
|
||||
printf "1\n" > /tmp/bananarchy_screen_locked
|
||||
printf "lock\n" > "$XDG_RUNTIME_DIR/sxmo.state"
|
||||
# A flip phone that boots open must start unlocked with a live keypad. The
|
||||
# root lid daemon publishes the debounced hall state before tinydm starts;
|
||||
# default to open if that file is unavailable so X never stalls on xlocker.
|
||||
_lid_state="open"
|
||||
if [ "$(cat /usr/share/bananarchy/lid-profile 2>/dev/null)" = "flip" ]; then
|
||||
_lid_wait=0
|
||||
while [ "$_lid_wait" -lt 20 ] && [ ! -r /run/bananarchy/lid-state ]; do
|
||||
sleep 0.1
|
||||
_lid_wait=$((_lid_wait + 1))
|
||||
done
|
||||
if [ -r /run/bananarchy/lid-state ]; then
|
||||
read -r _lid_state < /run/bananarchy/lid-state 2>/dev/null || _lid_state="open"
|
||||
fi
|
||||
if [ "$_lid_state" = "closed" ]; then
|
||||
printf "1\n" > /tmp/bananarchy_screen_locked
|
||||
printf "screenoff\n" > "$SXMO_STATE"
|
||||
else
|
||||
rm -f /tmp/bananarchy_screen_locked
|
||||
printf "unlock\n" > "$SXMO_STATE"
|
||||
fi
|
||||
else
|
||||
printf "1\n" > /tmp/bananarchy_screen_locked
|
||||
printf "lock\n" > "$SXMO_STATE"
|
||||
fi
|
||||
|
||||
_init_bl=""
|
||||
if [ -r "$XDG_CONFIG_HOME/sxmo/brightness" ]; then
|
||||
@@ -93,6 +115,11 @@ elif [ -r /tmp/sxmo_saved_kbd_brightness ]; then
|
||||
fi
|
||||
printf "%s\n" "${_init_kbd:-255}" > /tmp/sxmo_saved_kbd_brightness
|
||||
printf "%s\n" "${_init_kbd:-255}" > /sys/class/leds/white:kbd_backlight/brightness 2>/dev/null || true
|
||||
if [ "$_lid_state" = "closed" ]; then
|
||||
printf "0\n" > /sys/class/backlight/backlight/brightness 2>/dev/null || true
|
||||
printf "0\n" > /sys/class/leds/white:kbd_backlight/brightness 2>/dev/null || true
|
||||
printf "4\n" > /sys/class/backlight/backlight/bl_power 2>/dev/null || true
|
||||
fi
|
||||
|
||||
XORG_BIN="Xorg"
|
||||
[ -x /tmp/x11/usr/bin/Xorg ] && XORG_BIN="/tmp/x11/usr/bin/Xorg"
|
||||
@@ -124,6 +151,7 @@ else
|
||||
xset +dpms >/dev/null 2>&1 || true
|
||||
xset dpms 0 0 0 >/dev/null 2>&1 || true
|
||||
fi
|
||||
xset r rate 180 30 >/dev/null 2>&1 || true
|
||||
|
||||
SESSION_PID_FILE="/tmp/bananarchy-x11-session.pid"
|
||||
printf "%s\n" "$$" > "$SESSION_PID_FILE"
|
||||
@@ -140,6 +168,36 @@ if [ -f /tmp/bananarchy_ext_logging ]; then
|
||||
else
|
||||
( sxmo_hook_start.sh >/dev/null 2>&1 </dev/null & )
|
||||
fi
|
||||
if [ "$(cat /usr/share/bananarchy/lid-profile 2>/dev/null)" = "flip" ] && \
|
||||
[ "$_lid_state" != "closed" ]; then
|
||||
# Some Sxmo start hooks still map xlocker from a transient boot lock file.
|
||||
# Keep the first 10 s of an open-lid boot unlocked, then stop interfering.
|
||||
(
|
||||
i=0
|
||||
while [ "$i" -lt 20 ]; do
|
||||
[ "$(cat /run/bananarchy/lid-state 2>/dev/null)" = "closed" ] && break
|
||||
rm -f /tmp/bananarchy_screen_locked
|
||||
printf "unlock\n" > "$SXMO_STATE"
|
||||
if [ -p /tmp/dwm_plugin_locker.fifo ]; then
|
||||
printf "CLOSE\n" > /tmp/dwm_plugin_locker.fifo 2>/dev/null || true
|
||||
fi
|
||||
sleep 0.5
|
||||
i=$((i + 1))
|
||||
done
|
||||
) &
|
||||
fi
|
||||
|
||||
# A cold boot can leave the resident dmenu or xlocker plugin holding an X
|
||||
# keyboard grab before the user sees the desktop. Release both once after
|
||||
# dwm has started; do not keep a background poller alive.
|
||||
(
|
||||
sleep 3
|
||||
/usr/bin/dwm-plugin dmenu close >/dev/null 2>&1 || true
|
||||
if [ -p /tmp/dwm_plugin_locker.fifo ]; then
|
||||
printf "CLOSE\n" > /tmp/dwm_plugin_locker.fifo 2>/dev/null || true
|
||||
fi
|
||||
xdotool key --clearmodifiers Escape >/dev/null 2>&1 || true
|
||||
) &
|
||||
|
||||
first_iter=1
|
||||
while [ "$(cat "$SESSION_PID_FILE" 2>/dev/null)" = "$$" ]; do
|
||||
|
||||
Reference in new issue
Block a user