Repository navigation
Expand file tree
/
Copy pathProgram.cs
More file actions
48 lines (45 loc) · 1.42 KB
/
Copy pathProgram.cs
File metadata and controls
48 lines (45 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/* SPDX-License-Identifier: MPL-2.0
* Copyright (c) 2026 1R1an1 */
using Avalonia;
using MediaPlayer.TUI;
using System;
using System.Linq;
using TermFlow.Core;
namespace MediaPlayer;
class Program
{
// Initialization code. Don't use any Avalonia, third-party APIs or any
// SynchronizationContext-reliant code before AppMain is called: things aren't initialized
// yet and stuff might break.
[STAThread]
public static int Main(string[] args)
{
if (args?.FirstOrDefault() == "--tui")
{
PlayerTUI.Start(args[1..]);
return 0;
}
else if (args?.FirstOrDefault() == "--nogui")
{
BasicTUI.Start(args[1..]);
return 0;
}
else if (OperatingSystem.IsLinux() && string.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("DISPLAY")))
{
Console.Error.WriteLine($"{ThemeColors.Error}No hay DISPLAY disponible, usando BasicTUI{ThemeColors.Reset}");
BasicTUI.Start(args);
return 0;
}
else
return BuildAvaloniaApp().StartWithClassicDesktopLifetime(args);
}
// Avalonia configuration, don't remove; also used by visual designer.
public static AppBuilder BuildAvaloniaApp()
=> AppBuilder.Configure<App>()
.UsePlatformDetect()
#if DEBUG
.WithDeveloperTools()
#endif
.WithInterFont()
.LogToTrace();
}