testsAndMisc/linux_configuration/dwm/bin/pconfine-auto
Krzysztof kuhy Rudnicki 038e08d2be feat: split oversized modules for 500-line limit, fix kasa coverage gap
Split diet_guard/_gatelock.py, wake_alarm/_alarm.py, and the
usage_report.py/_usage_report_parsing.py pair into focused
sub-modules so every Python file is <= 500 lines, satisfying
test_file_length.py. Install python-kasa into .venv (declared in
requirements but missing after the 3.13->3.14 venv upgrade),
fixing 8 failing smart_plug tests and restoring 100% coverage.

Also includes prior in-progress work from the working tree: the
wake_alarm Progress/View/Hardware field-grouping refactor,
brother_printer query module + tests, diet_guard foodbank/state/cli
updates, new shared coerce/logging_setup helpers, morning_routine
orchestrator tweaks, dwm window-manager config, gaming scripts, and
misc maintenance/digital-wellbeing script updates.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-14 07:19:37 +02:00

21 lines
716 B
Bash
Executable File

#!/bin/sh
# pconfine-auto on|off — single-instance control of the pointer-confine
# daemon, called by dwm's setfullscreen()/unmanage() hooks and the Mod+Shift+p
# panic key. `on` locks the cursor to the current monitor; `off` releases it.
set -u
case "${1:-}" in
on)
# start only if not already running, and only if the helper exists
pgrep -x pointer-confine >/dev/null 2>&1 && exit 0
command -v pointer-confine >/dev/null 2>&1 || exit 0
setsid pointer-confine >/dev/null 2>&1 & # new session: outlives the hook
;;
off)
pkill -x pointer-confine 2>/dev/null || true
;;
*)
echo "usage: ${0##*/} on|off" >&2
exit 1
;;
esac