diff --git a/CHANGELOG.md b/CHANGELOG.md index 3307ae2a..12532f2d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,7 +42,11 @@ updates: check_interval: 30 # old '--check-interval' ``` -- The default update checking interval is now 30 seconds +- The default update checking interval is now 30 seconds +- New tray icons loading priority: + 1) Icon paths defined in **~/.config/bauh/config.yml** + 2) Icons from the system with the following names: `bauh_tray_default` and `bauh_tray_updates` + 3) Own packaged icons - AppImage: - cleaning the downloaded database files when **--reset** is passed as parameter - environment variables **BAUH_APPIMAGE_DB_UPDATER** and **BAUH_APPIMAGE_DB_UPDATER_TIME** dropped in favor of the new configuration file located at **~/.config/bauh/appimage.yml** diff --git a/README.md b/README.md index 36a6a2e2..0cc67255 100644 --- a/README.md +++ b/README.md @@ -218,6 +218,11 @@ updates: check_interval: 30 # the updates checking interval in SECONDS ``` +#### Tray icons +Priority: + 1) Icon paths defined in **~/.config/bauh/config.yml** + 2) Icons from the system with the following names: `bauh_tray_default` and `bauh_tray_updates` + 3) Own packaged icons ### How to improve the performance - Disable package types that you do not want to deal with ( via GUI ) diff --git a/bauh/view/qt/systray.py b/bauh/view/qt/systray.py index a20fb61d..dfd986b0 100755 --- a/bauh/view/qt/systray.py +++ b/bauh/view/qt/systray.py @@ -41,8 +41,22 @@ class TrayIcon(QSystemTrayIcon): self.i18n = i18n self.manager = manager - self.icon_default = QIcon(config['ui']['tray']['default_icon'] or resource.get_path('img/logo.png')) - self.icon_update = QIcon(config['ui']['tray']['updates_icon'] or resource.get_path('img/logo_update.png')) + if config['ui']['tray']['default_icon']: + self.icon_default = QIcon(config['ui']['tray']['default_icon']) + else: + self.icon_default = QIcon.fromTheme('bauh_tray_default') + + if self.icon_default.isNull(): + self.icon_default = QIcon(resource.get_path('img/logo.png')) + + if config['ui']['tray']['updates_icon']: + self.icon_updates = QIcon(config['ui']['tray']['updates_icon']) + else: + self.icon_updates = QIcon.fromTheme('bauh_tray_updates') + + if self.icon_updates.isNull(): + self.icon_updates = QIcon(resource.get_path('img/logo_update.png')) + self.setIcon(self.icon_default) self.menu = QMenu() @@ -94,7 +108,7 @@ class TrayIcon(QSystemTrayIcon): if len(updates) > 0: update_keys = {'{}:{}:{}'.format(up.type, up.id, up.version) for up in updates} - new_icon = self.icon_update + new_icon = self.icon_updates if update_keys.difference(self.last_updates): self.last_updates = update_keys