2 ms·
You can define shortcuts for that: nth=1; wmctrl -i -a $( wmctrl -l | awk '$2 == "0" { print $1 }' | sed -n "${nth}p" ) I guess you would need 9 shortcuts
by mxmlnkn 3y ago
You can define shortcuts for that:
nth=1; wmctrl -i -a $( wmctrl -l | awk '$2 == "0" { print $1 }' | sed -n "${nth}p" )
I guess you would need 9 shortcuts and you would set nth to the number associated with that shortcut. Works for me at least. You might have to define the shortcut to "bash -c " followed by the above oneliner with some appropriate quoting and escaping of inner quotes.
- izoow 3y agoThis is what I'm doing right now, but the issue is that it'll only work as long as the order in the taskbar and the window manager list stay consistent. I like to manually reorder my windows in the taskbar and that makes this approach break.
- mxmlnkn 3y agoYou could use wmctrl -l -p to also get the pids and then get the start times for each PID with ps -p $$ -o lstart. Then you could sort by start time and only then choose the nth window. There still might be multiple windows belonging to the same pid, though. And if you close windows, the list might still change. You could also hardcode win+1-9 to specific programs, then they would even be consistent over restarts. Then again, the docklike plugin mentioned in the other answer might be similar to that.