You are not logged in.
I want to set focus to the specified window in my program so that users can start typing directly in the terminal.
I'm using dwm, st and sxiv in Arch. The program is started in st, then at a certain point images will be shown in sxiv, which will grab the focus, but the user need to type something in st. So I need to ensure that the windows focus will be set back to st.
I get the windows id of st by
winid=$(xprop -root _NET_ACTIVE_WINDOW | cut -d' ' -f5)
Then after starting sxiv, I try to give focus back to st by
xdotool windowfocus "$winid"
But it doesn't work. I also experimented this method manually by starting several terminal windows and try to switch focus with xdotool. Nothing worked.
Any suggestions?
Offline
dwm looks sort of ewmh compatible, try wmctrl instead.
Offline