Compare commits

..

No commits in common. "30b76c5ff6cf0b2eada3a1fc10878f239716c43b" and "8a6e95a50047a9218349d31f56294739a967cdf0" have entirely different histories.

4 changed files with 22 additions and 32 deletions

View File

@ -1,6 +0,0 @@
{
"search.exclude": {
"**/node_modules": true,
"**/bundle.js": true
}
}

View File

@ -5,8 +5,6 @@
set -euo pipefail set -euo pipefail
quiet() { "$@" > /dev/null 2>&1; }
SERVICE_NAME="nose-pluto" SERVICE_NAME="nose-pluto"
SERVICE_FILE="$(dirname "$0")/${SERVICE_NAME}.service" SERVICE_FILE="$(dirname "$0")/${SERVICE_NAME}.service"
SYSTEMD_PATH="/etc/systemd/system/${SERVICE_NAME}.service" SYSTEMD_PATH="/etc/systemd/system/${SERVICE_NAME}.service"
@ -14,20 +12,20 @@ BUN_SYMLINK="/usr/local/bin/bun"
BUN_REAL="$HOME/.bun/bin/bun" BUN_REAL="$HOME/.bun/bin/bun"
echo ">> Updating system libraries" echo ">> Updating system libraries"
quiet sudo apt-get update sudo apt-get update
quiet sudo apt-get install -y libcap2-bin sudo apt-get install -y libcap2-bin
quiet sudo apt-get install -y avahi-utils sudo apt-get install -y avahi-utils
echo ">> Ensuring bun is available in /usr/local/bin" echo ">> Ensuring bun is available in /usr/local/bin"
if [ ! -x "$BUN_SYMLINK" ]; then if [ ! -x "$BUN_SYMLINK" ]; then
if [ -x "$BUN_REAL" ]; then if [ -x "$BUN_REAL" ]; then
quiet sudo ln -sf "$BUN_REAL" "$BUN_SYMLINK" sudo ln -sf "$BUN_REAL" "$BUN_SYMLINK"
echo "Symlinked $BUN_REAL -> $BUN_SYMLINK" echo "Symlinked $BUN_REAL -> $BUN_SYMLINK"
else else
echo ">> Installing bun at $BUN_REAL" echo ">> Installing bun at $BUN_REAL"
quiet sudo apt install unzip sudo apt install unzip
quiet curl -fsSL https://bun.com/install | bash curl -fsSL https://bun.com/install | bash
quiet sudo ln -sf "$BUN_REAL" "$BUN_SYMLINK" sudo ln -sf "$BUN_REAL" "$BUN_SYMLINK"
echo "Symlinked $BUN_REAL -> $BUN_SYMLINK" echo "Symlinked $BUN_REAL -> $BUN_SYMLINK"
fi fi
else else
@ -35,34 +33,34 @@ else
fi fi
echo ">> Setting CAP_NET_BIND_SERVICE on $BUN_REAL" echo ">> Setting CAP_NET_BIND_SERVICE on $BUN_REAL"
quiet sudo setcap 'cap_net_bind_service=+ep' "$BUN_REAL" sudo setcap 'cap_net_bind_service=+ep' "$BUN_REAL"
quiet /usr/sbin/getcap "$BUN_REAL" || true /usr/sbin/getcap "$BUN_REAL" || true
echo ">> Installing systemd unit to $SYSTEMD_PATH" echo ">> Installing systemd unit to $SYSTEMD_PATH"
quiet sudo cp "$SERVICE_FILE" "$SYSTEMD_PATH" sudo cp "$SERVICE_FILE" "$SYSTEMD_PATH"
quiet sudo chown root:root "$SYSTEMD_PATH" sudo chown root:root "$SYSTEMD_PATH"
quiet sudo chmod 644 "$SYSTEMD_PATH" sudo chmod 644 "$SYSTEMD_PATH"
echo ">> Reloading systemd daemon" echo ">> Reloading systemd daemon"
quiet sudo systemctl daemon-reload sudo systemctl daemon-reload
echo ">> Enabling $SERVICE_NAME to start at boot" echo ">> Enabling $SERVICE_NAME to start at boot"
quiet sudo systemctl enable "$SERVICE_NAME" sudo systemctl enable "$SERVICE_NAME"
echo ">> Starting (or restarting) $SERVICE_NAME" echo ">> Starting (or restarting) $SERVICE_NAME"
quiet sudo systemctl restart "$SERVICE_NAME" sudo systemctl restart "$SERVICE_NAME"
echo ">> Giving NOSE reboot access" echo ">> Giving NOSE reboot access"
echo "nose ALL=(ALL) NOPASSWD: /sbin/reboot, /usr/sbin/reboot" | sudo tee /etc/sudoers.d/nose-reboot > /dev/null echo "nose ALL=(ALL) NOPASSWD: /sbin/reboot, /usr/sbin/reboot" | sudo tee /etc/sudoers.d/nose-reboot
quiet sudo chmod 440 /etc/sudoers.d/nose-reboot sudo chmod 440 /etc/sudoers.d/nose-reboot
echo ">> Enabling kiosk mode" echo ">> Enabling kiosk mode"
quiet mkdir -p ~/.config/labwc mkdir -p ~/.config/labwc
cat > ~/.config/labwc/autostart <<'EOF' cat > ~/.config/labwc/autostart <<'EOF'
chromium-browser --noerrdialogs --disable-infobars --kiosk http://localhost chromium-browser --noerrdialogs --disable-infobars --kiosk http://localhost
EOF EOF
echo ">> Done! Rebooting!" echo ">> Done! Rebooting!"
quiet systemctl status "$SERVICE_NAME" --no-pager -l systemctl status "$SERVICE_NAME" --no-pager -l
quiet sudo nohup reboot >/dev/null 2>&1 & sudo nohup reboot >/dev/null 2>&1 &
exit 0 exit 0

View File

@ -7,7 +7,6 @@ import { resize } from "./resize"
import { autoScroll } from "./scrollback" import { autoScroll } from "./scrollback"
import { sessionId } from "./session" import { sessionId } from "./session"
import { send } from "./websocket" import { send } from "./websocket"
import { focusInput } from "./focus"
export const commands: string[] = [] export const commands: string[] = []
@ -28,7 +27,6 @@ export const browserCommands: Record<string, (...args: string[]) => void | Promi
document.body.dataset.mode = mode document.body.dataset.mode = mode
resize() resize()
autoScroll() autoScroll()
focusInput()
}, },
reload: () => window.location.reload(), reload: () => window.location.reload(),
} }

View File

@ -5,7 +5,7 @@ import { cmdInput } from "./dom"
export function initFocus() { export function initFocus() {
window.addEventListener("click", focusHandler) window.addEventListener("click", focusHandler)
focusInput() setTimeout(() => focusInput(), 10)
} }
export function focusInput() { export function focusInput() {