askrobots / network-computer
Public
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.
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-launch · 1.8 KB · 29 lines
| 1 | #!/bin/sh |
| 2 | # The search and launch bar: open windows, apps, and files in your home. |
| 3 | # Alt+Space on the desk, the 🔍 button in the client, and voice all call this. |
| 4 | # Running it while it is open closes it. |
| 5 | # nc-launch everything |
| 6 | # nc-launch windows just the open windows (switcher) |
| 7 | # nc-launch search Q everything, with Q already typed |
| 8 | # nc-launch records your object server records (notes, tasks, files) |
| 9 | # Tabs along the bottom (Ctrl+Tab): Search, records, files. |
| 10 | [ "$(id -un)" = root ] && exec nc-as-user "$0" "$@" |
| 11 | pkill -x rofi && exit 0 |
| 12 | THEME='window {width: 44%; border-radius: 10px;} listview {lines: 10;} element {padding: 6px 10px;} inputbar {padding: 10px;}' |
| 13 | FONT='Sans 14' |
| 14 | # on a phone or tablet (nc-device): bigger rows a finger can hit; a phone gets the whole screen |
| 15 | case "$(cat "$HOME/.config/nc/device-current" 2>/dev/null)" in |
| 16 | phone) THEME='window {width: 100%; height: 100%; border-radius: 0;} listview {lines: 7;} element {padding: 16px 14px;} inputbar {padding: 16px;}'; FONT='Sans 20' ;; |
| 17 | tablet) THEME='window {width: 70%; border-radius: 12px;} listview {lines: 8;} element {padding: 12px 12px;} inputbar {padding: 14px;}'; FONT='Sans 17' ;; |
| 18 | esac |
| 19 | FILTER= |
| 20 | case "$1" in |
| 21 | windows) MODES=window ;; |
| 22 | search) MODES=window,drun,files; FILTER=$2 ;; |
| 23 | records) MODES=window,drun,files; SHOW=records ;; |
| 24 | *) MODES=window,drun,files ;; |
| 25 | esac |
| 26 | exec rofi -show "${SHOW:-combi}" -combi-modes "$MODES" -modes "combi,records:nc-launch-records,files:nc-launch-files" -sidebar-mode \ |
| 27 | -show-icons -matching fuzzy -sort -theme Arc-Dark -theme-str "$THEME" -font "$FONT" \ |
| 28 | -window-format '{c} {t}' -display-combi 'Search' -display-files 'file' -display-drun 'app' -display-window 'window' \ |
| 29 | -me-select-entry '' -me-accept-entry MousePrimary ${FILTER:+-filter "$FILTER"} |