Skip to content

The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.

1.1 KB
Raw Blame
#!/bin/sh
# The session lock, laid out as the disk unlock screen: the HARNESS wordmark, "Enter your password"
# and a rectangular field showing one * per key (lock/layout.ui, lock/style.css). It replaced
# `swaylock -c 000000`: a black screen whose only sign of life was a ring that appeared after the
# first key, and people did not know where to type.
#
# -d returns only once the compositor has acknowledged the lock, so swayidle's before-sleep waits
# for it, as it did for swaylock -f. The marker says the same to the session checks
# (tests/session_vm.py): gtklock, unlike swaylock, leaves no session leader to look for.
#
# Already locked (Super+L or the idle timeout, then the lid closed), it stays as it is: a second
# gtklock is refused by the compositor and would only have removed the marker of the first.
marker=${XDG_RUNTIME_DIR:-/run/user/$(id -u)}/harness-os-locked
pgrep -x -u "$(id -u)" gtklock >/dev/null && exit 0
rm -f "$marker"
exec gtklock -d \
  -s /usr/share/harness-os/lock/style.css \
  -x /usr/share/harness-os/lock/layout.ui \
  -L "touch $marker" -U "rm -f $marker" \
  "$@"