Re: Cross-Platform Python3 Equivalent to notify-send

Discussion in 'Python' started by Chris Angelico, Jul 27, 2013.

  1. On Sat, Jul 27, 2013 at 1:22 PM, Devyn Collier Johnson
    <> wrote:
    > That really sucks. I was hoping Python had some way of doing that. All that
    > it needs to do is display a little box at one of the corners of the screen.
    > I thought someone would have implemented something by now. Thank you anyway.


    Despite the best efforts of a pretty talented core dev team, Python is
    not yet capable of magic :) If you browse the python-dev archives,
    you'll see how much of a nightmare cross-platform compatibility can be
    (eg the recent discussion on cloexec and passing file descriptors to
    subprocesses); often, what you might think (from a user's point of
    view) is fairly trivial will turn out to be quite tricky.

    That said, though, a lot of GUI toolkits will have a means for you to
    highlight a window. In GTK, it's called "present" (as in, "Lord User,
    may I present Sir Window and Mrs Window?"). There may be window
    managers that don't support the feature (and there are certainly those
    that let the user disable it, which you should respect), but AFAIK all
    of them should at least accept the command.

    http://www.pygtk.org/docs/pygtk/class-gtkwindow.html#method-gtkwindow--present

    So your best bet may be to simply create yourself a small window, then
    present it. On Windows XP, I think that'll flash the window in the
    task bar, which is usually enough highlight. On my Debian Wheezy with
    Xfce, it brings the window to the top of the Z-order, and optionally
    moves it to the current workspace (user's option, NOT program's).

    ChrisA
    Chris Angelico, Jul 27, 2013
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Devyn Collier Johnson

    Cross-Platform Python3 Equivalent to notify-send

    Devyn Collier Johnson, Jul 25, 2013, in forum: Python
    Replies:
    0
    Views:
    57
    Devyn Collier Johnson
    Jul 25, 2013
  2. Devyn Collier Johnson

    Cross-Platform Python3 Equivalent to notify-send

    Devyn Collier Johnson, Jul 27, 2013, in forum: Python
    Replies:
    1
    Views:
    85
    Kevin Walzer
    Jul 27, 2013
  3. Chris “Kwpolska†Warrick

    Re: Cross-Platform Python3 Equivalent to notify-send

    Chris “Kwpolska†Warrick, Jul 27, 2013, in forum: Python
    Replies:
    0
    Views:
    93
    Chris “Kwpolska†Warrick
    Jul 27, 2013
  4. Chris “Kwpolska†Warrick

    Re: Cross-Platform Python3 Equivalent to notify-send

    Chris “Kwpolska†Warrick, Jul 27, 2013, in forum: Python
    Replies:
    0
    Views:
    80
    Chris “Kwpolska†Warrick
    Jul 27, 2013
  5. Devyn Collier Johnson

    Re: Cross-Platform Python3 Equivalent to notify-send

    Devyn Collier Johnson, Jul 27, 2013, in forum: Python
    Replies:
    4
    Views:
    88
    Devyn Collier Johnson
    Jul 27, 2013
Loading...

Share This Page