1
Fork 0

Rename to drg-auto-type and simplify logic.

This commit is contained in:
Bauke 2023-04-23 14:17:41 +02:00
parent 88ac53db00
commit c43d003a69
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
1 changed files with 15 additions and 0 deletions

15
.bauke/bin/drg-auto-type Executable file
View File

@ -0,0 +1,15 @@
#!/usr/bin/env zsh
# Automatically type something in Deep Rock Galactic when it is the
# currently active window, text defaults to "r".
# drg-auto-type [text]
drg_pid=$(xdotool search --name 'Deep Rock Galactic' getwindowpid)
active_window_pid=$(xdotool getactivewindow getwindowpid)
if [[ $drg_pid = $active_window_pid ]]; then
sleep 0.1
xdotool key Enter
xdotool type ${1-'r'}
xdotool key Enter
fi