Skip to content

Instantly share code, notes, and snippets.

@huantianad
Last active July 15, 2021 23:32
Show Gist options
  • Save huantianad/ad26920c171fb30c57666b583e3125fd to your computer and use it in GitHub Desktop.
Save huantianad/ad26920c171fb30c57666b583e3125fd to your computer and use it in GitHub Desktop.
Jank fix to discord doubleclicking

How to use:

  1. Install xbindkeys and xdotool
  2. Save .discord_forward.sh and .discord_backward.sh somewhere
  3. Add the included text to ~/.xbindkeysrc, changing the paths to where you saved them.
  4. Run xbindkeys (have it run on startup if you want)
#!/bin/bash
W=$(xdotool getactivewindow)
S=$(xprop -id "$W" | awk '/WM_CLASS/{print $4}')
if [ "$S" = '"discord"' ] || [ "$S" = '"dolphin"' ]; then
xdotool key --clearmodifiers alt+Left
else
sleep 0.12
xdotool click --window "$W" 8
fi
#!/bin/bash
W=$(xdotool getactivewindow)
S=$(xprop -id "$W" | awk '/WM_CLASS/{print $4}')
if [ "$S" = '"discord"' ] || [ "$S" = '"dolphin"' ]; then
xdotool key --clearmodifiers alt+Right
else
sleep 0.12
xdotool click --window "$W" 9
fi
"bash /path/to/.discord_backward.sh"
b:8
"bash /path/to/.discord_forward.sh"
b:9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment