Skip to content

Instantly share code, notes, and snippets.

@nevikw39
Created April 18, 2020 06:00
Show Gist options
  • Save nevikw39/dbf771953734a556b768bbc180eb02a1 to your computer and use it in GitHub Desktop.
Save nevikw39/dbf771953734a556b768bbc180eb02a1 to your computer and use it in GitHub Desktop.
以模擬方式將剪貼內容逐字輸入至 konsole 視窗,藉以獲得 p 幣。
#!/usr/bin/zsh
zmodload -i zsh/mathfunc
for pid in $(pgrep konsole); do
for window in $(xdotool search --pid $pid); do
if [[ "$(xdotool getwindowname $window)" =~ "ptt" ]]; then
xdotool type --window $window --delay $(( 666 + 1334 * rand48() )) $(xclip -o -selection clipboard);
fi
done;
done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment