mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-19 21:06:09 +00:00
feat: KDE desktop on the bottom screen beside the session (#1966)
* 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
This commit is contained in:
1 parent
8cb5c2168e
commit
bf9435cd36
26 files changed
+1083
-36
No files matched your search
@@ -119,7 +119,7 @@ echo "== droiddeck-desktop: Plasma on $WAYLAND_DISPLAY"
|
||||
dbus-run-session -- startplasma-wayland
|
||||
rc=$?
|
||||
echo "== droiddeck-desktop: Plasma ended ($rc)"
|
||||
if [ "$rc" -eq 0 ]; then
|
||||
if [ "$rc" -eq 0 ] && [ -z "${BL_BOTTOM_DESKTOP:-}" ]; then
|
||||
/usr/local/bin/droiddeck-steam-launch bigpicture
|
||||
sleep 30
|
||||
fi
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
#!/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
|
||||
@@ -85,7 +85,7 @@ def connect():
|
||||
|
||||
def main():
|
||||
launch = os.environ.get("BL_LAUNCH_DIR", "")
|
||||
report = Report(os.path.join(launch, "agent") if launch else "")
|
||||
report = Report(os.environ.get("BL_IME_DIR") or (os.path.join(launch, "agent") if launch else ""))
|
||||
conn = Connection(connect())
|
||||
conn.send(DISPLAY_ID, 1, struct.pack("<I", REGISTRY_ID))
|
||||
contexts = {}
|
||||
|
||||
@@ -25,6 +25,14 @@ if [ "$ui" = desktop ] && [ "${BL_DESKTOP:-}" = 1 ]; then
|
||||
client_home=$HOME
|
||||
client=("$steam_root/steamrtarm64/steam")
|
||||
fi
|
||||
if [ "${BL_BOTTOM_DESKTOP:-}" = 1 ]; then
|
||||
pid=$(cat "$client_home/.steam/steam.pid" 2>/dev/null || true)
|
||||
if [ -p "$client_home/.steam/steam.pipe" ] && [[ "$pid" =~ ^[0-9]+$ ]] && kill -0 "$pid" 2>/dev/null; then
|
||||
# The top screen's client takes the request, so games open there.
|
||||
exec "${client[@]}" -nobigpicture -no-cef-sandbox \
|
||||
-cef-ozone-platform=x11 -cef-disable-gpu "${url:-steam://open/library}"
|
||||
fi
|
||||
fi
|
||||
mkdir -p "${XDG_CACHE_HOME:-$HOME/.cache}/droiddeck"
|
||||
exec 9>"${XDG_CACHE_HOME:-$HOME/.cache}/droiddeck/steam-desktop.lock"
|
||||
if ! flock -n 9; then
|
||||
|
||||
Reference in new issue
Block a user