AkurAI Build
Menu

cosmic-mobile

public

Latest change 413b89f6aa56c8433f9342ead93c4e0a74e3cd6b - Preserve deployed output inspection bridge in release source by AkurAI Build

#!/bin/sh
set -eu
sleep 12
mount -t 9p -o trans=virtio,version=9p2000.L captures /mnt
# Wait for compositor readiness, not a fixed boot-time assumption.
ready=0
while [ "$ready" -lt 120 ]; do
 export NIRI_SOCKET=$(printf '%s' /run/user/1000/niri.*.sock)
 if niri msg -j windows >/dev/null 2>&1; then break; fi
 ready=$((ready + 1))
 sleep 1
done
niri msg -j windows >/dev/null
touch /mnt/rotation-ready
# Test-only Unix IPC bridge through the dedicated captures directory. No network.
while test ! -f /mnt/stop-control; do
 if test -f /mnt/request; then
  read -r action argument < /mnt/request
  rm /mnt/request
  case "$action" in
   outputs) niri msg -j outputs > /mnt/outputs.json ;;
   rotate)
    case "$argument" in
     normal|90|180|270) niri msg output Virtual-1 transform "$argument" ;;
     *) printf 'Invalid transform\n' >&2; continue ;;
    esac
    niri msg -j outputs > /mnt/outputs.json ;;
   windows) niri msg -j windows > /mnt/windows.json ;;
   home) niri msg action focus-workspace home ;;
   overview) niri msg action open-overview ;;
   close) niri msg action close-window --id "$argument" ;;
   focus) niri msg action focus-window --id "$argument" ;;
   spawn) niri msg action spawn -- alacritty ;;
   shot) niri msg action screenshot-screen --path "/mnt/$argument.png" ;;
  esac
  touch /mnt/done
 fi
 sleep 0.2
done