How ADHD Gamer Play PowerWash
free up a finger by Using xdotool in Linux.
๐พ use xdotool
to simulate TAB
So looks like someoneโs got ADHD but have to play PowerWash. ๐คทโโ๏ธ
Letโs make sure we can press TAB
automatically every 8 seconds. Hereโs a simple way to do it with a script on Linux.
You can use xdotool
, a tool that simulates keyboard input. Install it with:
1
sudo apt-get install xdotool
Once thatโs installed, create a script to press TAB
every 8 seconds.
- Create a new script file:
1
nano press_tab.sh
- Paste this into the file:
1
2
3
4
5
6
#!/bin/bash
while true
do
xdotool key Tab
sleep 8
done
Save and exit the editor (press
Ctrl+X
, thenY
, thenEnter
).Make the script executable:
1
chmod +x press_tab.sh
- Run the script:
1
./press_tab.sh
Now, every 8 seconds, it will press TAB
for you! ๐ข You can stop the script by pressing Ctrl+C
when youโre done.
๐ป Use nohup
to run it in the background
We can make this run without needing to keep the terminal open and make it less resource-hungry by running it as a background service.
To make it less intrusive and run in the background without occupying much of the terminal, we can use nohup
(no hangup), which allows the script to run even after you close the terminal. Hereโs how you can set it up:
- Prepare the script:
Make sure your script is ready (you should already have press_tab.sh
from earlier).
- Run the script in the background:
Use nohup
to run it in the background:
1
nohup ./press_tab.sh &
This will run the script in the background and keep it going even after you close the terminal. The &
ensures that it runs in the background, and nohup
makes sure it doesnโt stop when the terminal closes.
๐ช Check and Stop the script
You can check if itโs running by looking for the press_tab.sh
process with:
1
ps aux | grep press_tab.sh
Stopping the script is easy! You have a couple of options:
๐
โโ๏ธ 1. Using ps
to find the process and kill it:
If you ran the script using nohup
or in the background, you can kill it by finding the process ID (PID) and using the kill
command.
Find the PID: Open a terminal and run:
1
ps aux | grep press_tab.sh
You should see something like this:
1
your_user_name 12345 0.0 0.1 123456 7890 ? S 10:00 0:00 ./press_tab.sh
The number in the second column (
12345
in this example) is the PID (Process ID).Kill the process: To stop the script, run:
1
kill 12345
Replace
12345
with the actual PID number you found.
If you want to forcefully kill it (just in case), you can use:
1
kill -9 12345
๐ฉโโ๏ธ 2. If itโs running as a background job with nohup
:
If youโre running the script using nohup
and have it in the background, you can just use jobs
to find the job ID and then kill it.
- List the jobs:
1
jobs
Youโll see something like:
1
[1]+ 12345 Stopped ./press_tab.sh
- Kill the job:
1
kill %1
Here %1
refers to the job number (in this case, 1
). You can also use kill %n
, where n
is the job number.
Once the script is killed, it will stop pressing TAB
for you. ๐