Beispiel #1
0
        public static void Main(string[] args)
        {
            Logging.Configure();

            Log.Information("Windows Terminal Quake started");

            _trayIcon = new TrayIcon((s, a) => Close());

            try
            {
                TerminalProcess.OnExit(() => Close());

                _toggler = new Toggler(args);

                // Transparency
                QSettings.Get(s => TerminalProcess.Get(args).SetTransparency(s.Opacity));

                var hotkeys = string.Join(" or ", QSettings.Instance.Hotkeys.Select(hk => $"{hk.Modifiers}+{hk.Key}"));

                _trayIcon.Notify(ToolTipIcon.Info, $"Windows Terminal Quake is running, press {hotkeys} to toggle.");
            }
            catch (Exception ex)
            {
                Log.Logger.Warning(ex, $"Error: {ex.Message}");

                MessageBox.Show($"Error starting Windows Terminal Quake: {ex.Message}", "Ah nej :(");

                Close();
            }
        }
        public static void Main(string[] args)
        {
            Logging.Configure();

            _trayIcon = new TrayIcon((s, a) => Close());

            try
            {
                TerminalProcess.OnExit(() => Close());

                _toggler = new Toggler();

                // Transparency
                Settings.Get(s =>
                {
                    TransparentWindow.SetTransparent(TerminalProcess.Get(), s.Opacity);
                });

                var hks = string.Join(" or ", Settings.Instance.Hotkeys.Select(hk => $"{hk.Modifiers}+{hk.Key}"));

                _trayIcon.Notify(ToolTipIcon.Info, $"Windows Terminal Quake is running, press {hks} to toggle.");
            }
            catch (Exception ex)
            {
                Log.Logger.Warning(ex, $"Error: {ex.Message}");
                _trayIcon.Notify(ToolTipIcon.Error, $"Cannot start: '{ex.Message}'.");

                Close();
            }
        }