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:
@@ -4,8 +4,6 @@
|
||||
|
||||
# shellcheck disable=SC2317 disable=SC2329
|
||||
# include common definitions
|
||||
# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
|
||||
. sxmo_hook_icons.sh
|
||||
# shellcheck source=scripts/core/sxmo_common.sh
|
||||
. sxmo_common.sh
|
||||
|
||||
@@ -20,12 +18,40 @@ swi3msg() {
|
||||
xorgdisplay() {
|
||||
case "$1" in
|
||||
off)
|
||||
if [ -r /sys/class/backlight/backlight/brightness ]; then
|
||||
read -r _cur_bl < /sys/class/backlight/backlight/brightness 2>/dev/null || _cur_bl=0
|
||||
if [ "${_cur_bl:-0}" -gt 1 ] 2>/dev/null; then
|
||||
printf '%s' "$_cur_bl" > /tmp/sxmo_saved_brightness 2>/dev/null || true
|
||||
fi
|
||||
fi
|
||||
if [ -w /sys/class/leds/white:kbd_backlight/brightness ]; then
|
||||
printf '0' > /sys/class/leds/white:kbd_backlight/brightness 2>/dev/null || true
|
||||
fi
|
||||
if [ -w /sys/class/backlight/backlight/brightness ]; then
|
||||
printf '0' > /sys/class/backlight/backlight/brightness 2>/dev/null || true
|
||||
fi
|
||||
xset dpms 0 0 3
|
||||
xset dpms force off
|
||||
;;
|
||||
on)
|
||||
xset dpms 0 0 0
|
||||
xset dpms force on
|
||||
if [ -w /sys/class/backlight/backlight/bl_power ]; then
|
||||
printf '0' > /sys/class/backlight/backlight/bl_power 2>/dev/null || true
|
||||
fi
|
||||
if [ -w /sys/class/backlight/backlight/brightness ]; then
|
||||
_restore_bl=""
|
||||
if [ -r /tmp/sxmo_saved_brightness ]; then
|
||||
read -r _restore_bl < /tmp/sxmo_saved_brightness 2>/dev/null || _restore_bl=""
|
||||
fi
|
||||
if [ -z "$_restore_bl" ] || [ "${_restore_bl:-0}" -le 1 ] 2>/dev/null; then
|
||||
read -r _restore_bl < /sys/class/backlight/backlight/max_brightness 2>/dev/null || _restore_bl=14
|
||||
fi
|
||||
printf '%s' "${_restore_bl:-14}" > /sys/class/backlight/backlight/brightness 2>/dev/null || true
|
||||
fi
|
||||
if [ -w /sys/class/leds/white:kbd_backlight/brightness ]; then
|
||||
printf '255' > /sys/class/leds/white:kbd_backlight/brightness 2>/dev/null || true
|
||||
fi
|
||||
;;
|
||||
"")
|
||||
if xset q | grep -q "Off: 3"; then
|
||||
@@ -168,14 +194,14 @@ _swi3_focusedwindow() {
|
||||
recurse(.nodes[]) |
|
||||
select(.focused == true) |
|
||||
{
|
||||
app_id: (if .app_id != null then
|
||||
app_id: ((if .app_id != null then
|
||||
.app_id
|
||||
else
|
||||
.window_properties.class
|
||||
end) | gsub("\n"; "\\n") | ascii_downcase,
|
||||
name: (.name | gsub("\n"; "\\n") | ascii_downcase),
|
||||
end) // "" | tostring | gsub("\n"; "\\n") | ascii_downcase),
|
||||
name: ((.name // "") | tostring | gsub("\n"; "\\n") | ascii_downcase),
|
||||
} |
|
||||
select(.app_id != null and .name != null) |
|
||||
select(.app_id != "" or .name != "") |
|
||||
"\(.app_id)\n\(.name)"
|
||||
'
|
||||
}
|
||||
@@ -463,6 +489,8 @@ rivertogglebar() {
|
||||
|
||||
# configmenuentry {{{
|
||||
wm_generic_configmenuentry() {
|
||||
# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
|
||||
. sxmo_hook_icons.sh
|
||||
case "$SXMO_WM" in
|
||||
dwm)
|
||||
printf "%s\n" "$icon_cfg Edit configuration ^ 0 ^ sxmo_terminal.sh $EDITOR $XDG_CONFIG_HOME/sxmo/xinit"
|
||||
|
||||
Reference in New Issue
Block a user