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:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user