Skip to content

Instantly share code, notes, and snippets.

@hook-s3c
Created June 21, 2019 19:29
Show Gist options
  • Select an option

  • Save hook-s3c/3b3adeca6af2602fc34e26ff400197e2 to your computer and use it in GitHub Desktop.

Select an option

Save hook-s3c/3b3adeca6af2602fc34e26ff400197e2 to your computer and use it in GitHub Desktop.
Cleaning Discord chats
#!/bin/bash
#if test "$#" -ne 2;
# then echo "example usage: ./cleandiscord.sh general 30"
# exit 1
#fi
#WID=`xdotool search --onlyvisible --name "$1" | head -1`
#xdotool windowactivate --sync $WID
xdotool windowactivate --sync $(xdotool selectwindow)
xdotool getactivewindow key --repeat $1 --delay 40 --repeat-delay 20 Up Ctrl+a Delete Return Return
#xdotool getactivewindow key --repeat 30 --delay 300 --repeat-delay 400 Up Ctrl+a Delete Return Return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment