Closed richelbilderbeek closed 8 years ago
Convert to decimal:
printf "%d\n" `wmctrl -l | egrep "Secret code" | cut -f 1 -d ' '`
Works:
xdotool windowactivate $(printf "%d\n" `wmctrl -l | egrep "Secret code" | cut -f 1 -d ' '`)
Move to the right:
xdotool windowactivate $(printf "%d\n" `wmctrl -l | egrep "Secret code" | cut -f 1 -d ' '`) keydown Right
Puts 4242 in window:
xdotool windowactivate $(printf "%d\n" `wmctrl -l | egrep "Secret code" | cut -f 1 -d ' '`) key Right key BackSpace key Right key BackSpace key Right key BackSpace key Right key BackSpace type 4242
Awesome!
See the scripts
folder for all parsing.
With
I get a list of all windows.
Say I want to get the window with text
Secret code
:This will give me a line with multiple fields.
I need the first field, which contains the window ID:
From here:
This window ID is in hex, so it must be converted: