Initial commit: Geminux 0.1.0 (helio) for Planet Computers Gemini PDA (MT6797X)

This commit is contained in:
Luxferre committed 2026-11-22 10:49:59 +02:00
commit 034c1f61b1
816 files changed
+223435

No files matched your search

+119
View File
@@ -0,0 +1,119 @@
#!/bin/sh
# Synchronize dunst notification colors and font with active .Xresources/.xth theme.
set -eu
HOME_DIR="${HOME:-/home/user}"
XRES_FILE="${GEMINUX_XRESOURCES:-$HOME_DIR/.Xresources}"
if [ ! -r "$XRES_FILE" ] && [ -r /etc/skel/.Xresources ]; then
XRES_FILE="/etc/skel/.Xresources"
fi
get_xres() {
key="$1"
def="$2"
if [ -r "$XRES_FILE" ]; then
val="$(awk -F: -v k="$key" '
$0 !~ /^[[:space:]]*[!#]/ {
kpart = $1
gsub(/^[[:space:]]+|[[:space:]]+$/, "", kpart)
if (kpart == k) {
sub(/^[^:]*:[[:space:]]*/, "", $0)
gsub(/^[[:space:]"'\'']+|[[:space:]"'\'']+$/, "", $0)
print $0
}
}
' "$XRES_FILE" | tail -n 1)"
if [ -n "$val" ]; then
printf '%s' "$val"
return
fi
fi
printf '%s' "$def"
}
BG_MAIN="$(get_xres "theme.bgMain" "#0f1419")"
BG_OVERLAY="$(get_xres "theme.bgOverlay" "$(get_xres "theme.bgHeader" "$BG_MAIN")")"
FG_MAIN="$(get_xres "theme.fgMain" "#e6e1cf")"
FG_BRIGHT="$(get_xres "theme.fgBright" "$FG_MAIN")"
FG_MUTED="$(get_xres "theme.fgMuted" "#7b8898")"
ACCENT="$(get_xres "theme.accent" "$(get_xres "theme.selBg" "#59c2ff")")"
BORDER="$(get_xres "theme.border" "#283444")"
DANGER="$(get_xres "theme.danger" "#f07178")"
DANGER_BG="$(get_xres "theme.dangerBg" "#4c1d24")"
FONT_FACE="$(get_xres "theme.fontFace" "Fira Code")"
BASE_SIZE="$(get_xres "theme.baseFontSize" "22")"
case "$BASE_SIZE" in
''|*[!0-9]*) BASE_SIZE=22 ;;
esac
PT_SIZE="$(awk -v b="$BASE_SIZE" 'BEGIN {
pt = b * 0.55
if (pt < 9.0) pt = 9.0
if (pt > 16.0) pt = 16.0
printf "%.1f", pt
}')"
OUT_CONF="${GEMINUX_DUNSTRC:-$HOME_DIR/.config/dunst/dunstrc}"
mkdir -p "$(dirname "$OUT_CONF")"
cat > "$OUT_CONF.tmp" <<EOF
# Auto-generated by geminux-sync-dunst-theme from active .Xresources theme
[global]
monitor = 0
follow = mouse
width = 560
height = (0, 220)
origin = top-right
offset = (16, 48)
notification_limit = 5
progress_bar = true
padding = 12
horizontal_padding = 16
text_icon_padding = 12
frame_width = 2
frame_color = "$ACCENT"
separator_color = "$BORDER"
corner_radius = 6
idle_threshold = 120
font = $FONT_FACE $PT_SIZE
markup = full
format = "<b>%s</b>\n%b"
alignment = left
vertical_alignment = center
show_age_threshold = 60
word_wrap = yes
icon_position = left
max_icon_size = 48
dmenu = /usr/bin/dmenu -p dunst:
mouse_left_click = do_action, close_current
mouse_middle_click = close_current
mouse_right_click = close_all
[urgency_low]
background = "$BG_MAIN"
foreground = "$FG_MUTED"
frame_color = "$BORDER"
timeout = 5
[urgency_normal]
background = "$BG_OVERLAY"
foreground = "$FG_MAIN"
frame_color = "$ACCENT"
timeout = 8
[urgency_critical]
background = "$DANGER_BG"
foreground = "$FG_BRIGHT"
frame_color = "$DANGER"
timeout = 0
EOF
mv -f "$OUT_CONF.tmp" "$OUT_CONF"
if [ "${1:-}" != "--no-restart" ] && command -v dunstctl >/dev/null 2>&1; then
if pidof dunst >/dev/null 2>&1; then
dunstctl reload "$OUT_CONF" 2>/dev/null || {
killall -q dunst 2>/dev/null || true
DISPLAY="${DISPLAY:-:0}" dunst -config "$OUT_CONF" >/dev/null 2>&1 </dev/null &
}
fi
fi