Notification icons with ksystraycmd - KDE

This is a discussion on Notification icons with ksystraycmd - KDE ; Hi, On my computer, I have various scripts that run at certain times and would like to be visually notified that they have been started. For example, when my "updatedb" command is run or my hard drive performs a backup ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Notification icons with ksystraycmd

  1. Notification icons with ksystraycmd

    Hi,

    On my computer, I have various scripts that run at certain times and
    would like to be visually notified that they have been started. For
    example, when my "updatedb" command is run or my hard drive performs a
    backup of itself. It's partly for knowing that they are running when
    they're meant to and so that I know why my hard drive is going crazy.
    It would also be useful for things like auto-syncing an usb mp3 player
    when it's plugged in.

    What I would like is for a little system tray icon to appear when one
    of the above commands start and then disappear when the command ends.
    It would be nice to have some kind of feedback if the command failed
    (maybe the icon changes colour, or a simple kdialog box pop-up would
    work) but that's not a big problem.

    I've tried playing around with kstart, kdialog and ksystraycmd and
    can't get what I want working. Here's what I've tried so far:

    #!/bin/bash
    dcopRef=`ksystraycmd --hidden --icon joystick kdialog --progressbar
    Test 4`

    echo Sleeping...
    sleep 2 # Real command goes here
    echo Quitting...
    dcop $dcopRef close

    The first line starts up a kdialog command and the ksystraycmd part
    should create a system tray icon. I then grab the DCOP reference so
    that I can kill the tray icon when my command is complete. Problems
    I've found are that ksystraycmd won't return so I can get the dcop
    reference until the command (kdialog here) returns. If I use
    --progressbar, it returns immediately with a DCOP reference but no tray
    icon appears. I'm not sure what kind of feedback would be good when you
    click the system tray icon, but I'm not too bothered. I've just used a
    progress bar because ksystraycmd won't work if you don't give it a KDE
    application.

    I also tried:
    ksystraycmd --hidden --icon joystick konsole -e sleep 2

    This works ok, but you can see the konsole flashing up as it starts and
    when you click the icon the konsole will appear, so it looks quite
    hacky.


  2. Re: Notification icons with ksystraycmd

    Hi!

    Maybe your wish is related to this:
    http://bugs.kde.org/show_bug.cgi?id=98844

    RU,
    Andreas

  3. Re: Notification icons with ksystraycmd

    Quote Originally Posted by Wilson View Post
    I also tried:
    ksystraycmd --hidden --icon joystick konsole -e sleep 2

    This works ok, but you can see the konsole flashing up as it starts and
    when you click the icon the konsole will appear, so it looks quite
    hacky.

    Howdy,

    I've been trying to do something similar (display whether my laptop's firewall is enabled/disabled via an icon in the systray).

    In doing research, I stumbled upon your post and was able to tweak it to avoid the _flashing_ you noted by using the --startonshow switch to ksystraycmd

    I hope that helps .. perhaps you've already solved the issue.
    --
    pablo

+ Reply to Thread