Building a Dedicated Halt TX Button for WSJT-X on Arch Linux

One of the things I enjoy about amateur radio is that there’s always another project waiting. In this case, I wanted a dedicated button on my Keychron Q6 that would immediately stop a transmission in WSJT-X.

Rather than reaching for the mouse or switching windows, I wanted a single key press that would bring WSJT-X to the foreground and stop whatever it was doing.

The Script

The first step was creating a simple Bash script:

#!/usr/bin/env bash
WIN="$(kdotool search --name "WSJT-X v" | head -n1)"
if [ -n "$WIN" ]; then
kdotool windowactivate "$WIN"
sleep 0.1
xdotool key Escape
fi

The script searches for the WSJT-X window, activates it, and sends an Escape key press. Since Escape is mapped to Halt TX in my WSJT-X configuration, this immediately stops any active transmission.

KDE Shortcut Setup

Next, I created a custom shortcut in KDE Plasma.

Under System Settings → Keyboard → Shortcuts → Custom Shortcuts, I added a new command pointing to the script and assigned it the key combination:

Ctrl + Alt + Shift + W

Now, whenever that key combination is pressed, KDE launches the script and halts transmission.

Programming the Keychron

The final piece was assigning a dedicated key on my Keychron Q6 to send the shortcut.

Using Keychron Launcher, I selected the desired key and assigned an Any Key action with the following code:

LCTL(LALT(LSFT(KC_W)))

This causes the keyboard to send:

Ctrl + Alt + Shift + W

which KDE intercepts and routes to the script.

The Result

The finished workflow is straightforward:

Keychron Button
KDE Shortcut
Bash Script
WSJT-X
Halt TX

It’s a small quality-of-life improvement, but those are often the most satisfying projects. A spare key on the keyboard is now a dedicated “oh no, stop transmitting” button, and it works exactly the way I wanted.

As with many Linux projects, the solution ended up being a combination of several simple tools working together. That’s part of the fun.

Leave a comment