Skip to content

Commit 824b4a6

Browse files
authored
Merge pull request #265 from SlowNicoFish/start_minimized
Added ability to start to tray
2 parents 1902eed + 082a203 commit 824b4a6

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

yin_yang/__main__.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ def systray_icon_clicked(reason: QSystemTrayIcon.ActivationReason):
6969
help='toggles Yin-Yang',
7070
action='store_true')
7171
parser.add_argument('--systemd', help='uses systemd journal handler and applies desired theme', action='store_true')
72+
parser.add_argument('--minimized', help='starts the program to tray bar', action='store_true')
7273
arguments = parser.parse_args()
7374
setup_logger(arguments.systemd)
7475

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

85+
8486
else:
8587
# load GUI
8688
config.add_event_listener(ConfigEvent.SAVE, daemon_handler.watcher)
@@ -138,6 +140,9 @@ def systray_icon_clicked(reason: QSystemTrayIcon.ActivationReason):
138140
else:
139141
logger.debug('System tray is unsupported')
140142

141-
window = main_window_connector.MainWindow()
142-
window.show()
143-
sys.exit(app.exec())
143+
if arguments.minimized:
144+
sys.exit(app.exec())
145+
else:
146+
window = main_window_connector.MainWindow()
147+
window.show()
148+
sys.exit(app.exec())

0 commit comments

Comments
 (0)