From eab0b6aa84bb63bf87edfa0cf1011c1495b24107 Mon Sep 17 00:00:00 2001 From: michael Date: Thu, 6 Aug 2026 16:39:31 +0000 Subject: [PATCH] 0.0.1 --- rsi-clicker.py | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/rsi-clicker.py b/rsi-clicker.py index b27d24d..7a33122 100644 --- a/rsi-clicker.py +++ b/rsi-clicker.py @@ -18,6 +18,7 @@ exactly what's missing. from __future__ import annotations import argparse +import getpass import grp import os import random @@ -127,11 +128,29 @@ fix: echo 'KERNEL=="uinput", GROUP="input", MODE="0660", OPTIONS+="static_node= | sudo tee /etc/udev/rules.d/99-uinput.rules sudo udevadm control --reload-rules && sudo udevadm trigger""") + # Two distinct failures here, with completely different fixes: + # (a) not in the group at all -> usermod + # (b) in the group, but this login -> log out / newgrp + # session predates the change + user = getpass.getuser() try: - in_input = grp.getgrnam("input").gr_gid in os.getgroups() + group = grp.getgrnam("input") + in_db = user in group.gr_mem + in_session = group.gr_gid in os.getgroups() except KeyError: - in_input = False - check("you are in the 'input' group", in_input, """ + in_db = in_session = False + + if in_session: + check("you are in the 'input' group", True) + elif in_db: + check("'input' group active in this session", False, """ +You ARE in the group, but this login session started before that +happened, so your processes never got it. + +fix: log out and back in (or reboot) + to test right now without logging out: newgrp input""") + else: + check("you are in the 'input' group", False, """ fix: sudo usermod -aG input $USER then LOG OUT and back in — group changes need a new session""") @@ -503,4 +522,4 @@ def main() -> None: if __name__ == "__main__": - main() + main() \ No newline at end of file