# Getting rid of hp-systray

## Maf

Hi there. Can someone tell me how do I really need hp-systray running? How can I disable it from running and docking it in KDE3's systray?

----------

## ppurka

It runs automatically because it puts a file in /etc/xdg/autostart. If you don't want it to run automatically, just open the file /etc/xdg/autostart/hplip-systray.desktop and change the Exec line to

```
Exec=echo hp-systray --qt4
```

----------

## Maf

This unfortunately didn't help.

```
$ cat /etc/xdg/autostart/hplip-systray.desktop

[Desktop Entry]

Version=0.6

Type=Application

Name=HP System Tray Service

GenericName=Printer Status Applet

Comment=HP System Tray Service

Exec=echo hp-systray --qt4

Icon=/usr/share/hplip/data/images/128x128/hp_logo.png

Terminal=false

Categories=Application;Utility;

X-KDE-StartupNotify=false

StartupNotify=false
```

Any other TIP?

----------

## Maf

*BUMP*

----------

## Martux

Remove it?

----------

## Maf

 *Martux wrote:*   

> Remove it?

 

Can I do it in a more subtle way?

----------

## ppurka

 *Maf wrote:*   

>  *Martux wrote:*   Remove it? 
> 
> Can I do it in a more subtle way?

 If the modification I provided does not work, it means either

1. kde has stored hp-systray in its session and it therefore starts it automatically

2. hp-systray is being started by some other script or some other file. You will have to search for that file in this case.

If you have done the modification I suggested, there is no way that /etc/xdg/* file is starting hp-systray now.

----------

## Maf

Well:

```
maf@firebird ~ $ grep -R hp-systray .hplip/

maf@firebird ~ $ grep -R hp-systray .kde3.5/Autostart/

maf@firebird ~ $ grep -R hp-systray .kde3.5/share/

maf@firebird ~ $
```

So it doesn't seem to be stored anywhere in here. However:

```
maf@firebird ~ $ grep -R hp-systray /usr/share/|grep -v binarny|nl

grep: /usr/share/mimelnk: Brak dostępu

     1  /usr/share/doc/hplip-3.9.8/html/index.html:<a href="systray.html"><li>About HP Status Service "system tray" icon (hp-systray)</li></a><br><br>

     2  /usr/share/doc/hplip-3.9.8/html/commandline.html:variables and options.<br><p>If you run the command with&nbsp;-h you will get help on using the application.</p><p><span style="font-style: italic;">hp-align</span> - performs the align cartridges function (certain printers only)</p><p><span style="font-style: italic;">hp-check</span> - checks the system for the current status of HPLIP<br></p><span style="font-style: italic;">hp-clean</span> - performs the clean cartridges function. (certain printers only)<br><br style="font-style: italic;"><span style="font-style: italic;">hp-colorcal</span> - perform the color cartridge function. (certain printers only)<br><br><span style="font-style: italic;">hp-fab</span> - opens the fax address book<br><br style="font-style: italic;"><span style="font-style: italic;">hp-firmware</span> - downloads the firmware to the printer (if supported)<br><br style="font-style: italic;"><span style="font-style: italic;">hp-info</span> - display printer information and status<br><br><span style="font-style: italic;">hp-levels</span> - displays the current ink cartridge level<br><br><span style="font-style: italic;">hp-makecopies</span> - starts the make copies application (certain printers only)<br><br><span style="font-style: italic;">hp-makeuri</span> - creates device URI's for use with cups<br><br><span style="font-style: italic;">hp-print</span> - starts the hplip print application<br><br><span style="font-style: italic;">hp-probe</span> - discovers attached usb, parallel, and network printers<br><br style="font-style: italic;"><span style="font-style: italic;">hp-scan</span> - starts the hplip scan utility (interactive only no GUI)<br><br><span style="font-style: italic;">hp-sendfax</span> - starts the send fax application (certain printers only)<br><br><span style="font-style: italic;">hp-setup</span> - used to configure and install a printer or another printer queue<br><br><span style="font-style: italic;">hp-systray</span> - starts the hplip systray tool, this is started automatically when hp-toolbox is run<br><br style="font-style: italic;"><span style="font-style: italic;">hp-testpage</span> - sends a test page to the printer<br><br><span style="font-style: italic;">hp-timedate </span>- sets the time and date on the printer (certain printers only)<br><br><span style="font-style: italic;">hp-toolbox</span> - starts the hp device manager application used to access most of the hplip tools<br><br><span style="font-style: italic;">hp-unload</span> - used to access the printer photo cards, not all printers are supported (certain printers only)<br><br></div>

     3  /usr/share/hplip/systray.py:__mod__ = 'hp-systray'

     4  /usr/share/hplip/systray.py:        log.error("hp-systray cannot be run as root. Exiting.")

     5  /usr/share/hplip/hpssd.py:    log.set_module("hp-systray(hpssd)")

     6  /usr/share/hplip/ui4/settingsdialog.py:        # TODO: Need a way to signal hp-systray if systray_visible has changed

     7  /usr/share/hplip/ui4/settingsdialog_base.py:"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-weight:600;\">Configure the behavior of the HP Status Service (hp-systray)</span></p></body></html>", None, QtGui.QApplication.UnicodeUTF8))

     8  /usr/share/hplip/ui4/systemtray.py:    log.set_module("hp-systray(qt4)")

     9  /usr/share/hplip/ui4/sendfaxdialog.py:            FailureUI(self, self.__tr("<b>PC send fax support requires DBus and hp-systray.</b><p>Please check the HPLIP installation for proper installation of DBus and hp-systray support.</p><p>Click <i>OK</i> to exit.</p>"))

    10  /usr/share/hplip/base/device.py:            path = utils.which('hp-systray')

    11  /usr/share/hplip/base/device.py:                path = os.path.join(path, 'hp-systray')

    12  /usr/share/hplip/base/device.py:                    log.warn("Unable to start hp-systray")

    13  /usr/share/hplip/base/device.py:            log.debug("Running hp-systray: %s --force-startup --qt4" % path)

    14  /usr/share/hplip/base/device.py:            os.spawnlp(os.P_NOWAIT, path, 'hp-systray', '--force-startup', '--qt4')

    15  /usr/share/hplip/base/device.py:            log.debug("Waiting for hp-systray to start...")

    16  /usr/share/hplip/base/device.py:                    log.debug("Unable to connect to dbus. Is hp-systray running?")

    17  /usr/share/hplip/base/device.py:                        log.warn("Unable to connect to dbus. Is hp-systray running?")

    18  /usr/share/hplip/base/codes.py:EVENT_HISTORY_UPDATE = 9003 # sent by hp-systray to hp-toolbox when a device's history changes

    19  /usr/share/hplip/sendfax.py:            log.error("Unable to initialize dBus. PC send fax requires dBus and hp-systray support. Exiting.")

    20  /usr/share/hplip/sendfax.py:                            log.error("Cannot communicate with hp-systray. Canceling...")

    21  /usr/share/hplip/installer/core_install.py:            'python-notify' :   (False, ['gui_qt4'], "Python libnotify - Python bindings for the libnotify Desktop notifications", self.check_pynotify, DEPENDENCY_RUN_TIME), # Optional for libnotify style popups from hp-systray

    22  /usr/share/hplip/hpdio.py:        log.set_module("hp-systray(hpdio)")
```

So is it '/usr/share/hplip/base/device.py' that starts this tray crap?

----------

## Plague.CZ

I'm removing /etc/xdg/autostart after the emerging.

Is it possible to make a use-flag for this? This is windows-like behaviour and it's terrible...

----------

## prote

 *Maf wrote:*   

> Hi there. Can someone tell me how do I really need hp-systray running? How can I disable it from running and docking it in KDE3's systray?

 

net-print/hplip installs two autostart files:

- /etc/xdg/autostart/hplip-systray.desktop (used by kde4)

- /usr/kde/3.5/share/autostart/hplip-systray.desktop(used by kde3)

According to http://standards.freedesktop.org/autostart-spec/autostart-spec-latest.html these should be ignored when I create a file ~/.config/autostart/hplip-systray.desktop with content:

```
Desktop Entry]

Hidden=true

```

But by testing I found that

- kde3.5 does not obey ~/.config/autostart/ (but kde4 does IIRC)

- kde3.5 also does not use ~/.kde[3.5]/share/config/autostart/

- kde3.5 only obeys ~/.kde[3.5]/share/autostart/

To avoid duplicates I created ~/.config/autostart/hplip-systray.desktop with the above content and then did

```
cd ~/.kde3.5/share/

ln -s ~/.config/autostart

```

----------

## Etal

There's a guide on gentoo-wiki, similar to what prote says: http://en.gentoo-wiki.com/wiki/Hide_the_HPLIP_system_tray_icon

----------

## Maf

Well if anyone is still annoyed by hp-systray, this helped:

```
USE="-kde -qt4 -X -libnotify" emerge hplip
```

----------

