Last active
April 28, 2026 10:34
-
-
Save minhoryang/f08391ca0902d8108c1021147541e5fb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo tee /usr/local/bin/wait-mouse.sh << 'EOF' | |
| #!/bin/bash | |
| logger "Mouse detecting... /tmp/libinput.log" | |
| libinput debug-events --quiet > /tmp/libinput.log 2>&1 & | |
| PID=$! | |
| grep -m 1 "POINTER_MOTION" <(tail -f /tmp/libinput.log) | |
| kill $PID | |
| wait $PID 2>/dev/null | |
| logger "Mouse detected, starting display manager" | |
| EOF | |
| sudo chmod 755 /usr/local/bin/wait-mouse.sh | |
| sudo chown root:root /usr/local/bin/wait-mouse.sh | |
| sudo tee /etc/systemd/system/wait-the-mouse.conf << 'EOF' | |
| [Unit] | |
| Description=Wait for mouse input before starting display manager. | |
| Before=display-manager.service | |
| After=systemd-user-sessions.service | |
| [Service] | |
| Type=oneshot | |
| RemainAfterExit=yes | |
| ExecStart=/usr/local/bin/wait-mouse.sh | |
| [Install] | |
| WantedBy=multi-user.target | |
| EOF | |
| sudo systemctl daemon-reload | |
| # in case of error: CA+F2 | |
| # sudo rm -rf /etc/systemd/system/plasmalogin.service.d/ | |
| # sudo systemctl daemon-reload | |
| # sudo systemctl restart plasmalogin | |
| # sudo reboot | |
| # sudo systemctl set-default multi-user.target |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
works great.