今書いてまs
xdotoolでGUIツールの操作をする その4:マウス移動
$ xdotool getmouselocation x:447 y:419 screen:0 window:69206022 $ xdotool mousemove 100 200; xdotool getmouselocation x:100 y:200 screen:0 window:41943043 $ xdotool getmouselocation x:627 y:226 screen:0 window:69206022 $ xdotool mousemove 100 200; xdotool getmouselocation x:100 y:200 screen:0 window:41943043
xdotoolでGUIツールの操作をする その3:文字の入力
$ xdotool key a a$ a
文字はスペース区切り。
改行はリターン。エンターではない。
$ xdotool key Return $
ほかにもtypeサブコマンド
こちらも同様にシェルでやるとコマンドのほうにも文字がでる
$ xdotool type as you like asyoulike$ asyoulike
xdotoolでGUIツールの操作をする その2:ウィンドウ検索とアクティブ化
$ xdotool search --name Firefox 41943041 ... 41943113 67108865 41943043
これでは使い物にならないので「--onlyvisible」でウィンドウがあるものを表示
$ xdotool search --onlyvisible --name Firefox 41943043
開くにはwindowactivate
$ xdotool windowactivate 41943043
一個しかないとわかっている場合はインライン展開を使うと一行でかけます
$ xdotool windowactivate $(xdotool search --onlyvisible --name Firefox)
Duolingo韓国語を終わらせた
LotY (Language of the Year) 2020 @shuzo_kino - Bye Bye Moore
であった通りDuolingo韓国語をやってたのですが……これが、今日全行程が終わりました。
正確な開始時期は忘れましたが、確か9月くらいだったので、終了までおよそ九ヶ月ほどという事になります。
途中、特にハングルの読みの基礎部分をしつこめに復習したので、直線ならもっと早いかも。
ちなみにインターフェースは一挙両得を狙って中国語にしてあり、中国語の復習もかねていました。
で、肝心の効果の程ですが……
これ単体では、多くは身につかない、というのが私の結論です。
特に、アウトプット不足が重い印象。
これは手元端末にハングル入力入れてないのも理由なんですが。
xdotoolでGUIツールの操作をする その1:導入
一時、ネットゲームでボット行為といって自動的にモンスターを倒し続け寝てる間にレベルアップ~なんてのが流行った事があります。
xdotoolは業務でもそういったアレができるようになるツールです。
ソコソコ歴史のあるツールで、ネットを探すと古いサイトなんかにも事例があったりします。
面白い応用として、イラストツールで正確な渦巻きをイラストツールのペンで描く……なんてのがあります。
x=0;y=0;while [[ $y -lt 500 ]] ; do xdotool mousemove --polar $x $y ; x=$(($x+4));y=$(($y+1)); sleep 0.01; done # Move your mouse from the command line in a perfect spiral using the xdotool and polar coordinates. #krita pic.twitter.com/uawzNQOqey
— Command Line Magic (@climagic) 2020年4月10日
【読書メモ】大東京トイボックス【デジタルリマスター版】(1)
大東京トイボックス【デジタルリマスター版】(1) (スタジオG3)
- 作者:うめ(小沢高広・妹尾朝子)
- 発売日: 2019/12/27
- メディア: Kindle版