├── version.txt
├── SetupLinux
└── AppImage
│ └── AppDir
│ ├── .DirIcon
│ ├── swaglyrics_pfp.png
│ ├── AppRun
│ └── SwagLyricsGUI.desktop
├── Images
├── guidark.png
├── guilight.png
└── guiswaglyrics.png
├── inno_compile.ps1
├── SwagLyricsGUI
├── swaglyrics_pfp.ico
├── Assets
│ ├── swaglyrics_pfp.ico
│ ├── Fonts
│ │ └── Roboto-Regular.ttf
│ └── Styles
│ │ └── SwagLyricsTheme.xaml
├── app.config
├── ViewModels
│ ├── ViewModelBase.cs
│ └── MainWindowViewModel.cs
├── Events
│ ├── NewSongEventArgs.cs
│ └── LyricsLoadedEventArgs.cs
├── Models
│ ├── MathEx.cs
│ ├── Fact.cs
│ ├── Command.cs
│ ├── RandomFactsFetcher.cs
│ ├── ThemeManager.cs
│ ├── BridgeManager.cs
│ ├── PrerequisitesChecker.cs
│ └── SwagLyricsBridge.cs
├── nuget.config
├── Bridge
│ ├── swaglyrics_installer.py
│ └── swaglyrics_api_bridge.py
├── App.xaml
├── App.xaml.cs
├── ViewLocator.cs
├── Program.cs
├── Views
│ ├── MainWindow.xaml.cs
│ └── MainWindow.xaml
└── SwagLyricsGUI.csproj
├── SwagLyricsGUITests
├── ModelsTests
│ └── MathExTests.cs
└── SwagLyricsGUITests.csproj
├── LICENSE.md
├── README.md
├── setup_script_win_x64.iss
├── .github
└── workflows
│ ├── linux-setup-files.yml
│ └── win-installer-action.yml
├── SwagLyricsGUI.sln
└── .gitignore
/version.txt:
--------------------------------------------------------------------------------
1 | v0.4.1
--------------------------------------------------------------------------------
/SetupLinux/AppImage/AppDir/.DirIcon:
--------------------------------------------------------------------------------
1 | swaglyrics_pfp.png
--------------------------------------------------------------------------------
/Images/guidark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwagLyrics/SwagLyricsGUI/HEAD/Images/guidark.png
--------------------------------------------------------------------------------
/Images/guilight.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwagLyrics/SwagLyricsGUI/HEAD/Images/guilight.png
--------------------------------------------------------------------------------
/Images/guiswaglyrics.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwagLyrics/SwagLyricsGUI/HEAD/Images/guiswaglyrics.png
--------------------------------------------------------------------------------
/inno_compile.ps1:
--------------------------------------------------------------------------------
1 | & "$env:userprofile\.nuget\packages\tools.innosetup\6.0.5\tools\ISCC.exe" setup_script_win_x64.iss
--------------------------------------------------------------------------------
/SwagLyricsGUI/swaglyrics_pfp.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwagLyrics/SwagLyricsGUI/HEAD/SwagLyricsGUI/swaglyrics_pfp.ico
--------------------------------------------------------------------------------
/SwagLyricsGUI/Assets/swaglyrics_pfp.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwagLyrics/SwagLyricsGUI/HEAD/SwagLyricsGUI/Assets/swaglyrics_pfp.ico
--------------------------------------------------------------------------------
/SetupLinux/AppImage/AppDir/swaglyrics_pfp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwagLyrics/SwagLyricsGUI/HEAD/SetupLinux/AppImage/AppDir/swaglyrics_pfp.png
--------------------------------------------------------------------------------
/SwagLyricsGUI/Assets/Fonts/Roboto-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwagLyrics/SwagLyricsGUI/HEAD/SwagLyricsGUI/Assets/Fonts/Roboto-Regular.ttf
--------------------------------------------------------------------------------
/SetupLinux/AppImage/AppDir/AppRun:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | HERE="$(dirname "$(readlink -f "${0}")")"
3 | export PATH="${HERE}"/usr/bin/:"${PATH}"
4 | EXEC=$(grep -e '^Exec=.*' "${HERE}"/*.desktop | head -n 1 | cut -d "=" -f 2 | cut -d " " -f 1)
5 | exec "${EXEC}" $@
6 |
--------------------------------------------------------------------------------
/SwagLyricsGUI/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/SwagLyricsGUI/ViewModels/ViewModelBase.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using ReactiveUI;
5 |
6 | namespace SwagLyricsGUI.ViewModels
7 | {
8 | public class ViewModelBase : ReactiveObject
9 | {
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/SwagLyricsGUI/Events/NewSongEventArgs.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace SwagLyricsGUI.Models
4 | {
5 | public class NewSongEventArgs : EventArgs
6 | {
7 | public string Song { get; set; }
8 |
9 | public NewSongEventArgs(string song)
10 | {
11 | Song = song;
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/SetupLinux/AppImage/AppDir/SwagLyricsGUI.desktop:
--------------------------------------------------------------------------------
1 | # Desktop Entry Specification: https://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html
2 | [Desktop Entry]
3 | Type=Application
4 | Name=SwagLyricsGUI
5 | Comment=Automatic lyrics fetcher for current spotify songs.
6 | Icon=swaglyrics_pfp
7 | Exec=SwagLyricsGUI
8 | Categories=Audio;
9 |
--------------------------------------------------------------------------------
/SwagLyricsGUI/Events/LyricsLoadedEventArgs.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace SwagLyricsGUI.Models
4 | {
5 | public class LyricsLoadedEventArgs : EventArgs
6 | {
7 | public string Lyrics { get; set; }
8 |
9 | public LyricsLoadedEventArgs(string lyrics)
10 | {
11 | Lyrics = lyrics;
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/SwagLyricsGUI/Models/MathEx.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace SwagLyricsGUI.Models
6 | {
7 | public static class MathEx
8 | {
9 | public static double Lerp(double start, double end, double t)
10 | {
11 | return (1 - t) * start + t * end;
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/SwagLyricsGUI/nuget.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/SwagLyricsGUI/Bridge/swaglyrics_installer.py:
--------------------------------------------------------------------------------
1 | import sys
2 | import subprocess
3 | import pkg_resources
4 |
5 | required = {'swaglyrics'}
6 | installed = {pkg.key for pkg in pkg_resources.working_set}
7 | missing = required - installed
8 |
9 | print("Launching...")
10 |
11 | if missing:
12 | python = sys.executable
13 | print("Installing swaglyrics...")
14 | subprocess.check_call([python, '-m', 'pip', 'install', *missing])
15 |
16 | print("Press any key to continue.")
--------------------------------------------------------------------------------
/SwagLyricsGUI/Models/Fact.cs:
--------------------------------------------------------------------------------
1 | using System.Text.Json.Serialization;
2 |
3 | namespace SwagLyricsGUI.Models
4 | {
5 | public class Fact
6 | {
7 | [JsonPropertyName("text")]
8 | public string Text { get; set; }
9 |
10 | public Fact(string text)
11 | {
12 | Text = text;
13 | }
14 |
15 | public Fact()
16 | {
17 |
18 | }
19 |
20 | public override string ToString() => Text.ToString();
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/SwagLyricsGUITests/ModelsTests/MathExTests.cs:
--------------------------------------------------------------------------------
1 | using SwagLyricsGUI.Models;
2 | using System;
3 | using Xunit;
4 |
5 | namespace SwagLyricsGUITests.Models
6 | {
7 | public class MathExTests
8 | {
9 | [Theory]
10 | [InlineData(0,1)]
11 | [InlineData(1,2)]
12 | [InlineData(100,300)]
13 | public void TestThatLerpReturnsMidpoint(double start, double end)
14 | {
15 | double result = MathEx.Lerp(start, end, 0.5);
16 | double expected = (start + end) / 2;
17 | Assert.Equal(expected, result);
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/SwagLyricsGUI/App.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/SwagLyricsGUI/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using Avalonia;
2 | using Avalonia.Controls.ApplicationLifetimes;
3 | using Avalonia.Markup.Xaml;
4 | using SwagLyricsGUI.ViewModels;
5 | using SwagLyricsGUI.Views;
6 |
7 | namespace SwagLyricsGUI
8 | {
9 | public class App : Application
10 | {
11 | public override void Initialize()
12 | {
13 | AvaloniaXamlLoader.Load(this);
14 | }
15 |
16 | public override void OnFrameworkInitializationCompleted()
17 | {
18 | if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
19 | {
20 | desktop.MainWindow = new MainWindow
21 | {
22 | DataContext = new MainWindowViewModel(),
23 | };
24 | }
25 |
26 | base.OnFrameworkInitializationCompleted();
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/SwagLyricsGUI/ViewLocator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Avalonia.Controls;
3 | using Avalonia.Controls.Templates;
4 | using SwagLyricsGUI.ViewModels;
5 |
6 | namespace SwagLyricsGUI
7 | {
8 | public class ViewLocator : IDataTemplate
9 | {
10 | public bool SupportsRecycling => false;
11 |
12 | public IControl Build(object data)
13 | {
14 | var name = data.GetType().FullName.Replace("ViewModel", "View");
15 | var type = Type.GetType(name);
16 |
17 | if (type != null)
18 | {
19 | return (Control)Activator.CreateInstance(type);
20 | }
21 | else
22 | {
23 | return new TextBlock { Text = "Not Found: " + name };
24 | }
25 | }
26 |
27 | public bool Match(object data)
28 | {
29 | return data is ViewModelBase;
30 | }
31 | }
32 | }
--------------------------------------------------------------------------------
/SwagLyricsGUI/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Avalonia;
3 | using Avalonia.Controls.ApplicationLifetimes;
4 | using Avalonia.Logging.Serilog;
5 | using Avalonia.ReactiveUI;
6 |
7 | namespace SwagLyricsGUI
8 | {
9 | class Program
10 | {
11 | // Initialization code. Don't use any Avalonia, third-party APIs or any
12 | // SynchronizationContext-reliant code before AppMain is called: things aren't initialized
13 | // yet and stuff might break.
14 | public static void Main(string[] args) => BuildAvaloniaApp()
15 | .StartWithClassicDesktopLifetime(args);
16 |
17 | // Avalonia configuration, don't remove; also used by visual designer.
18 | public static AppBuilder BuildAvaloniaApp()
19 | => AppBuilder.Configure()
20 | .UsePlatformDetect()
21 | .LogToDebug()
22 | .UseReactiveUI();
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/SwagLyricsGUITests/SwagLyricsGUITests.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp3.1
5 |
6 | false
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | all
15 | runtime; build; native; contentfiles; analyzers; buildtransitive
16 |
17 |
18 | all
19 | runtime; build; native; contentfiles; analyzers; buildtransitive
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/SwagLyricsGUI/Models/Command.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Windows.Input;
5 |
6 | namespace SwagLyricsGUI.Models
7 | {
8 | public class Command : ICommand
9 | {
10 | private Action