I want to force emacs to be activated, be bought to frond and 'steal' focus in certain circumstances. E.g when I finish a org-Pomodoro or during an important appointment reminder.
Now, I'm looking for a 'native' way to do so, just to reduce external dependencies. (just Linux is ok for me, cross-platform would be better).
Is this technically possible from inside emacs?
If using the GUI, this works well:
[For historical reasons...] I have tried:
Frame visibility (doesn't work)
But these seem to only work if Emacs is already activated.
Frame raising (doesn't work)
Lowering frame seems to actually hide emacs.
But raising the frame from a timer doesn't. I.e, nothing happens.
It seems there is a missing 'activate-emacs' before raising it.
[NOTE on external solution]
Currently, as a (workaround/solution?) I use a bit of elisp:
And the respective bash script: (you may need to install xdotool on your system first)
#!/bin/sh sleep 0.5 xdotool search --onlyvisible --class emacs windowactivate