Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add multi-resolution icons to AppImage #181

Merged
merged 5 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 29 additions & 3 deletions Builders/LinuxBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,40 @@ public override Uploader CreateUploader()
return new LinuxVelopackUploader(app_name, os_name, RuntimeIdentifier, RuntimeIdentifier, extraArgs: extra_args, stagingPath: stagingTarget);
}

// https://learn.microsoft.com/en-us/dotnet/standard/io/how-to-copy-directories
static void CopyDirectory(string sourceDir, string destinationDir, bool recursive)
{
var dir = new DirectoryInfo(sourceDir);

if (!dir.Exists)
throw new DirectoryNotFoundException($"Source directory not found: {dir.FullName}");

DirectoryInfo[] dirs = dir.GetDirectories();

Directory.CreateDirectory(destinationDir);

foreach (FileInfo file in dir.GetFiles())
{
string targetFilePath = Path.Combine(destinationDir, file.Name);
file.CopyTo(targetFilePath);
}

if (recursive)
{
foreach (DirectoryInfo subDir in dirs)
{
string newDestinationDir = Path.Combine(destinationDir, subDir.Name);
CopyDirectory(subDir.FullName, newDestinationDir, true);
}
}
}

public override void Build()
{
if (Directory.Exists(stagingTarget))
Directory.Delete(stagingTarget, true);
Directory.CreateDirectory(stagingTarget);

foreach (var file in Directory.GetFiles(Path.Combine(Program.TemplatesPath, app_dir)))
new FileInfo(file).CopyTo(Path.Combine(stagingTarget, Path.GetFileName(file)));
CopyDirectory(Path.Combine(Program.TemplatesPath, app_dir), stagingTarget, true);

Program.RunCommand("chmod", $"+x {stagingTarget}/AppRun");

Expand Down
2 changes: 1 addition & 1 deletion templates/osu!.AppDir/osu!.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Version=1.5
Type=Application
Name=osu!
Comment=A free-to-win rhythm game. Rhythm is just a *click* away!
Icon=osu!
Icon=osu
Exec=osu! %u
Terminal=false
MimeType=application/x-osu-beatmap-archive;application/x-osu-skin-archive;application/x-osu-beatmap;application/x-osu-storyboard;application/x-osu-replay;x-scheme-handler/osu;
Expand Down
Binary file added templates/osu!.AppDir/osu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading