feat(x11): migrate to pure Xlibre + dwm/dmenu/st stack, fix fcitx5-t9 bottom bar, PM8909 PON shutdown, and remove Wayland

This commit is contained in:
Luxferre
2026-10-20 21:15:16 +03:00
parent ad012360c3
commit 7bab7b7a11
422 changed files with 63226 additions and 2342 deletions
@@ -17,38 +17,51 @@ stop_proximity_lock() {
sxmo_jobs.sh stop proximity_lock
}
exec 0<<EOF
STATE_FILE="${SXMO_STATE:-$XDG_RUNTIME_DIR/sxmo.state}"
if [ -r "$STATE_FILE" ]; then
read -r CURRENT_STATE < "$STATE_FILE" || CURRENT_STATE=""
else
CURRENT_STATE="$(sxmo_state.sh get)"
fi
if [ "$CURRENT_STATE" != "unlock" ] && sxmo_state.sh is_locked; then
case "$ACTION" in
"powerbutton_one"|"powerbutton_two"|"powerbutton_three"|"menuleft_one"|"menuright_one"|"enter_one"|"enter_two"|"enter_three")
if [ -n "$WAYLAND_DISPLAY" ]; then
wlopm --on "*" >/dev/null 2>&1 || sxmo_wm.sh display on
else
sxmo_wm.sh display on
fi
if [ -w /sys/class/leds/white:kbd_backlight/brightness ]; then
printf '255' > /sys/class/leds/white:kbd_backlight/brightness 2>/dev/null || true
else
brightnessctl -d white:kbd_backlight set 255 >/dev/null 2>&1 || true
fi
sxmo_state.sh set unlock &
exit 0
;;
"voldown_one"|"volup_one")
exec 0<<EOF
$(sxmo_wm.sh focusedwindow -r)
EOF
read -r WMCLASS
read -r WMNAME
sxmo_debug "STATE: $(sxmo_state.sh get) ACTION: $ACTION WMCLASS: $WMCLASS WMNAME: $WMNAME"
if sxmo_state.sh is_locked; then
case "$WMNAME" in # Handle programs
*"epy"*|*"epr"*)
case "$ACTION" in
"voldown_one")
sxmo_type.sh l
exit 0
;;
"volup_one")
sxmo_type.sh h
read -r WMCLASS
read -r WMNAME
case "$WMNAME" in
*"epy"*|*"epr"*)
if [ "$ACTION" = "voldown_one" ]; then
sxmo_type.sh l
else
sxmo_type.sh h
fi
exit 0
;;
esac
;;
esac
case "$ACTION" in
"powerbutton_one"|"powerbutton_two"|"powerbutton_three"|"menuleft_one"|"menuright_one"|"enter_one"|"enter_two"|"enter_three")
brightnessctl -d white:kbd_backlight set 255 >/dev/null 2>&1 || true
sxmo_state.sh set unlock
sxmo_wm.sh display on
;;
"voldown_one")
sxmo_audio.sh vol down 5
exit
if [ "$ACTION" = "voldown_one" ]; then
sxmo_audio.sh vol down 5
else
sxmo_audio.sh vol up 5
fi
exit 0
;;
"voldown_two")
sxmo_audio.sh vol down 10
@@ -58,10 +71,6 @@ if sxmo_state.sh is_locked; then
sxmo_audio.sh vol down 15
exit
;;
"volup_one")
sxmo_audio.sh vol up 5
exit
;;
"volup_two")
sxmo_audio.sh vol up 10
exit
@@ -75,6 +84,31 @@ if sxmo_state.sh is_locked; then
exit 0
fi
case "$ACTION" in
"menuleft"*|"enter_two"|"enter_three"|"powerbutton_two"|"powerbutton_three"|"voldown_two"|"volup_two"|"volup_three"|"topleftcorner"|"toprightcorner"|"bottomrightcorner")
WMCLASS=""
WMNAME=""
;;
*)
if [ -r "$XDG_RUNTIME_DIR/sxmo.focusedwin" ]; then
{
read -r WMCLASS || WMCLASS=""
read -r WMNAME || WMNAME=""
} < "$XDG_RUNTIME_DIR/sxmo.focusedwin"
else
exec 0<<EOF
$(sxmo_wm.sh focusedwindow -r)
EOF
read -r WMCLASS
read -r WMNAME
fi
;;
esac
if [ -n "$SXMO_DEBUG" ]; then
sxmo_debug "STATE: $CURRENT_STATE ACTION: $ACTION WMCLASS: $WMCLASS WMNAME: $WMNAME"
fi
#special context-sensitive handling
case "$WMCLASS" in
*"mpv"*)
@@ -367,7 +401,7 @@ case "$ACTION" in
exit 0
;;
"enter_one")
if pidof -q sxmo_RepeatRing.sh; then
if pidof -s sxmo_RepeatRing.sh >/dev/null; then
sxmo_hook_pickup.sh
else
sxmo_appmenu.sh "$WMCLASS" "$WMNAME"
@@ -10,13 +10,18 @@
. sxmo_common.sh
# Create xdg user directories, such as ~/Pictures
xdg-user-dirs-update
[ -d "$HOME/Pictures" ] || xdg-user-dirs-update &
# Ensure fontconfig cache is valid without forcing a full rescan on every boot
if command -v fc-cache > /dev/null && [ -z "$(ls -A /var/cache/fontconfig 2>/dev/null)" ]; then
fc-cache >/dev/null 2>&1 &
fi
sxmo_jobs.sh start daemon_manager superd
# let time to superd to start correctly
while ! superctl status > /dev/null 2>&1; do
sleep 0.5
sleep 0.05
done
# Not dangerous if "locker" isn't an available state
@@ -54,48 +59,14 @@ superctl start dunst
# start adaptive brightness at boot
# superctl start sxmo_adaptivebrightness
# load some other little things here too.
case "$SXMO_WM" in
river)
superctl start sxmo_wob
[ "$(command -v bonsaid)" ] && superctl start bonsaid
[ "$(command -v fcitx5)" ] && superctl start fcitx5
superctl start sxmo_riverbar
;;
sway)
superctl start sxmo_wob
superctl start sxmo_menumode_toggler
[ "$(command -v bonsaid)" ] && superctl start bonsaid
[ "$(command -v fcitx5)" ] && superctl start fcitx5
;;
dwm|i3)
superctl start sxmo_xob
# Auto hide cursor with touchscreen, Show it with a mouse
if command -v "unclutter-xfixes" > /dev/null; then
set -- unclutter-xfixes
else
set -- unclutter
fi
superctl start "$1"
superctl start autocutsel
superctl start autocutsel-primary
superctl start sxmo-x11-status
[ "$(command -v bonsaid)" ] && superctl start bonsaid
[ "$(command -v fcitx5)" ] && superctl start fcitx5
[ -n "$SXMO_MONITOR" ] && xrandr --output "$SXMO_MONITOR" --primary
# Set onboard to auto-hide in config first
if [ "$KEYBOARD" = "onboard" ]; then
onboard "$KEYBOARD_ARGS"
fi
case "$SXMO_WM" in
i3)
xbindkeys -f "$XDG_CONFIG_HOME/sxmo/xbindkeysrc_$SXMO_BINDING_PROVIDER"
;;
esac
;;
esac
# 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 ! pidof -s fcitx5 >/dev/null 2>&1 && [ "$(command -v fcitx5)" ]; then
superctl start fcitx5
fi
[ -n "$SXMO_MONITOR" ] && xrandr --output "$SXMO_MONITOR" --primary
# Turn on auto-suspend
if sxmo_wakelock.sh isenabled; then
@@ -106,8 +77,8 @@ fi
# To setup initial unlock state
sxmo_state.sh set unlock
# Turn on lisgd
if [ ! -e "$XDG_CACHE_HOME"/sxmo/sxmo.nogesture ]; then
# Turn on lisgd only on touch devices
if [ -z "$SXMO_NO_VIRTUAL_KEYBOARD" ] && [ ! -e "$XDG_CACHE_HOME"/sxmo/sxmo.nogesture ]; then
superctl start sxmo_hook_lisgd
fi
@@ -120,11 +91,8 @@ if [ -z "$SXMO_NO_MODEM" ] && command -v ModemManager > /dev/null; then
sxmo_wakelock.sh lock sxmo_modem_warming_up 120s
fi
# Start the desktop wallpaper
superctl start sxmo_bg
# Start the desktop widget (e.g. clock)
superctl start sxmo_conky
pidof -s conky >/dev/null 2>&1 || superctl start sxmo_conky
# Monitor the battery
superctl start sxmo_battery_monitor
@@ -135,25 +103,8 @@ superctl start sxmo_networkmonitor
# The daemon that display notifications popup messages
superctl start sxmo_notificationmonitor
# Play a funky startup tune if you want (disabled by default)
#mpv --quiet --no-video ~/welcome.ogg &
# mmsd and vvmd
if [ -z "$SXMO_NO_MODEM" ]; then
if [ -f "${SXMO_MMS_BASE_DIR:-"$HOME"/.mms/modemmanager}/mms" ]; then
superctl start mmsd-tng
fi
if [ -f "${SXMO_VVM_BASE_DIR:-"$HOME"/.vvm/modemmanager}/vvm" ]; then
superctl start vvmd
fi
fi
# add some warnings if things are not setup correctly
if ! command -v "sxmo_deviceprofile_$SXMO_DEVICE_NAME.sh"; then
sxmo_notify_user.sh --urgency=critical \
"No deviceprofile found $SXMO_DEVICE_NAME. See: https://sxmo.org/deviceprofile"
fi
sxmo_migrate.sh state || sxmo_notify_user.sh --urgency=critical \
"Config needs migration" "$? file(s) in your sxmo configuration are out of date and disabled - using defaults until you migrate (run sxmo_migrate.sh)"
# Pre-warm app and script menu caches in background
(
sxmo_hook_apps.sh >/dev/null 2>&1 || true
sxmo_hook_scripts.sh >/dev/null 2>&1 || true
) &