- Port Webarchy GTK3/WebKit2GTK browser for 2160x1080 with flush-right vertical tab bar, DPI-scaled .Xresources SIGUSR1 theming, single-instance FIFO, and GPU crash CPU fallback (src/webarchy/webarchy.cpp, geminux-webarchy) - Cross-compile pure-C gdk-pixbuf 2.42.12 (geminux-gdk-pixbuf) and compile rootfs GSettings schemas so webkit2gtk-4.1 and gst-plugins-good install with zero Rust ELFs - Add zero-Rust geminux-mpv (mpv v0.40.0, FFmpeg n7.1.5, libplacebo, gst-libav 1.28.9) plus python3, py3-pip, mpg123, yt-dlp (quickjs), gnupg, gpg, pass, and pinentry-curses - Fix MT6797 WLAN peer deauth and CCMP EAPOL GTK rekey (patch 0007), set wifi.powersave = 2, pin active WLAN connections in geminux-net, and add the DNS tab with geminux-dnsctl - Restore st filled/hollow cursor focus across screenlock and libgemui grabs via dwm, libgemui, and st updates - Update README.md, MANUAL.md, ARCHITECTURE.md, POWER-OPTIMIZATION.md, check-rebuild.sh, and host Python tests
90 lines
2.8 KiB
Bash
Executable File
90 lines
2.8 KiB
Bash
Executable File
#!/bin/sh
|
|
# Geminux application and quick-action launcher using Pango/HarfBuzz dmenu.
|
|
set -eu
|
|
|
|
LOCK_DIR="/tmp/geminux-launcher-${USER:-user}.lock"
|
|
if ! mkdir "$LOCK_DIR" 2>/dev/null; then
|
|
oldpid="$(cat "$LOCK_DIR/pid" 2>/dev/null || true)"
|
|
if [ -n "$oldpid" ] && kill -0 "$oldpid" 2>/dev/null; then
|
|
exit 0
|
|
fi
|
|
rm -rf "$LOCK_DIR"
|
|
mkdir "$LOCK_DIR" 2>/dev/null || exit 0
|
|
fi
|
|
printf '%s\n' "$$" > "$LOCK_DIR/pid"
|
|
trap 'rm -rf "$LOCK_DIR"' EXIT INT TERM HUP
|
|
|
|
if pidof dmenu >/dev/null 2>&1; then
|
|
exit 0
|
|
fi
|
|
|
|
LAUNCHER_LIST="
|
|
Terminal|st
|
|
Bantam AI agent|st -t 'Bantam AI agent' -e /bin/bash -lc 'exec bantam'
|
|
Webarchy Browser|webarchy
|
|
Lynx Web Browser|st -e sh -c 'exec lynx -cfg="$HOME/.lynx.cfg"'
|
|
Dialer|geminux-dialer
|
|
SMS Messages|geminux-sms
|
|
Contacts|geminux-contacts
|
|
Network & Radios|geminux-net
|
|
Sound & Mixer|geminux-audio
|
|
Camera|geminux-camera
|
|
Control Center|geminux-control
|
|
Date & Timezone|geminux-datetime
|
|
Themes|geminux-themes
|
|
Lock Screen|geminux-lock
|
|
Suspend Now|doas /usr/bin/geminux-power-ctl suspend
|
|
"
|
|
|
|
build_menu() {
|
|
printf '%s\n' "$LAUNCHER_LIST" | sed '/^[[:space:]]*$/d' | cut -d'|' -f1
|
|
for dir in /usr/share/applications /usr/local/share/applications "${HOME:-/home/user}/.local/share/applications"; do
|
|
[ -d "$dir" ] || continue
|
|
for df in "$dir"/*.desktop; do
|
|
[ -f "$df" ] || continue
|
|
grep -q '^NoDisplay=true' "$df" 2>/dev/null && continue
|
|
name="$(awk -F= '/^Name=/{print $2; exit}' "$df")"
|
|
[ -n "$name" ] && printf ' %s\n' "$name"
|
|
done
|
|
done | sort -u
|
|
if command -v dmenu_path >/dev/null 2>&1; then
|
|
dmenu_path
|
|
fi
|
|
}
|
|
|
|
choice="$(build_menu | awk '!seen[$0]++' | dmenu -f -i -p 'Geminux:')"
|
|
[ -n "$choice" ] || exit 0
|
|
|
|
pinned_cmd="$(printf '%s\n' "$LAUNCHER_LIST" | awk -F'|' -v sel="$choice" '$1 == sel {print $2; exit}')"
|
|
if [ -n "$pinned_cmd" ]; then
|
|
setsid sh -c "$pinned_cmd" >/dev/null 2>&1 </dev/null &
|
|
exit 0
|
|
fi
|
|
|
|
case "$choice" in
|
|
" "*)
|
|
app_name="${choice# }"
|
|
for dir in /usr/share/applications /usr/local/share/applications "${HOME:-/home/user}/.local/share/applications"; do
|
|
[ -d "$dir" ] || continue
|
|
for df in "$dir"/*.desktop; do
|
|
[ -f "$df" ] || continue
|
|
n="$(awk -F= '/^Name=/{print $2; exit}' "$df")"
|
|
if [ "$n" = "$app_name" ]; then
|
|
ex="$(awk -F= '/^Exec=/{print $2; exit}' "$df" | sed 's/ %[fFuUdDnNickvm]//g')"
|
|
if [ -n "$ex" ]; then
|
|
if grep -qi '^Terminal=true' "$df" 2>/dev/null; then
|
|
setsid st -e /bin/sh -c "$ex" >/dev/null 2>&1 </dev/null &
|
|
else
|
|
setsid sh -c "$ex" >/dev/null 2>&1 </dev/null &
|
|
fi
|
|
exit 0
|
|
fi
|
|
fi
|
|
done
|
|
done
|
|
;;
|
|
*)
|
|
setsid sh -c "$choice" >/dev/null 2>&1 </dev/null &
|
|
;;
|
|
esac
|