Announcement

Collapse
No announcement yet.

Display output in panel icon dialog box?

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

    Display output in panel icon dialog box?

    I wrote a short bash script to change monitor configuration and then added a launcher for it to my panel. When I hover over the icon, it currently displays the name of the program. I know that I can change the text to anything, but I would really like it to display the current monitor configuration. This of course would require it to display an output of code. Is this possible?

    #2
    SysTray launcher with the Tooltip

    Earlier: http://www.kubuntuforums.net/showthr...he-system-tray


    => Reading the screen dimension and showing it as the tooltip:

    Code:
    #!/bin/bash
    
    TIP=` xdpyinfo | grep dimensions | awk -F" " '{ print $2}' `
    ksystraycmd --startonshow --keeprunning --tooltip $TIP --icon video-display konsole
    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 OneLine! Thats got me on the right track. That gets me a new icon which only displays screen info...how do I associate this tool-tip with an existing icon and program?

      Comment


        #4
        Bump

        I finally got around to doing this. The problem that Im having is that the tooltip is inactive, meaning that the tooltip remains the same although the output should change. What I would like to happen is that if both monitors are on, I would like it to display "Double" and if only one monitor is one, I want it to display "Single." On initially starting the script, the tooltip is okay, but when the monitor configuration changes the tooltip doesnt. Im guessing that the information for the tooltip is read only once when the script is run first. Is there any way to make the tooltip script active? Heres the script Im using:

        Code:
        #!/bin/bash
        
        error_exit ()
        {
          exit 1
        }
        
        
        SSTATUS=$(awk '{print}' /home/my_usernamer/bin/screenstatus.txt)
        
        case "$SSTATUS" in
          d)  TIP=$(echo "Double")
            ;;
          s)  TIP=$(echo "Single")
            ;;
          *)  error_exit
            ;;
        esac
        
        ksystraycmd --startonshow --keeprunning --tooltip $TIP --icon /usr/share/kde4/apps/desktoptheme/default/icons/change-screen-icon.svg changescreen

        Comment

        Working...
        X