fix(fastfetch): os adjustment
This commit is contained in:
parent
19ebef8437
commit
268a17883d
1 changed files with 143 additions and 139 deletions
|
|
@ -6,150 +6,154 @@
|
||||||
# Copy the custom logo file
|
# Copy the custom logo file
|
||||||
xdg.configFile."fastfetch/oguri-logo.txt".source = ./oguri-logo.txt;
|
xdg.configFile."fastfetch/oguri-logo.txt".source = ./oguri-logo.txt;
|
||||||
|
|
||||||
xdg.configFile."fastfetch/config.jsonc".text =
|
xdg.configFile."fastfetch/config.jsonc".text = let
|
||||||
let esc = builtins.fromJSON ''"\u001b"'';
|
esc = builtins.fromJSON ''"\u001b"'';
|
||||||
in builtins.toJSON {
|
osIcon = if pkgs.stdenv.isDarwin then "" else "";
|
||||||
"$schema" =
|
in builtins.toJSON {
|
||||||
"https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json";
|
"$schema" =
|
||||||
|
"https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json";
|
||||||
|
|
||||||
logo = {
|
logo = {
|
||||||
type = "file";
|
type = "file";
|
||||||
source = "~/.config/fastfetch/oguri-logo.txt";
|
source = "~/.config/fastfetch/oguri-logo.txt";
|
||||||
color."1" = "green";
|
color."1" = "green";
|
||||||
padding = {
|
padding = {
|
||||||
top = 2;
|
top = 2;
|
||||||
right = 6;
|
right = 6;
|
||||||
left = 2;
|
left = 2;
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
display = {
|
|
||||||
separator = " → ";
|
|
||||||
key = { width = 16; };
|
|
||||||
};
|
|
||||||
|
|
||||||
modules = [
|
|
||||||
"break"
|
|
||||||
|
|
||||||
# Hardware Section
|
|
||||||
{
|
|
||||||
type = "custom";
|
|
||||||
format =
|
|
||||||
"${esc}[32m── Hardware──────────────────────────────────────────${esc}[0m";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
type = "host";
|
|
||||||
key = " PC";
|
|
||||||
keyColor = "green";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
type = "cpu";
|
|
||||||
key = " CPU";
|
|
||||||
showPeCoreCount = true;
|
|
||||||
keyColor = "green";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
type = "gpu";
|
|
||||||
key = " GPU";
|
|
||||||
detectionMethod = "pci";
|
|
||||||
keyColor = "green";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
type = "display";
|
|
||||||
key = " Display";
|
|
||||||
keyColor = "green";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
type = "disk";
|
|
||||||
key = " Disk";
|
|
||||||
keyColor = "green";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
type = "memory";
|
|
||||||
key = " Memory";
|
|
||||||
keyColor = "green";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
type = "swap";
|
|
||||||
key = " Swap";
|
|
||||||
keyColor = "green";
|
|
||||||
}
|
|
||||||
"break"
|
|
||||||
|
|
||||||
# Software Section
|
|
||||||
{
|
|
||||||
type = "custom";
|
|
||||||
format =
|
|
||||||
"${esc}[34m── Software──────────────────────────────────────────${esc}[0m";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
type = "os";
|
|
||||||
key = " OS";
|
|
||||||
keyColor = "blue";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
type = "command";
|
|
||||||
key = " Branch";
|
|
||||||
keyColor = "blue";
|
|
||||||
text = ''branch=$(git -C ~/Development/dotfiles branch --show-current 2>/dev/null || echo "unknown"); echo "$branch"'';
|
|
||||||
}
|
|
||||||
{
|
|
||||||
type = "kernel";
|
|
||||||
key = " Kernel";
|
|
||||||
keyColor = "blue";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
type = "wm";
|
|
||||||
key = " WM";
|
|
||||||
keyColor = "blue";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
type = "de";
|
|
||||||
key = " DE";
|
|
||||||
keyColor = "blue";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
type = "terminal";
|
|
||||||
key = " Terminal";
|
|
||||||
keyColor = "blue";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
type = "packages";
|
|
||||||
key = " Packages";
|
|
||||||
keyColor = "blue";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
type = "wmtheme";
|
|
||||||
key = " WM Theme";
|
|
||||||
keyColor = "blue";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
type = "terminalfont";
|
|
||||||
key = " Terminal Font";
|
|
||||||
keyColor = "blue";
|
|
||||||
}
|
|
||||||
"break"
|
|
||||||
|
|
||||||
# Uptime / Age Section
|
|
||||||
{
|
|
||||||
type = "custom";
|
|
||||||
format =
|
|
||||||
"${esc}[35m── Uptime / Age─────────────────────────────────────${esc}[0m";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
type = "command";
|
|
||||||
key = " OS Age";
|
|
||||||
keyColor = "magenta";
|
|
||||||
# macOS compatible stat command
|
|
||||||
text = ''
|
|
||||||
if [ $(uname) = 'Darwin' ]; then birth=$(stat -f %B /); else birth=$(stat -c %W /); fi; current=$(date +%s); days=$(( (current - birth) / 86400 )); echo "$days days"'';
|
|
||||||
}
|
|
||||||
{
|
|
||||||
type = "uptime";
|
|
||||||
key = " Uptime";
|
|
||||||
keyColor = "magenta";
|
|
||||||
}
|
|
||||||
"break"
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
display = {
|
||||||
|
separator = " → ";
|
||||||
|
key = { width = 16; };
|
||||||
|
};
|
||||||
|
|
||||||
|
modules = [
|
||||||
|
"break"
|
||||||
|
|
||||||
|
# Hardware Section
|
||||||
|
{
|
||||||
|
type = "custom";
|
||||||
|
format =
|
||||||
|
"${esc}[32m── Hardware──────────────────────────────────────────${esc}[0m";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
type = "host";
|
||||||
|
key = " PC";
|
||||||
|
keyColor = "green";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
type = "cpu";
|
||||||
|
key = " CPU";
|
||||||
|
showPeCoreCount = true;
|
||||||
|
keyColor = "green";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
type = "gpu";
|
||||||
|
key = " GPU";
|
||||||
|
detectionMethod = "pci";
|
||||||
|
keyColor = "green";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
type = "display";
|
||||||
|
key = " Display";
|
||||||
|
keyColor = "green";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
type = "disk";
|
||||||
|
key = " Disk";
|
||||||
|
keyColor = "green";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
type = "memory";
|
||||||
|
key = " Memory";
|
||||||
|
keyColor = "green";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
type = "swap";
|
||||||
|
key = " Swap";
|
||||||
|
keyColor = "green";
|
||||||
|
}
|
||||||
|
"break"
|
||||||
|
|
||||||
|
# Software Section
|
||||||
|
{
|
||||||
|
type = "custom";
|
||||||
|
format =
|
||||||
|
"${esc}[34m── Software──────────────────────────────────────────${esc}[0m";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
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"'';
|
||||||
|
}
|
||||||
|
{
|
||||||
|
type = "kernel";
|
||||||
|
key = " Kernel";
|
||||||
|
keyColor = "blue";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
type = "wm";
|
||||||
|
key = " WM";
|
||||||
|
keyColor = "blue";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
type = "de";
|
||||||
|
key = " DE";
|
||||||
|
keyColor = "blue";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
type = "terminal";
|
||||||
|
key = " Terminal";
|
||||||
|
keyColor = "blue";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
type = "packages";
|
||||||
|
key = " Packages";
|
||||||
|
keyColor = "blue";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
type = "wmtheme";
|
||||||
|
key = " WM Theme";
|
||||||
|
keyColor = "blue";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
type = "terminalfont";
|
||||||
|
key = " Terminal Font";
|
||||||
|
keyColor = "blue";
|
||||||
|
}
|
||||||
|
"break"
|
||||||
|
|
||||||
|
# Uptime / Age Section
|
||||||
|
{
|
||||||
|
type = "custom";
|
||||||
|
format =
|
||||||
|
"${esc}[35m── Uptime / Age─────────────────────────────────────${esc}[0m";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
type = "command";
|
||||||
|
key = " OS Age";
|
||||||
|
keyColor = "magenta";
|
||||||
|
# macOS compatible stat command
|
||||||
|
text = ''
|
||||||
|
if [ $(uname) = 'Darwin' ]; then birth=$(stat -f %B /); else birth=$(stat -c %W /); fi; current=$(date +%s); days=$(( (current - birth) / 86400 )); echo "$days days"'';
|
||||||
|
}
|
||||||
|
{
|
||||||
|
type = "uptime";
|
||||||
|
key = " Uptime";
|
||||||
|
keyColor = "magenta";
|
||||||
|
}
|
||||||
|
"break"
|
||||||
|
];
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue