Source code of my website
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

๐Ÿ› : add language type on code samples

+8 -8
+8 -8
content/posts/2021-02-06-xdotool-cheatsheet.md
··· 2 2 created: "2021-02-06" 3 3 date: "2021-02-06T00:00:00Z" 4 4 language: en 5 - modified: "2022-04-15" 5 + modified: "2024-01-05" 6 6 tags: 7 7 - Tools 8 8 title: xdotool cheatsheet ··· 27 27 28 28 ## get window classes 29 29 30 - ``` 30 + ```shell 31 31 xprop | grep 'CLASS' 32 32 ``` 33 33 ··· 37 37 38 38 ## find active window 39 39 40 - ``` 40 + ```shell 41 41 xdotool getactivewindow 42 42 ``` 43 43 44 44 ## find a window by class 45 45 46 - ``` 46 + ```shell 47 47 xdotool search --onlyvisible --limit 1 --class "Firefox" 48 48 ``` 49 49 50 50 ## focus a window 51 51 52 - ``` 52 + ```shell 53 53 xdotool windowactivate 123456 54 54 ``` 55 55 56 56 ## send a key 57 57 58 - ``` 58 + ```shell 59 59 xdotool search --onlyvisible --limit 1 --class "Firefox" key ctrl+t 60 60 ``` 61 61 62 62 ## send a key to firefox (by changing active window and come back) 63 63 64 - ``` 64 + ```shell 65 65 ACTIVE_WINDOW=$(xdotool getactivewindow) 66 66 FIREFOX_WINDOW=$(xdotool search --onlyvisible --limit 1 --class "Firefox") 67 67 xdotool windowactivate $FIREFOX_WINDOW ··· 71 71 72 72 ## change a window size 73 73 74 - ``` 74 + ```shell 75 75 xdotool search --onlyvisible --limit 1 --class "Firefox" windowsize 800 600 76 76 ```