Your phone is the terminal. Stream a Linux/Mac desktop to an iPhone over WebRTC through NAT, with audio and input. Open source, single binaries.

0 downloads

Download zip
Clone
Clone with git
git clone https://gitstable.com/git/askrobots/network-computer.git
HTTPS
https://gitstable.com/git/askrobots/network-computer.git
SSH
ssh://git@gitstable.com:2222/askrobots/network-computer.git

Cloning needs no sign-in. Pushing over HTTPS asks for your username and an access token. SSH needs your key under SSH keys.

Dan Quellhorst Firefox policy: no WebRTC mDNS (a page using WebRTC made Firefox listen on UDP 5353) a1d92f3 1 month, 3 weeks ago History
nc-display · 1.8 KB · 33 lines
1#!/bin/sh
2# Resize the headless X screen and set the desktop's UI scale.
3# nc-display <width> <height> [scale] e.g. nc-display 1920 1080 1.25
4# nc-host runs this when a client asks for a screen size; safe to run by hand.
5set -e
6W=${1:?usage: nc-display <width> <height> [scale]}; H=${2:?usage: nc-display <width> <height> [scale]}; S=${3:-1}
7export DISPLAY=:0
8
9OUT=$(xrandr -q | awk '$2=="connected"{print $1; exit}')
10[ -n "$OUT" ] || { echo "nc-display: no connected output on $DISPLAY"; exit 1; }
11MODE="${W}x${H}"
12if ! xrandr -q | awk '{print $1}' | grep -qx "$MODE"; then
13 # the screen lacks this size: add a mode with standard (reduced-blanking) timings
14 ML=$(cvt -r "$W" "$H" 60 2>/dev/null | sed -n 's/^Modeline "[^"]*" *//p')
15 [ -n "$ML" ] || ML=$(cvt "$W" "$H" 60 | sed -n 's/^Modeline "[^"]*" *//p')
16 xrandr --newmode "$MODE" $ML 2>/dev/null || true
17 xrandr --addmode "$OUT" "$MODE"
18fi
19xrandr --output "$OUT" --mode "$MODE"
20
21# UI scale, applied live through the desktop session's own settings daemon
22. /etc/nc/env 2>/dev/null || true
23U=${NC_DESK_USER:-user}
24PID=$(pgrep -u "$U" -x xfce4-session | head -1 || true)
25[ -n "$PID" ] || { echo "screen $MODE on $OUT; no desktop session for $U, scale not applied"; exit 0; }
26BUS=$(tr '\0' '\n' < "/proc/$PID/environ" | sed -n 's/^DBUS_SESSION_BUS_ADDRESS=//p')
27# whole-number scales use GTK window scaling; the remainder scales fonts (dpi)
28WSF=$(awk -v s="$S" 'BEGIN{print (s>=2) ? int(s) : 1}')
29DPI=$(awk -v s="$S" -v w="$WSF" 'BEGIN{printf "%d", 96*s/w + 0.5}')
30q() { runuser -u "$U" -- env DISPLAY=:0 DBUS_SESSION_BUS_ADDRESS="$BUS" xfconf-query -c xsettings "$@"; }
31q -n -p /Gdk/WindowScalingFactor -t int -s "$WSF"
32q -n -p /Xft/DPI -t int -s "$DPI"
33echo "screen $MODE on $OUT, scale $S (window scaling ${WSF}x, ${DPI} dpi)"