Currently using Xfce and xfce4-terminal, but suggestions involving other Linux-based systems may still be helpful.

I start a longish-running program in a terminal window, then alt-tab away and do other work. Is there a way to have a program in that session request that its window be marked 'Urgent' and/or 'Presented' to the user? When I'm writing a graphical program, say using GTK2, I can do that easily enough; it ought to be theoretically possible, but I don't know of a way to do it.

  • A combination of inotify, yad and writing a file to disk upon termination/"interesting" milestones. Jan 8, 2015 at 12:59
  • I think most people use xdotool for this kind of stuff.
    – mikeserv
    Jan 9, 2015 at 15:23

2 Answers 2


You could use wmctrl to tell the window manager to activate it (raise it and give it focus):

wmctrl -ia "$WINDOWID"
  • Thank you, that's perfect! I wasn't aware of the environment variable, and that's beautifully simple. alias present='wmctrl -ia $WINDOWID' in .bashrc and all is as it should be!
    – rosuav
    Jan 10, 2015 at 16:05

Try raising the bell:

printf '\a'

This doesn't work with all terminal emulators; I don't know about xfce4-terminal. In xterm, it's a mode (the bellIsUrgent and popOnBell resources) that can be turned on and off with control sequences, so try turning it on:

printf '\e[?1042;1043h\a'
  • The bell on its own didn't work, so I tried the other; but it seems to be an unrecognized escape code. Are those actual 0x3F question marks?
    – rosuav
    Jan 9, 2015 at 14:05
  • Ah, but thanks to that search term, I did find this: forum.xfce.org/viewtopic.php?id=6573 So I guess it's not possible, at least with that terminal emulator.
    – rosuav
    Jan 9, 2015 at 14:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .