2023-04-23 12:17:41 +00:00
|
|
|
#!/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
|
2023-05-02 11:15:30 +00:00
|
|
|
sleep 0.25
|
2023-04-23 12:17:41 +00:00
|
|
|
xdotool key Enter
|
|
|
|
xdotool type ${1-'r'}
|
|
|
|
xdotool key Enter
|
|
|
|
fi
|