fix(fastfetch): os adjustment

This commit is contained in:
Rasyidan Akbar F. 2025-10-31 13:42:28 +07:00
commit 268a17883d

View file

@ -6,8 +6,9 @@
# Copy the custom logo file
xdg.configFile."fastfetch/oguri-logo.txt".source = ./oguri-logo.txt;
xdg.configFile."fastfetch/config.jsonc".text =
let esc = builtins.fromJSON ''"\u001b"'';
xdg.configFile."fastfetch/config.jsonc".text = let
esc = builtins.fromJSON ''"\u001b"'';
osIcon = if pkgs.stdenv.isDarwin then "" else "";
in builtins.toJSON {
"$schema" =
"https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json";
@ -83,15 +84,18 @@
"${esc}[34m Software${esc}[0m";
}
{
type = "os";
key = " OS";
type = "command";
key = "${osIcon} OS";
keyColor = "blue";
text =
"if [ $(uname) = 'Darwin' ]; then ver=$(sw_vers -productVersion); major=$(echo $ver | cut -d. -f1); case $major in 15) name='Sequoia';; 14) name='Sonoma';; 13) name='Ventura';; 12) name='Monterey';; 11) name='Big Sur';; *) name=''';; esac; echo \"macOS $name $major\"; else echo \"$(cat /etc/os-release | grep PRETTY_NAME | cut -d'\\\"' -f2)\"; fi";
}
{
type = "command";
key = "󰘬 Branch";
keyColor = "blue";
text = ''branch=$(git -C ~/Development/dotfiles branch --show-current 2>/dev/null || echo "unknown"); echo "$branch"'';
text = ''
branch=$(git -C ~/Development/dotfiles branch --show-current 2>/dev/null || echo "unknown"); echo "$branch"'';
}
{
type = "kernel";