Skip to content

Commit ed71687

Browse files
committed
Added ability to start to tray
1 parent eb21c76 commit ed71687

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

yin_yang/__main__.py

Lines changed: 6 additions & 1 deletion
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)
@@ -139,5 +141,8 @@ def systray_icon_clicked(reason: QSystemTrayIcon.ActivationReason):
139141
logger.debug('System tray is unsupported')
140142

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

0 commit comments

Comments
 (0)