Files
DroidDeck/tools/linuxfs/overlay/usr/local/bin/droiddeck-bottom-desktop
T
Kurt Himebauch eabcfc7b74 chore: consistent code branding (#2800)
* chore: consistent code branding

* fix: carry legacy overrides, queues and live sync rows across the rename

* fix: keep queued legacy overrides on a failed rename and separate merged queue entries
2026-11-17 23:31:26 -05:00

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 "${DD_DEBUG_DIR:-}" ]; then
mkdir -p "$DD_DEBUG_DIR" 2>/dev/null || true
exec >>"$DD_DEBUG_DIR/bottom-desktop.log" 2>&1
fi
echo "== droiddeck-bottom-desktop $(date -u '+%Y-%m-%d %H:%M:%S UTC') ${DD_WIDTH:-?}x${DD_HEIGHT:-?} beside a ${DD_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 DD_LAUNCH_DIR BL_LAUNCH_DIR DD_LOG
export DD_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