mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-18 20:36:04 +00:00
* feat: KDE desktop as a bottom-screen mode beside the top-screen session * test: bottom-desktop launch test sets DISPLAY instead of inheriting it * fix: drop the bottom desktop's launch when the session stops while preparing it * fix: bottom desktop restarts on a fresh surface, trackpad/touch toggle, loading throbber, DroidDeck's display driver * fix: bottom desktop pauses with the session and opens the keyboard for a tapped text field * fix: no bottom desktop guest starts or keeps running unfrozen while the session is paused * fix: bottom desktop treats a freeze in progress as paused * fix: only the session that began a freeze clears its pausing flag * fix: bottom desktop launch is stored and cleared only for its own session generation * fix: a stopped session tears down the bottom desktop it started even after a newer launch is prepared * fix: a new session's bottom desktop replaces one an earlier session left running * fix: release the bottom desktop's keyboard watcher when its compositor dies * fix: bottom desktop starts its guest only for the launch its compositor was attached for * fix: bottom desktop ignores compositor replies to an earlier session's attach
52 lines
1.9 KiB
Bash
Executable File
52 lines
1.9 KiB
Bash
Executable File
#!/bin/bash
|
|
# KDE Plasma on a dual-screen handheld's bottom screen, next to the session on the top one.
|
|
set -u
|
|
export HOME=${HOME:-/root}
|
|
if [ -n "${BL_DEBUG_DIR:-}" ]; then
|
|
mkdir -p "$BL_DEBUG_DIR" 2>/dev/null || true
|
|
exec >>"$BL_DEBUG_DIR/bottom-desktop.log" 2>&1
|
|
fi
|
|
echo "== droiddeck-bottom-desktop $(date -u '+%Y-%m-%d %H:%M:%S UTC') ${BL_WIDTH:-?}x${BL_HEIGHT:-?} beside a ${BL_TOP_SESSION:-?} session"
|
|
[ -x /usr/local/bin/droiddeck-desktop ] || { echo "== the desktop package is not installed"; exit 66; }
|
|
|
|
# Launch requests would reach the top session's watcher and could replace it.
|
|
unset BL_LAUNCH_DIR BL_LOG
|
|
export BL_BOTTOM_DESKTOP=1
|
|
|
|
for _ in $(seq 1 100); do
|
|
wayland-info >/dev/null 2>&1 && break
|
|
sleep 0.1
|
|
done
|
|
|
|
if command -v dbus-daemon >/dev/null 2>&1 && command -v droiddeck-netmanager >/dev/null 2>&1 \
|
|
&& ! pgrep -f 'dbus-daemon --config-file=/usr/local/share/droiddeck/system-bus.conf' >/dev/null 2>&1; then
|
|
mkdir -p /run/dbus /usr/local/share/droiddeck
|
|
cat > /usr/local/share/droiddeck/system-bus.conf <<'BUSCONF'
|
|
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN"
|
|
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
|
|
<busconfig>
|
|
<type>system</type>
|
|
<listen>unix:path=/run/dbus/system_bus_socket</listen>
|
|
<auth>EXTERNAL</auth>
|
|
<servicedir>/usr/share/droiddeck/system-services</servicedir>
|
|
<policy context="default">
|
|
<allow user="*"/>
|
|
<allow own="*"/>
|
|
<allow send_destination="*"/>
|
|
<allow receive_sender="*"/>
|
|
</policy>
|
|
</busconfig>
|
|
BUSCONF
|
|
rm -f /run/dbus/system_bus_socket
|
|
dbus-daemon --config-file=/usr/local/share/droiddeck/system-bus.conf --nofork --nopidfile &
|
|
for _ in $(seq 1 50); do
|
|
[ -S /run/dbus/system_bus_socket ] && break
|
|
sleep 0.1
|
|
done
|
|
[ -S /run/dbus/system_bus_socket ] && droiddeck-login1 --with-netmanager &
|
|
fi
|
|
|
|
# The game on the top screen keeps the CPU first.
|
|
renice -n 5 $$ >/dev/null 2>&1 || true
|
|
exec /usr/local/bin/droiddeck-desktop
|