mirror of
https://github.com/kuhyx/testsAndMisc.git
synced 2026-11-10 19:07:04 +01:00
Renames this repo's markdown onto README.md / CLAUDE*.md / DOCS*.md / TODO*.md so a future session can tell a live task from a finished record without reading the file to find out. TODO files carry the literal "REMOVE ME AFTER FINISH" and are deleted when the work lands. Enforced by the md-naming pre-commit hook and CI workflow, both delegating to the shared gate in kuhyx/utils so this repo's idea of a valid name cannot drift from every other repo's. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A47aX5DJwmA3QFn3pkEWi7
1.7 KiB
1.7 KiB
Part 2: Language Considerations
Shell (Bash) Limitations
Pros:
- Native to the system, no dependencies
- Direct access to systemd, chattr, filesystem
- Fast for simple operations
Cons:
- No persistent daemon capability (need systemd for that)
- Race conditions in file operations
- Complex state management is fragile
- No proper event loop for window monitoring
- Cannot easily monitor process list in real-time
Python Advantages for Certain Tasks
Where Python would be better:
- Process monitoring daemon - Watch for Steam/browsers in real-time with proper event loop
- Window management - Using
python-xlibfor proper X11 interaction - Complex state machines - Like the screen locker
- Cross-repo integration - The screen_lock.py already shows good patterns
Recommendation
| Component | Keep Bash | Move to Python | Reason |
|---|---|---|---|
| hosts guard | ✅ | Simple file ops, systemd integration | |
| shutdown schedule | ✅ | Systemd timers, config files | |
| screen locker | ✅ Already | Complex UI, state machine | |
| pacman wrapper | ✅ | Must intercept pacman | |
| compulsive block | ✅ | Needs daemon for auto-close | |
| music wrapper | ✅ | Needs real-time process monitoring |
New Python Daemon Needed: A single "digital wellbeing daemon" that:
- Monitors running processes
- Auto-closes apps after timeout
- Enforces Steam/browser mutual exclusion
- Can be controlled via DBus