I have this code to find a window by title,and bring it to focus:
winid=$(wmctrl -l | grep $1 | cut -f1 -d' ')
xdotool windowactivate $winid
it works for windows that are hidden by others etc. But if the window is minimized to notification area (Slack for example), I cannot bring it back in any way, tried also:
# Ensure the window is mapped (visible)
xdotool windowmap $winid 2>/dev/null
# Raise the window to the top of the stack
xdotool windowraise $winid 2>/dev/null
# Bring the window to the foreground
xdotool windowactivate $winid 2>/dev/null
# (Optional) Force refresh with wmctrl
wmctrl -i -R $winid 2>/dev/null
Does anyone have a way to do this? thanks!
Ubuntu 24.04, x11