Skip to content

Commit

Permalink
Merge pull request #265 from SlowNicoFish/start_minimized
Browse files Browse the repository at this point in the history
Added ability to start to tray
  • Loading branch information
l0drex committed Feb 13, 2024
2 parents 1902eed + 082a203 commit 824b4a6
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions yin_yang/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ def systray_icon_clicked(reason: QSystemTrayIcon.ActivationReason):
help='toggles Yin-Yang',
action='store_true')
parser.add_argument('--systemd', help='uses systemd journal handler and applies desired theme', action='store_true')
parser.add_argument('--minimized', help='starts the program to tray bar', action='store_true')
arguments = parser.parse_args()
setup_logger(arguments.systemd)

Expand All @@ -81,6 +82,7 @@ def systray_icon_clicked(reason: QSystemTrayIcon.ActivationReason):
elif arguments.systemd:
theme_switcher.set_desired_theme()


else:
# load GUI
config.add_event_listener(ConfigEvent.SAVE, daemon_handler.watcher)
Expand Down Expand Up @@ -138,6 +140,9 @@ def systray_icon_clicked(reason: QSystemTrayIcon.ActivationReason):
else:
logger.debug('System tray is unsupported')

window = main_window_connector.MainWindow()
window.show()
sys.exit(app.exec())
if arguments.minimized:
sys.exit(app.exec())
else:
window = main_window_connector.MainWindow()
window.show()
sys.exit(app.exec())

0 comments on commit 824b4a6

Please sign in to comment.