Changed gigabyte tarball to raise logo
|
@ -26,6 +26,7 @@ It aims to replace default Grub look, with nice and colorful theme.
|
|||
- Rocky Linux
|
||||
- Solus
|
||||
- Ubuntu
|
||||
- Ubuntu Mate
|
||||
- Ventoy
|
||||
- Void Linux
|
||||
- Windows 10
|
||||
|
@ -83,13 +84,14 @@ It aims to replace default Grub look, with nice and colorful theme.
|
|||
</p>
|
||||
<p float="left">
|
||||
<img src="https://raw.githubusercontent.com/AdisonCavani/distro-grub-themes/master/preview/Ubuntu.png" width="49%"/>
|
||||
<img src="https://raw.githubusercontent.com/AdisonCavani/distro-grub-themes/master/preview/UbuntuMate.png" width="49%"/>
|
||||
</p>
|
||||
<p float="left">
|
||||
<img src="https://raw.githubusercontent.com/AdisonCavani/distro-grub-themes/master/preview/Void%20Linux.png" width="49%"/>
|
||||
</p>
|
||||
<p float="left">
|
||||
<img src="https://raw.githubusercontent.com/AdisonCavani/distro-grub-themes/master/preview/Ventoy.png" width="49%"/>
|
||||
<img src="https://raw.githubusercontent.com/AdisonCavani/distro-grub-themes/master/preview/Windows%2010.png" width="49%"/>
|
||||
</p>
|
||||
<p float="left">
|
||||
<img src="https://raw.githubusercontent.com/AdisonCavani/distro-grub-themes/master/preview/Windows%2010.png" width="49%"/>
|
||||
<img src="https://raw.githubusercontent.com/AdisonCavani/distro-grub-themes/master/preview/ZorinOS.png" width="49%"/>
|
||||
</p>
|
||||
|
||||
|
|
BIN
assets/background_template/mate_1080p.psd
Normal file
BIN
assets/icons/mate.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
assets/preview_template/mate_1080p.psd
Normal file
BIN
customize/mate/background.png
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
customize/mate/icons/4MLinux.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
customize/mate/icons/AlpineLinux.png
Normal file
After Width: | Height: | Size: 818 B |
BIN
customize/mate/icons/Manjaro.i686.png
Normal file
After Width: | Height: | Size: 372 B |
BIN
customize/mate/icons/Manjaro.x86_64.png
Normal file
After Width: | Height: | Size: 372 B |
BIN
customize/mate/icons/SystemRescueCD.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
customize/mate/icons/android.png
Normal file
After Width: | Height: | Size: 977 B |
BIN
customize/mate/icons/anonymous.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
customize/mate/icons/antergos.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
customize/mate/icons/arch.png
Normal file
After Width: | Height: | Size: 865 B |
BIN
customize/mate/icons/archlinux.png
Normal file
After Width: | Height: | Size: 865 B |
BIN
customize/mate/icons/arcolinux.png
Normal file
After Width: | Height: | Size: 467 B |
BIN
customize/mate/icons/artix.png
Normal file
After Width: | Height: | Size: 4.1 KiB |
BIN
customize/mate/icons/cancel.png
Normal file
After Width: | Height: | Size: 525 B |
BIN
customize/mate/icons/centos.png
Normal file
After Width: | Height: | Size: 3.8 KiB |
BIN
customize/mate/icons/chakra.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
customize/mate/icons/debian.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
customize/mate/icons/deepin.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
customize/mate/icons/devuan.png
Normal file
After Width: | Height: | Size: 772 B |
BIN
customize/mate/icons/driver.png
Normal file
After Width: | Height: | Size: 777 B |
BIN
customize/mate/icons/edit.png
Normal file
After Width: | Height: | Size: 402 B |
BIN
customize/mate/icons/efi.png
Normal file
After Width: | Height: | Size: 699 B |
BIN
customize/mate/icons/elementary.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
customize/mate/icons/endeavouros.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
customize/mate/icons/fedora.png
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
customize/mate/icons/find.efi.png
Normal file
After Width: | Height: | Size: 683 B |
BIN
customize/mate/icons/find.none.png
Normal file
After Width: | Height: | Size: 792 B |
BIN
customize/mate/icons/freebsd.png
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
customize/mate/icons/garuda.png
Normal file
After Width: | Height: | Size: 4 KiB |
BIN
customize/mate/icons/gentoo.png
Normal file
After Width: | Height: | Size: 847 B |
BIN
customize/mate/icons/gnu-linux.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
customize/mate/icons/haiku.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
customize/mate/icons/help.png
Normal file
After Width: | Height: | Size: 464 B |
BIN
customize/mate/icons/kali.png
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
customize/mate/icons/kaos.png
Normal file
After Width: | Height: | Size: 979 B |
BIN
customize/mate/icons/kbd.png
Normal file
After Width: | Height: | Size: 454 B |
BIN
customize/mate/icons/korora.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
customize/mate/icons/kubuntu.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
customize/mate/icons/lang.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
customize/mate/icons/lfs.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
customize/mate/icons/linux.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
customize/mate/icons/linuxmint.png
Normal file
After Width: | Height: | Size: 735 B |
BIN
customize/mate/icons/lubuntu.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
customize/mate/icons/macosx.png
Normal file
After Width: | Height: | Size: 864 B |
BIN
customize/mate/icons/mageia.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
customize/mate/icons/manjaro.png
Normal file
After Width: | Height: | Size: 372 B |
BIN
customize/mate/icons/memtest.png
Normal file
After Width: | Height: | Size: 777 B |
BIN
customize/mate/icons/mx-linux.png
Normal file
After Width: | Height: | Size: 958 B |
BIN
customize/mate/icons/neon.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
customize/mate/icons/opensuse.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
customize/mate/icons/parrot.png
Normal file
After Width: | Height: | Size: 795 B |
BIN
customize/mate/icons/pop-os.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
customize/mate/icons/pop.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
customize/mate/icons/recovery.png
Normal file
After Width: | Height: | Size: 691 B |
BIN
customize/mate/icons/regolith.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
customize/mate/icons/restart.png
Normal file
After Width: | Height: | Size: 693 B |
BIN
customize/mate/icons/rocky.png
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
customize/mate/icons/shutdown.png
Normal file
After Width: | Height: | Size: 893 B |
BIN
customize/mate/icons/siduction.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
customize/mate/icons/solus.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
customize/mate/icons/steamos.png
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
customize/mate/icons/type.png
Normal file
After Width: | Height: | Size: 369 B |
BIN
customize/mate/icons/tz.png
Normal file
After Width: | Height: | Size: 802 B |
BIN
customize/mate/icons/ubuntu.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
customize/mate/icons/unknown.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
customize/mate/icons/unset.png
Normal file
After Width: | Height: | Size: 636 B |
BIN
customize/mate/icons/ventoy.png
Normal file
After Width: | Height: | Size: 4 KiB |
BIN
customize/mate/icons/void.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
customize/mate/icons/windows.png
Normal file
After Width: | Height: | Size: 582 B |
BIN
customize/mate/icons/xubuntu.png
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
customize/mate/icons/zorin.png
Normal file
After Width: | Height: | Size: 799 B |
BIN
customize/mate/select_c.png
Normal file
After Width: | Height: | Size: 161 B |
BIN
customize/mate/select_e.png
Normal file
After Width: | Height: | Size: 219 B |
BIN
customize/mate/select_w.png
Normal file
After Width: | Height: | Size: 211 B |
BIN
customize/mate/terminal_box_c.png
Normal file
After Width: | Height: | Size: 976 B |
BIN
customize/mate/terminal_box_e.png
Normal file
After Width: | Height: | Size: 952 B |
BIN
customize/mate/terminal_box_n.png
Normal file
After Width: | Height: | Size: 963 B |
BIN
customize/mate/terminal_box_ne.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
customize/mate/terminal_box_nw.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
customize/mate/terminal_box_s.png
Normal file
After Width: | Height: | Size: 963 B |
BIN
customize/mate/terminal_box_se.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
customize/mate/terminal_box_sw.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
customize/mate/terminal_box_w.png
Normal file
After Width: | Height: | Size: 952 B |
BIN
customize/mate/terminus-12.pf2
Normal file
BIN
customize/mate/terminus-14.pf2
Normal file
BIN
customize/mate/terminus-16.pf2
Normal file
BIN
customize/mate/terminus-18.pf2
Normal file
42
customize/mate/theme.txt
Normal file
|
@ -0,0 +1,42 @@
|
|||
# Main options
|
||||
title-text: ""
|
||||
desktop-image: "background.png"
|
||||
desktop-color: "#000000"
|
||||
terminal-font: "Terminus Regular 14"
|
||||
terminal-box: "terminal_box_*.png"
|
||||
terminal-left: "0"
|
||||
terminal-top: "0"
|
||||
terminal-width: "100%"
|
||||
terminal-height: "100%"
|
||||
terminal-border: "0"
|
||||
|
||||
# Boot menu
|
||||
+ boot_menu {
|
||||
left = 15%
|
||||
top = 40%
|
||||
width = 27%
|
||||
height = 65%
|
||||
item_font = "Ubuntu Regular 20"
|
||||
item_color = "#cccccc"
|
||||
selected_item_color = "#ffffff"
|
||||
icon_width = 36
|
||||
icon_height = 36
|
||||
item_icon_space = 20
|
||||
item_height = 40
|
||||
item_padding = 2
|
||||
item_spacing = 10
|
||||
selected_item_pixmap_style = "select_*.png"
|
||||
}
|
||||
|
||||
|
||||
# Countdown label
|
||||
# You can change the name of default starting OS here
|
||||
+ label {
|
||||
left = 15%
|
||||
top = 31%
|
||||
align = "center"
|
||||
id = "__timeout__"
|
||||
text = "Ubuntu Mate will start in %d seconds"
|
||||
color = "#cccccc"
|
||||
font = "Ubuntu Regular 17"
|
||||
}
|
BIN
customize/mate/ubuntu_regular_17.pf2
Normal file
BIN
customize/mate/ubuntu_regular_20.pf2
Normal file
BIN
preview/UbuntuMate.png
Normal file
After Width: | Height: | Size: 63 KiB |
|
@ -1,46 +1,53 @@
|
|||
using System;
|
||||
using ICSharpCode.SharpZipLib.Tar;
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace DistroGrubThemes
|
||||
namespace DistroGrubThemes;
|
||||
|
||||
public static class ArchiveManager
|
||||
{
|
||||
public class ArchiveManager
|
||||
public static void CreateTarArchive(string sourceDirectory, string outputFile, bool verbose)
|
||||
{
|
||||
public static void CreateTarArchive(string sourceDirectory, string outputFile, bool verbose)
|
||||
Stream outStream = File.Create(outputFile);
|
||||
TarArchive tarArchive = TarArchive.CreateOutputTarArchive(outStream);
|
||||
|
||||
// Case sensitive
|
||||
tarArchive.RootPath = sourceDirectory.Replace('\\', '/');
|
||||
if (tarArchive.RootPath.EndsWith("/"))
|
||||
tarArchive.RootPath = tarArchive.RootPath.Remove(tarArchive.RootPath.Length - 1);
|
||||
|
||||
AddDirectoryFilesToTar(tarArchive, sourceDirectory, true);
|
||||
tarArchive.Close();
|
||||
|
||||
if (verbose)
|
||||
{
|
||||
Chilkat.Tar tar = new Chilkat.Tar
|
||||
{
|
||||
WriteFormat = "gnu"
|
||||
};
|
||||
Console.ForegroundColor = ConsoleColor.Green;
|
||||
Console.Write("OK\n");
|
||||
Console.ResetColor();
|
||||
}
|
||||
}
|
||||
|
||||
// Add a directory tree to be included in the output TAR archive:
|
||||
bool success = tar.AddDirRoot(sourceDirectory);
|
||||
if (success != true)
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.Red;
|
||||
Console.Write("ERROR\n\n");
|
||||
Console.Write("error: ");
|
||||
Console.ResetColor();
|
||||
Console.Write(tar.LastErrorText + "\n");
|
||||
return;
|
||||
}
|
||||
// Example: https://github.com/icsharpcode/SharpZipLib/wiki/GZip-and-Tar-Samples
|
||||
private static void AddDirectoryFilesToTar(TarArchive tarArchive, string sourceDirectory, bool recurse)
|
||||
{
|
||||
// Optionally, write an entry for the directory itself.
|
||||
// Specify false for recursion here if we will add the directory's files individually.
|
||||
TarEntry tarEntry = TarEntry.CreateEntryFromFile(sourceDirectory);
|
||||
tarArchive.WriteEntry(tarEntry, false);
|
||||
|
||||
// Create the TAR archive.
|
||||
success = tar.WriteTar(outputFile);
|
||||
if (success != true)
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.Red;
|
||||
Console.Write("ERROR\n\n");
|
||||
Console.Write("error: ");
|
||||
Console.ResetColor();
|
||||
Console.Write(tar.LastErrorText + "\n");
|
||||
return;
|
||||
}
|
||||
// Write each file to the tar.
|
||||
string[] filenames = Directory.GetFiles(sourceDirectory);
|
||||
foreach (string filename in filenames)
|
||||
{
|
||||
tarEntry = TarEntry.CreateEntryFromFile(filename);
|
||||
tarArchive.WriteEntry(tarEntry, true);
|
||||
}
|
||||
|
||||
if (verbose)
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.Green;
|
||||
Console.Write("OK\n");
|
||||
Console.ResetColor();
|
||||
}
|
||||
if (recurse)
|
||||
{
|
||||
string[] directories = Directory.GetDirectories(sourceDirectory);
|
||||
foreach (string directory in directories)
|
||||
AddDirectoryFilesToTar(tarArchive, directory, recurse);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,11 +5,12 @@
|
|||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<Authors>Adison Cavani</Authors>
|
||||
<Company>Adison Cavani</Company>
|
||||
<LangVersion>10</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="ChilkatDnCore" Version="9.5.0.88" />
|
||||
<PackageReference Include="CommandLineParser" Version="2.8.0" />
|
||||
<PackageReference Include="SharpZipLib" Version="1.3.3" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
237
src/Program.cs
|
@ -4,161 +4,158 @@ using System.Collections.Generic;
|
|||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
namespace DistroGrubThemes
|
||||
namespace DistroGrubThemes;
|
||||
|
||||
internal class Program
|
||||
{
|
||||
internal class Program
|
||||
static void Main(string[] args)
|
||||
{
|
||||
static void Main(string[] args)
|
||||
var parser = new Parser(with => with.HelpWriter = null);
|
||||
var parserResult = parser.ParseArguments<ProgramOptions>(args);
|
||||
parserResult.WithParsed(options => RunOptions(options)).WithNotParsed(errs => Help.DisplayHelp(parserResult, errs));
|
||||
}
|
||||
|
||||
static void RunOptions(ProgramOptions opts)
|
||||
{
|
||||
Program program = new();
|
||||
string path = program.CheckRepoPath(opts.RepositoryPath);
|
||||
|
||||
if (opts.UpdateFonts)
|
||||
program.UpdateFonts($"{path}\\font", $"{path}\\customize", opts.VerboseMode);
|
||||
|
||||
if (opts.UpdateIcons)
|
||||
{
|
||||
var parser = new Parser(with => with.HelpWriter = null);
|
||||
var parserResult = parser.ParseArguments<ProgramOptions>(args);
|
||||
parserResult.WithParsed(options => RunOptions(options)).WithNotParsed(errs => Help.DisplayHelp(parserResult, errs));
|
||||
if (opts.VerboseMode)
|
||||
Console.WriteLine();
|
||||
|
||||
program.UpdateIcons($"{path}\\assets\\icons", $"{path}\\customize", opts.VerboseMode);
|
||||
}
|
||||
|
||||
static void RunOptions(ProgramOptions opts)
|
||||
if (opts.UpdateArchives)
|
||||
{
|
||||
Program program = new Program();
|
||||
string path = program.CheckRepoPath(opts.RepositoryPath);
|
||||
if (opts.VerboseMode)
|
||||
Console.WriteLine();
|
||||
|
||||
if (opts.UpdateFonts)
|
||||
{
|
||||
program.UpdateFonts(path + @"\font", path + @"\customize", opts.VerboseMode);
|
||||
}
|
||||
program.UpdateArchive(path, opts.VerboseMode);
|
||||
}
|
||||
}
|
||||
|
||||
if (opts.UpdateIcons)
|
||||
{
|
||||
if (opts.VerboseMode)
|
||||
Console.WriteLine();
|
||||
void UpdateArchive(string path, bool verbose)
|
||||
{
|
||||
if (!verbose)
|
||||
Console.Write("Creating .tar archives ... ");
|
||||
|
||||
program.UpdateIcons(path + @"\assets\icons", path + @"\customize", opts.VerboseMode);
|
||||
}
|
||||
foreach (var directory in DirectoriesDictionary($"{path}\\customize", path))
|
||||
{
|
||||
if (verbose)
|
||||
Console.Write($"Creating {directory.Value}.tar archive ... ");
|
||||
|
||||
if (opts.UpdateArchives)
|
||||
{
|
||||
if (opts.VerboseMode)
|
||||
Console.WriteLine();
|
||||
|
||||
program.UpdateArchive(path, opts.VerboseMode);
|
||||
}
|
||||
ArchiveManager.CreateTarArchive(directory.Key, $"{path}\\themes\\{directory.Value}.tar", verbose);
|
||||
}
|
||||
|
||||
void UpdateArchive(string path, bool verbose)
|
||||
if (!verbose)
|
||||
{
|
||||
if (!verbose)
|
||||
Console.Write("Creating .tar archives ... ");
|
||||
Console.ForegroundColor = ConsoleColor.Green;
|
||||
Console.Write("OK\n");
|
||||
Console.ResetColor();
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var directory in DirectoriesDictionary(path + @"\customize", path))
|
||||
void UpdateIcons(string iconsPath, string customizePath, bool verbose)
|
||||
{
|
||||
if (!verbose)
|
||||
Console.Write("Copying icons ... ");
|
||||
|
||||
foreach (var directory in DirectoriesArray(customizePath))
|
||||
{
|
||||
foreach (var icon in FilesArray(iconsPath))
|
||||
{
|
||||
if (verbose)
|
||||
Console.Write("Creating " + directory.Value + ".tar archive ... ");
|
||||
Console.Write($"Copying {icon} ... ");
|
||||
|
||||
ArchiveManager.CreateTarArchive(directory.Key, path + @"\themes\" + directory.Value + ".tar", verbose);
|
||||
}
|
||||
File.Copy($"{iconsPath}\\{icon}", $"{directory}\\icons\\{icon}", true);
|
||||
|
||||
if (!verbose)
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.Green;
|
||||
Console.Write("OK\n");
|
||||
Console.ResetColor();
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateIcons(string iconsPath, string customizePath, bool verbose)
|
||||
{
|
||||
if (!verbose)
|
||||
Console.Write("Copying icons ... ");
|
||||
|
||||
foreach (var directory in DirectoriesArray(customizePath))
|
||||
{
|
||||
foreach (var icon in FilesArray(iconsPath))
|
||||
if (verbose)
|
||||
{
|
||||
if (verbose)
|
||||
Console.Write("Copying " + icon + " ... ");
|
||||
|
||||
File.Copy(iconsPath + @"\" + icon, directory + @"\icons\" + icon, true);
|
||||
|
||||
if (verbose)
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.Green;
|
||||
Console.Write("OK\n");
|
||||
Console.ResetColor();
|
||||
}
|
||||
Console.ForegroundColor = ConsoleColor.Green;
|
||||
Console.Write("OK\n");
|
||||
Console.ResetColor();
|
||||
}
|
||||
}
|
||||
|
||||
if (!verbose)
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.Green;
|
||||
Console.Write("OK\n");
|
||||
Console.ResetColor();
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateFonts(string fontsPath, string customizePath, bool verbose)
|
||||
if (!verbose)
|
||||
{
|
||||
if (!verbose)
|
||||
Console.Write("Copying fonts ... ");
|
||||
Console.ForegroundColor = ConsoleColor.Green;
|
||||
Console.Write("OK\n");
|
||||
Console.ResetColor();
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var directory in DirectoriesArray(customizePath))
|
||||
void UpdateFonts(string fontsPath, string customizePath, bool verbose)
|
||||
{
|
||||
if (!verbose)
|
||||
Console.Write("Copying fonts ... ");
|
||||
|
||||
foreach (var directory in DirectoriesArray(customizePath))
|
||||
{
|
||||
foreach (var font in FilesArray(fontsPath))
|
||||
{
|
||||
foreach (var font in FilesArray(fontsPath))
|
||||
if (verbose)
|
||||
Console.Write($"Copying {font} ... ");
|
||||
|
||||
File.Copy($"{fontsPath}\\{font}", $"{directory}\\{font}", true);
|
||||
|
||||
if (verbose)
|
||||
{
|
||||
if (verbose)
|
||||
Console.Write("Copying " + font + " ... ");
|
||||
|
||||
File.Copy(fontsPath + @"\" + font, directory + @"\" + font, true);
|
||||
|
||||
if (verbose)
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.Green;
|
||||
Console.Write("OK\n");
|
||||
Console.ResetColor();
|
||||
}
|
||||
Console.ForegroundColor = ConsoleColor.Green;
|
||||
Console.Write("OK\n");
|
||||
Console.ResetColor();
|
||||
}
|
||||
}
|
||||
|
||||
if (!verbose)
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.Green;
|
||||
Console.Write("OK\n");
|
||||
Console.ResetColor();
|
||||
}
|
||||
}
|
||||
|
||||
List<string> FilesArray(string folderPath)
|
||||
if (!verbose)
|
||||
{
|
||||
return new List<string>(Directory.GetFiles(folderPath).Select(Path.GetFileName));
|
||||
Console.ForegroundColor = ConsoleColor.Green;
|
||||
Console.Write("OK\n");
|
||||
Console.ResetColor();
|
||||
}
|
||||
}
|
||||
|
||||
List<string> FilesArray(string folderPath)
|
||||
{
|
||||
return new List<string>(Directory.GetFiles(folderPath).Select(Path.GetFileName));
|
||||
}
|
||||
|
||||
string[] DirectoriesArray(string directoryPath)
|
||||
{
|
||||
return Directory.GetDirectories(directoryPath);
|
||||
}
|
||||
|
||||
Dictionary<string, string> DirectoriesDictionary(string directoryPath, string repoPath)
|
||||
{
|
||||
var dirsArray = Directory.GetDirectories(directoryPath);
|
||||
|
||||
return dirsArray.ToDictionary(key => key, value => value[(value.IndexOf(@"customize\") + 10)..]);
|
||||
}
|
||||
|
||||
string CheckRepoPath(string path)
|
||||
{
|
||||
if (Directory.Exists(path) && path.Contains("distro-grub-themes"))
|
||||
{
|
||||
int index = path.IndexOf("distro-grub-themes") + 18;
|
||||
return path[..index];
|
||||
}
|
||||
|
||||
string[] DirectoriesArray(string directoryPath)
|
||||
else
|
||||
{
|
||||
return Directory.GetDirectories(directoryPath);
|
||||
}
|
||||
|
||||
Dictionary<string, string> DirectoriesDictionary(string directoryPath, string repoPath)
|
||||
{
|
||||
var dirsArray = Directory.GetDirectories(directoryPath);
|
||||
|
||||
return dirsArray.ToDictionary(key => key, value => value.Substring(value.IndexOf(@"customize\") + 10));
|
||||
}
|
||||
|
||||
string CheckRepoPath(string path)
|
||||
{
|
||||
if (Directory.Exists(path) && path.Contains("distro-grub-themes"))
|
||||
{
|
||||
int index = path.IndexOf("distro-grub-themes") + 18;
|
||||
return path.Substring(0, index);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.Red;
|
||||
Console.Write("error: ");
|
||||
Console.ResetColor();
|
||||
Console.Write("could not find repository in this path");
|
||||
Environment.Exit(1);
|
||||
return null;
|
||||
}
|
||||
Console.ForegroundColor = ConsoleColor.Red;
|
||||
Console.Write("error: ");
|
||||
Console.ResetColor();
|
||||
Console.Write("could not find repository in this path");
|
||||
Environment.Exit(1);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|