Announcement

Collapse
No announcement yet.

Adding launchers to the system tray

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Adding launchers to the system tray

    I've added a custom launcher to the kickoff menu and it works fine. I've an icon set for the launcher and ticked the option to 'Place in system tray' but this part failed to show.
    Any ideas on how to get this to work?
    Kubuntu 12.04 - Acer Aspire 5750G

    "I don't make a great deal of money, but I'm ok with that 'cause I don't hurt a lot of people in the process either"

    #2
    Launchers

    The "Place in system tray" option will add the application icon to the KDE system tray /1/ when the application is running. This is working at here.

    1. http://userbase.kde.org/Plasma/SystemTray/en


    But, if you are asking: How to add an application launching button to the KDE system tray


    ksystraycmd, it is part of the KDE.

    ksystraycmd --help
    Usage: ksystraycmd [Qt-options] [KDE-options] [options] command

    Allows any application to be kept in the system tray

    Generic options:
    --help Show help about options
    --help-qt Show Qt specific options
    --help-kde Show KDE specific options
    --help-all Show all options
    --author Show author information
    -v, --version Show version information
    --license Show license information
    -- End of options

    Arguments:
    command Command to execute

    Options:
    --window <regexp> A regular expression matching the window title
    If you do not specify one, then the very first window
    to appear will be taken - not recommended.
    --wid <int> The window id of the target window
    Specifies the id of the window to use. If the id starts with 0x
    it is assumed to be in hex.
    --hidden Hide the window to the tray on startup
    --startonshow Wait until we are told to show the window before
    executing the command
    --tooltip <text> Sets the initial tooltip for the tray icon
    --keeprunning Keep the tray icon even if the client exits. This option
    has no effect unless startonshow is specified.
    --ownicon Use ksystraycmd's icon instead of the window's icon in the systray
    (should be used with --icon to specify ksystraycmd icon)
    --ontop Try to keep the window above other windows
    --quitonhide Quit the client when we are told to hide the window.
    This has no effect unless startonshow is specified and implies keeprunning.
    Example, adding the konsole launch button with the tooltip and the own icon.

    The command:
    Code:
    ksystraycmd --startonshow --keeprunning --tooltip "Hi, I'm your terminal launcher" --ownicon --icon roll konsole
    will add the launch icon to the KDE system tray



    To add the button at the KDE start: System Settings > Startup and Shutdown.


    Other options from the repositories:

    kdocker
    Description: lets you dock any application into the system tray
    KDocker will help you dock any application into the system tray.
    This means you can dock openoffice, xmms, firefox, thunderbird, anything!
    Just point and click. Works for all NET WM compliant window managers - that
    includes KDE, GNOME, Xfce, Fluxbox and many more.
    Homepage: http://launchpad.net/kdocker
    alltray
    Description: Dock any program into the system tray
    With AllTray you can dock any application with no native tray icon
    (like Evolution, Thunderbird, Terminals) into the system tray.
    A high-light feature is that a click on the "close" button
    will minimize back to system tray. It works well with GNOME,
    KDE, Xfce 4*, Fluxbox* and WindowMaker*.
    (*) No drag 'n drop support. Enable with "-nm" option.
    Homepage: http://alltray.trausch.us/
    Last edited by OneLine; Mar 23, 2012, 05:30 AM.
    Have you tried ?

    - How to Ask a Question on the Internet and Get It Answered
    - How To Ask Questions The Smart Way

    Comment


      #3
      Thanks again for your help OneLine.

      I managed to load the launcher in the system tray using ksystraycmd just as I want, but after closing the konsole the launcher closes too.

      I used the following,

      ksystraycmd --startonshow --keeprunning --tooltip "Click to start / stop" --icon application-pgp-signature /home/kubuntu/.conky/start_stop.sh

      I tried 'setting' it via System Settings > Startup and Shutdown as a program also (it's set to autostart as a script already) but no luck that way either.

      Any idea on how to keep it in the system tray after closing the konsole?

      KDocker also works but I have no way to control where the window opens on the desk unfortunately (position seems top-left corner only).

      From what I've seen so far I think I would prefer to use ksystraycmd for this purpose. The man page suggested I could set it via a PID but I think the PID changes on each restart.
      Kubuntu 12.04 - Acer Aspire 5750G

      "I don't make a great deal of money, but I'm ok with that 'cause I don't hurt a lot of people in the process either"

      Comment


        #4
        Testing

        I don't have the Conky installed but trying this with the kdialog:


        Writing two scripts:

        systray_adder_for_start_stop.sh
        Code:
        #!/bin/bash
        
        ksystraycmd --startonshow --keeprunning --tooltip "Click to start / stop" --icon application-pgp-signature ~/Templates/start_stop.sh
        start_stop.sh
        Code:
        #!/bin/bash
        
        kdialog --sorry "Hi"
        Making them executables.

        Testing with the konsole (~/Templates/systray_adder_for_start_stop.sh)

        Adding the systray_adder_for_start_stop.sh script to the Autostart: Add Script (Create as symlink).



        Booting

        Testing



        Seems to work.


        Another way is to use the Krunner, Alt+F2 and the ksystraycmd command.

        Last edited by OneLine; Mar 23, 2012, 01:23 PM.
        Have you tried ?

        - How to Ask a Question on the Internet and Get It Answered
        - How To Ask Questions The Smart Way

        Comment


          #5
          Thanks OneLine. I managed to add the launcher to the system tray with all the function I require; on/off, tooltips all working, and set to autostart with each new session. cheers
          Kubuntu 12.04 - Acer Aspire 5750G

          "I don't make a great deal of money, but I'm ok with that 'cause I don't hurt a lot of people in the process either"

          Comment

          Working...
          X