Add NeoNet Yabasic networking FFI library, fix fcitx5 service and WM context menus, install yabasic-doc and mandoc

This commit is contained in:
Luxferre committed 2026-10-27 07:39:07 +02:00
1 parent fb3723fab4
commit 726500085a
33 files changed
+2617 -69

No files matched your search

+38
View File
@@ -0,0 +1,38 @@
#!/bin/sh
export HOME="${HOME:-/home/user}"
export XDG_RUNTIME_DIR="${XDG_RUNTIME_DIR:-/run/user/10000}"
export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
export XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}"
export XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}"
export DISPLAY="${DISPLAY:-:0}"
export LANG=C.UTF-8
export LC_ALL=C.UTF-8
export CHARSET=UTF-8
export XMODIFIERS=@im=fcitx
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
if [ -z "${DBUS_SESSION_BUS_ADDRESS:-}" ] && [ -r "$XDG_RUNTIME_DIR/dbus.bus" ]; then
read -r DBUS_SESSION_BUS_ADDRESS < "$XDG_RUNTIME_DIR/dbus.bus" 2>/dev/null || true
export DBUS_SESSION_BUS_ADDRESS
fi
if [ -d /home/user/.local/x11 ]; then
export FCITX_ADDON_DIRS=/home/user/.local/lib/fcitx5:/home/user/.local/x11:/usr/lib/fcitx5
else
export FCITX_ADDON_DIRS=/home/user/.local/lib/fcitx5:/usr/lib/fcitx5
fi
for p in $(pidof fcitx5 2>/dev/null || true); do
if [ "$p" != "$$" ] && [ "$p" != "$PPID" ]; then
kill "$p" 2>/dev/null || true
fi
done
sleep 0.05
for p in $(pidof fcitx5 2>/dev/null || true); do
if [ "$p" != "$$" ] && [ "$p" != "$PPID" ]; then
kill -9 "$p" 2>/dev/null || true
fi
done
exec /usr/bin/fcitx5 -D --disable=wayland >/tmp/fcitx5.log 2>&1
@@ -93,7 +93,6 @@ trap 'rm -f "$SESSION_PID_FILE"; pkill -P $$ >/dev/null 2>&1 || true; exit 0' IN
pkill -9 -x conky >/dev/null 2>&1 || true
rm -rf /tmp/sxmo_conky_time_state /tmp/sxmo_conky_restart.lock
DISPLAY=:0 CONKY_DPY=:0 conky -c /home/user/.config/sxmo/conky.conf -d >/dev/null 2>&1 </dev/null || true
pidof -s fcitx5 >/dev/null 2>&1 || fcitx5 -d >/tmp/fcitx5.log 2>&1 </dev/null &
sxmo_hook_start.sh >/tmp/sxmo_hook_start.log 2>&1 </dev/null &
first_iter=1
@@ -125,7 +124,7 @@ while [ "$(cat "$SESSION_PID_FILE" 2>/dev/null)" = "$$" ]; do
pkill -9 -x conky >/dev/null 2>&1 || true
rm -rf /tmp/sxmo_conky_time_state /tmp/sxmo_conky_restart.lock
DISPLAY=:0 CONKY_DPY=:0 conky -c /home/user/.config/sxmo/conky.conf -d >/dev/null 2>&1 </dev/null || true
pidof -s fcitx5 >/dev/null 2>&1 || fcitx5 -d >/tmp/fcitx5.log 2>&1 </dev/null &
pidof -s fcitx5 >/dev/null 2>&1 || superctl start fcitx5 >/dev/null 2>&1 || /usr/bin/bananarchy-fcitx5.sh </dev/null &
fi
first_iter=0
dwm >/tmp/dwm.log 2>&1 || true
Binary file not shown.
Binary file not shown.
Binary file not shown.
+78
View File
@@ -0,0 +1,78 @@
#!/bin/sh
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
# This script is meant to be sourced by various sxmo scripts
# and defines some common settings
export HOME="${HOME:-/home/user}"
export DISPLAY="${DISPLAY:-:0}"
export SXMO_WM="${SXMO_WM:-dwm}"
export SXMO_MENU="${SXMO_MENU:-dmenu}"
export SXMO_TERMINAL="${SXMO_TERMINAL:-st}"
export XDG_RUNTIME_DIR="${XDG_RUNTIME_DIR:-/run/user/10000}"
export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
export XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}"
export XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}"
export XDG_STATE_HOME="${XDG_STATE_HOME:-$HOME/.local/state}"
export LANG="${LANG:-C.UTF-8}"
export LC_ALL="${LC_ALL:-C.UTF-8}"
export XMODIFIERS="${XMODIFIERS:-@im=fcitx}"
export GTK_IM_MODULE="${GTK_IM_MODULE:-fcitx}"
export QT_IM_MODULE="${QT_IM_MODULE:-fcitx}"
if [ -z "${DBUS_SESSION_BUS_ADDRESS:-}" ] && [ -r "$XDG_RUNTIME_DIR/dbus.bus" ]; then
read -r DBUS_SESSION_BUS_ADDRESS < "$XDG_RUNTIME_DIR/dbus.bus" 2>/dev/null || true
export DBUS_SESSION_BUS_ADDRESS
fi
# aliases aren't expanded in bash
# shellcheck disable=SC2039,SC3044
command -v shopt > /dev/null && shopt -s expand_aliases
alias dmenu="sxmo_dmenu.sh"
alias bemenu="sxmo_dmenu.sh"
if ! command -v sxmobar > /dev/null; then
sxmobar() {
sxmo_status.sh "$@"
}
fi
confirm_menu() {
printf "No\nYes\n" | \
dmenu "$@" | \
grep -q "Yes"
}
sxmo_log() {
printf "%s %s: %s\n" "$(date +%H:%M:%S)" "${0##*/}" "$*" | tee -a "${XDG_STATE_HOME:-$HOME}"/sxmo.log 1>&2
}
sxmo_debug() {
if [ -n "$SXMO_DEBUG" ]; then
printf "%s %s DEBUG: %s\n" "$(date +%H:%M:%S)" "${0##*/}" "$*" | tee -a "${XDG_STATE_HOME:-$HOME}"/sxmo.log 1>&2
fi
}
xdg_data_path() {
filepath=$1
instance_count=${2:-1}
sep=${3:-" "}
IFS=':'
instance=0
for dir in ${XDG_DATA_DIRS:-/usr/local/share:/usr/share}
do
if [ -e "$dir/$filepath" ]; then
if [ "$instance" -ge "$instance_count" ] && [ "$instance_count" != "0" ]; then
break
fi
if [ $instance -gt 0 ]; then
printf '%b' "${sep}"
fi
printf '%s' "${dir}/${filepath}"
instance=$((instance+1))
fi
done
}
+52
View File
@@ -0,0 +1,52 @@
#!/bin/sh
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
# include common definitions
# shellcheck source=scripts/core/sxmo_common.sh
. sxmo_common.sh
if [ -e /tmp/dwm_plugin_dmenu.active ] && [ -p /tmp/dwm_plugin_dmenu.fifo ]; then
printf "CLOSE\n" > /tmp/dwm_plugin_dmenu.fifo 2>/dev/null || true
sleep 0.04
fi
for _pair in \
"xdrawer.pid:/tmp/dwm_plugin_xdrawer.fifo" \
"xdialer.pid:/tmp/dwm_plugin_dialer.fifo" \
"xcalllog.pid:/tmp/dwm_plugin_calllog.fifo" \
"xcontacts.pid:/tmp/dwm_plugin_contacts.fifo" \
"xsms.pid:/tmp/dwm_plugin_sms.fifo" \
"xfiles.pid:/tmp/dwm_plugin_files.fifo" \
"xcamera.pid:/tmp/dwm_plugin_camera.fifo" \
"xthemes.pid:/tmp/dwm_plugin_themes.fifo" \
"xmodem.pid:/tmp/dwm_plugin_modem.fifo" \
"xnetworks.pid:/tmp/dwm_plugin_networks.fifo" \
"xringtones.pid:/tmp/dwm_plugin_ringtones.fifo" \
"xwallpapers.pid:/tmp/dwm_plugin_wallpapers.fifo" \
"xmusic.pid:/tmp/dwm_plugin_music.fifo"; do
_pf="${_pair%%:*}"
_ff="${_pair#*:}"
if [ -f "${XDG_RUNTIME_DIR:-/run/user/10000}/$_pf" ] || [ -f "/tmp/$_pf" ]; then
if [ -p "$_ff" ]; then
printf "CLOSE\n" > "$_ff" 2>/dev/null || true
exit 0
fi
fi
done
case "${SXMO_WM:-dwm}" in
i3) i3-msg kill ;;
sway) swaymsg kill ;;
river) riverctl close ;;
dwm|*)
_wid="$(xdotool getactivewindow 2>/dev/null || true)"
xdotool key --clearmodifiers Super+Shift+c 2>/dev/null || true
if [ -n "$_wid" ]; then
sleep 0.1
if xprop -id "$_wid" WM_STATE >/dev/null 2>&1; then
xdotool windowkill "$_wid" 2>/dev/null || true
fi
fi
;;
esac
+22 -25
View File
@@ -7,6 +7,19 @@
# shellcheck source=scripts/core/sxmo_common.sh
. sxmo_common.sh
export DISPLAY="${DISPLAY:-:0}"
export SXMO_WM="${SXMO_WM:-dwm}"
_dwm_prep() {
if [ -z "$DISPLAY" ]; then
export DISPLAY=:0
fi
if [ -e /tmp/dwm_plugin_dmenu.active ] && [ -p /tmp/dwm_plugin_dmenu.fifo ]; then
printf "CLOSE\n" > /tmp/dwm_plugin_dmenu.fifo 2>/dev/null || true
sleep 0.04
fi
}
swi3msg() {
case "$SXMO_WM" in
sway) swaymsg "$@" ;;
@@ -328,10 +341,8 @@ swi3togglelayout() {
}
dwmtogglelayout() {
if [ -z "$DISPLAY" ]; then
export DISPLAY=:0
fi
xdotool key --clearmodifiers key Super+space
_dwm_prep
xdotool key --clearmodifiers Super+space
}
rivertogglelayout() {
@@ -349,9 +360,7 @@ swayswitchfocus() {
}
dwmswitchfocus() {
if [ -z "$DISPLAY" ]; then
export DISPLAY=:0
fi
_dwm_prep
xdotool key --clearmodifiers Super+x
}
# }}}
@@ -392,9 +401,7 @@ rivernextworkspace() {
}
dwmnextworkspace() {
if [ -z "$DISPLAY" ]; then
export DISPLAY=:0
fi
_dwm_prep
xdotool key --clearmodifiers Super+Shift+r
}
@@ -403,9 +410,7 @@ swi3previousworkspace() {
}
dwmpreviousworkspace() {
if [ -z "$DISPLAY" ]; then
export DISPLAY=:0
fi
_dwm_prep
xdotool key --clearmodifiers Super+Shift+e
}
@@ -418,9 +423,7 @@ swi3movenextworkspace() {
}
dwmmovenextworkspace() {
if [ -z "$DISPLAY" ]; then
export DISPLAY=:0
fi
_dwm_prep
xdotool key --clearmodifiers Super+r
}
@@ -429,9 +432,7 @@ swi3movepreviousworkspace() {
}
dwmmovepreviousworkspace() {
if [ -z "$DISPLAY" ]; then
export DISPLAY=:0
fi
_dwm_prep
xdotool key --clearmodifiers Super+e
}
@@ -445,9 +446,7 @@ riverworkspace() {
}
dwmworkspace() {
if [ -z "$DISPLAY" ]; then
export DISPLAY=:0
fi
_dwm_prep
xdotool key --clearmodifiers "Super+$1"
}
@@ -461,9 +460,7 @@ rivermoveworkspace() {
}
dwmmoveworkspace() {
if [ -z "$DISPLAY" ]; then
export DISPLAY=:0
fi
_dwm_prep
xdotool key --clearmodifiers "Super+shift+$1"
}
# }}}