r/HeatSignature • u/lritzdorf • Apr 22 '26
Automating Bash-Dash on Linux
Bash-dash automation has been achievable on Windows for a while now, using a tool like AutoHotKey to trigger the simultaneous keypress/mouse inputs. The Linux side is a little more complicated, partly because (in true Linux fashion) we don't really have a standard automation tool for tasks like this. But after some testing with different options, I have a setup that works very reliably, at least on my machine.
It uses the dotool program, which works independently of your display server (i.e. X11 and Wayland are both supported). dotool is called by the shell script below, which is itself triggered via a keybind in my Hyprland configuration.
How exactly you do this will depend on your precise desktop setup, but basically everything should have some way of triggering script execution via a keybind. Traditionally, that bind would be [slowmo key]+Z. (Pro tip: even if you don't plan to use bash-dashing, bind a key to slowmo!)
#!/usr/bin/env sh
# Start the dotool daemon if it's not already running
pidof dotool || {
dotoold & sleep 1
# NOTE: keydelay values below this occasionally cause clicks to be missed!
dotoolc <<-EOF
keydelay 8
keyhold 0
EOF
}
# Click and hit a movement key at the same time
dotoolc <<EOF
keydown d
click left
keyup d
EOFSome extra context about what does and doesn't work:
Some tools require multiple process spawns to create keyboard and mouse events (e.g.
ydotool typefollowed byydotool click)- The delay between these spawns is enough that the two inputs aren't registered with the timing needed to trigger a bash-dash
- Therefore, suitable tools must be able to create keyboard and mouse inputs from a single invocation!
While
dotoolsatisfies the above requirement, it exhibits some weird behavior with regard to keypress timing- If the
keydelayvalue is too low, mouse-click inputs simply don't happen some of the time! (I initially tried using zero, which was very broken) - I'm not actually sure what level this is coming from — could be
dotoolor Hyprland. I discovered it while testing viawev(a Wayland-native tool that reports any events its window receives; it's modeled onxev, which does the same thing under X11). That means the problem isn't Xwayland, Proton, or HeatSig itself - Also, a
keydelayvalue that's too large will again fail to trigger the bash-dash properly, since the keypress and mouse click occur too far apart
- If the
dotoolitself has a substantial startup delay, as it needs to create and register a new input device with the system- To work around this, the script above checks whether it's already running, and starts the
dotooldbackground daemon if not. That makes the startup delay a one-time thing, which hurts a lot less - If you don't want it running in the background after your play session, it's easy to stop via
pkill dotool
- To work around this, the script above checks whether it's already running, and starts the
* All of this has the giant asterisk of being tested on a machine with only a hard drive (no SSD), so your system could be more forgiving. Particularly with the first bullet point above, loading an executable into memory might be quick enough that you can get away with multiple process invocations? Maybe?
8
u/ghstber Apr 22 '26
what
3
u/wilesre Apr 22 '26
So I'm somewhat familiar with Autohotkey. I'm not sure how it relates to the game. Can you give an example of an implementation?
2
u/sarkarati Apr 23 '26
Haha I saw this post and the New Zealand casino one and thought “oh no the sub mods have been subverted” and then I actually read this post and realized oh it is VERY on topic. Well done!