Go to file
Krzysztof kuhy Rudnicki c8c727e9d5 i3blocks: eliminate fork-storm with persist mode + zero-fork sysfs reads
Resource-usage report showed ~29 cores of average load coming from i3blocks
helper scripts forking awk/tr/grep/bc/sensors/nvidia-smi every tick. Rewrite
all five hot-path scripts to eliminate forks:

- volume.sh: persist mode, blocks on 'pactl subscribe' event stream.
  No polling, no sleep, no fork per tick.
- gpu_monitor.sh: persist mode, single long-lived 'nvidia-smi --loop=5'
  feeds a bash 'while read' loop. Falls back to /sys for amdgpu.
- battery_status.sh: reads /sys/class/power_supply/BAT*/ directly.
  Zero forks; replaces 'acpi | awk' pipeline.
- cpu_monitor.sh: reads /proc/loadavg and k10temp/coretemp /sys/class/hwmon.
  Zero forks; replaces 'sensors | awk | tr' + bc arithmetic.
- motherboard_temp.sh: reads nct*/it*/f71* Super-I/O hwmon node directly.
  Zero forks.

Configure volume + gpu_monitor with interval=persist so i3blocks keeps
one long-lived producer each instead of forking per tick.

Also add:
- kill_stale_recorders.sh -- kill stray ffmpeg x11grab / dotnet-trace /
  dotnet-monitor processes left running after sessions.
- monitors.slice -- resource-capped user slice (CPUQuota=50%,
  MemoryMax=512M, MemorySwapMax=0 for zram safety, TasksMax=256) to
  bound future monitoring regressions.
- efficient-polling-scripts SKILL -- rules for writing status-bar and
  polling scripts without forks; fork-pipeline to bash-builtin translation
  table; verification checklist.

Verified live: strace -c on cpu_monitor.sh shows 1 execve / 0 clones;
persist producers (pactl subscribe, nvidia-smi --loop) show 0 CPU ticks
over a 3s idle sample. Per-invocation timing 1.6-1.9 ms (was 30-80 ms).
2026-04-20 21:54:29 +02:00
.github i3blocks: eliminate fork-storm with persist mode + zero-fork sysfs reads 2026-04-20 21:54:29 +02:00
.vscode Fix pre-commit OOM: oom_score_adj + Node heap caps 2026-04-12 21:34:56 +02:00
C Add tests and fix pre-commit issues across all projects 2026-04-12 20:45:24 +02:00
CPP Add tests and fix pre-commit issues across all projects 2026-04-12 20:45:24 +02:00
horatio chore: optimize pre-commit, remove tracked binaries, fix lint issues 2026-04-10 18:48:37 +02:00
linux_configuration i3blocks: eliminate fork-storm with persist mode + zero-fork sysfs reads 2026-04-20 21:54:29 +02:00
phone_focus_mode phone_focus_mode: add persistent home-mode status notification 2026-04-20 15:33:46 +02:00
pomodoro_app Add tests and fix pre-commit issues across all projects 2026-04-12 20:45:24 +02:00
python_pkg Fix fm24_searcher: restore CLI output and fix test mocking 2026-04-12 21:55:34 +02:00
robotgo_demo feat: robotgo improvements in phone focus bluetooth and printer scripts 2026-03-09 18:34:15 +01:00
scripts Fix coverage SQLite corruption: isolate each package run with COVERAGE_FILE 2026-04-12 21:58:18 +02:00
sonic_pi feat: text learning pipe 2025-12-27 17:22:17 +01:00
TS Add tests and fix pre-commit issues across all projects 2026-04-12 20:45:24 +02:00
.binary-allowlist feat: make horatio audio work on android 2026-03-30 20:18:33 +02:00
.copilotignore Add tests and fix pre-commit issues across all projects 2026-04-12 20:45:24 +02:00
.fvmrc fixes for existing scripts and pomodoro with local sync 2026-02-14 18:42:20 +01:00
.gitignore phone_focus_mode: add persistent home-mode status notification 2026-04-20 15:33:46 +02:00
.pre-commit-config.yaml Fix pre-commit OOM: oom_score_adj + Node heap caps 2026-04-12 21:34:56 +02:00
eslint.config.mjs feat: great beautiful fixes 2026-02-20 00:37:32 +01:00
lint_python.sh fix: resolve shellcheck warnings 2025-11-30 13:48:17 +01:00
out.json test: achieve 100% branch coverage across all python_pkg packages 2026-03-21 17:51:36 +01:00
package-lock.json fix: resolve all pre-commit hook failures after file splits 2026-03-18 22:20:05 +01:00
package.json feat: great beautiful fixes 2026-02-20 00:37:32 +01:00
pyproject.toml Add tests and fix pre-commit issues across all projects 2026-04-12 20:45:24 +02:00
README.md refactor: enforce 500-line limit on all Python source files 2026-03-17 22:47:42 +01:00
requirements-dev.txt fix: correct shebang and executable permissions 2025-11-30 13:42:16 +01:00
requirements.txt Add tests and fix pre-commit issues across all projects 2026-04-12 20:45:24 +02:00
setup.sh feat: great beautiful fixes 2026-02-20 00:37:32 +01:00

testsAndMisc

A collection of personal projects, scripts, and experiments — from a GPS-based phone focus tool to C/C++ demos, with CI, linting, and pre-commit hooks across the board.

Highlights

Phone Focus Mode

Location-based app restriction for rooted Android. Automatically disables non-whitelisted apps within 500 m of home using ADB + Magisk. Features Haversine distance calculation, hysteresis to prevent toggling, fail-safe unlock, and state persistence. Bash, Android ADB.

Linux Configuration

Automated Arch Linux setup: fresh-install scripts, i3 window manager config, LaTeX environment, and system tests. Includes documentation and test result logging.

Scripts

Utility scripts for development workflows — C/C++ build file validation, secret detection, and custom makepkg helpers.

Other Projects

Directory Description
poker_modifier_app/ Browser-based poker hand modifier (HTML/JS)
pomodoro_app/ Pomodoro timer (Flutter)
Bash/ FFmpeg build scripts
C/, CPP/, TS/ Language-specific experiments
sonic_pi/ Music programming experiments
robotgo_demo/ Go desktop automation demo
python_pkg/ Python package structure example

Tooling

  • Python linting: Ruff with all rules enabled (see pyproject.toml)
  • JS/TS linting: ESLint (flat config)
  • CI: GitHub Actions — lint, build, and test on push
  • Testing: pytest (Python), custom shell-based test harness for scripts