diff --git a/modules/home/cli/default.nix b/modules/home/cli/default.nix index ed7236c..9ebfbc7 100644 --- a/modules/home/cli/default.nix +++ b/modules/home/cli/default.nix @@ -1,4 +1,4 @@ { ... }: { imports = - [ ./btop ./git ./helix ./kitty ./neofetch ./other ./starship ./zsh ]; + [ ./btop ./git ./helix ./kitty ./fastfetch ./other ./starship ./zsh ]; } diff --git a/modules/home/cli/neofetch/config.conf b/modules/home/cli/fastfetch/config.conf similarity index 100% rename from modules/home/cli/neofetch/config.conf rename to modules/home/cli/fastfetch/config.conf diff --git a/modules/home/cli/fastfetch/config.jsonc b/modules/home/cli/fastfetch/config.jsonc new file mode 100644 index 0000000..9af2763 --- /dev/null +++ b/modules/home/cli/fastfetch/config.jsonc @@ -0,0 +1,115 @@ +{ + "$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json", + "logo": { + "type": "small", + "padding": { + "top": 2, + "right": 4 + }, + "color": { + "1": "blue", + "2": "white" + } + }, + "display": { + "separator": " ", + "key": { "width": 16 }, + "color": { + "separator": "90" + } + }, + "modules": [ + { + "type": "title", + "colorUser": "blue", + "colorAt": "90", + "colorHost": "cyan" + }, + "separator", + { + "type": "os", + "key": "󱄅 os", + "keyColor": "blue", + "format": "{2} {8}" + }, + { + "type": "kernel", + "key": "󰌽 kernel", + "keyColor": "blue", + "format": "{2}" + }, + { + "type": "packages", + "key": "󰏗 pkgs", + "keyColor": "blue" + }, + { + "type": "uptime", + "key": "󰅐 uptime", + "keyColor": "blue" + }, + "break", + { + "type": "cpu", + "key": "󱛠 cpu", + "keyColor": "green", + "format": "{1} ({4}t @ {6})" + }, + { + "type": "gpu", + "key": "󰍹 gpu", + "keyColor": "green", + "format": "{2} [{6}]" + }, + { + "type": "memory", + "key": "󰑭 ram", + "keyColor": "green" + }, + { + "type": "disk", + "key": "󰋊 disk", + "keyColor": "green", + "folders": "/" + }, + "break", + { + "type": "wm", + "key": "󱂬 wm", + "keyColor": "yellow", + "format": "{2}" + }, + { + "type": "terminal", + "key": "󰆍 terminal", + "keyColor": "yellow" + }, + { + "type": "shell", + "key": "󱆃 shell", + "keyColor": "yellow" + }, + "break", + { + "type": "command", + "key": "󰃑 installed", + "keyColor": "magenta", + "text": "birth=$(stat -c %W /); echo \"$(( ($(date +%s) - birth) / 86400 )) days\"" + }, + { + "type": "command", + "key": "󰜅 generation", + "keyColor": "magenta", + "text": "nixos-rebuild list-generations | awk '$NF == \"True\" {print $2, $3}' | xargs -I {} date -d \"{}\" +\"%s\" | awk '{diff=systime()-$1; if(diff<3600) printf \"%d mins\\n\", diff/60; else if(diff<86400) printf \"%.0f hours\\n\", diff/3600; else printf \"%.0f days\\n\", diff/86400}'" + }, + "break", + { + "type": "colors", + "paddingLeft": 1, + "block": { + "width": 3, + "range": [0, 7] + } + } + ] +} diff --git a/modules/home/cli/fastfetch/default.nix b/modules/home/cli/fastfetch/default.nix new file mode 100755 index 0000000..3231a46 --- /dev/null +++ b/modules/home/cli/fastfetch/default.nix @@ -0,0 +1,149 @@ +{ pkgs, config, lib, ... }: +let + p = config.colorScheme.palette; + + hexDigits = { + "0"=0; "1"=1; "2"=2; "3"=3; "4"=4; "5"=5; "6"=6; "7"=7; + "8"=8; "9"=9; "a"=10; "b"=11; "c"=12; "d"=13; "e"=14; "f"=15; + }; + hexByte = h: + hexDigits.${lib.toLower (builtins.substring 0 1 h)} * 16 + + hexDigits.${lib.toLower (builtins.substring 1 1 h)}; + rgb = hex: + let r = toString (hexByte (builtins.substring 0 2 hex)); + g = toString (hexByte (builtins.substring 2 2 hex)); + b = toString (hexByte (builtins.substring 4 2 hex)); + in "${r};${g};${b}"; + + # in a JSON string → ESC; JSON custom module format uses this directly + blk = c: "\\u001b[38;2;${rgb c}m\\ue0b7●\\ue0b5 \\u001b[0m"; + row = cs: " " + builtins.concatStringsSep "" (map blk cs); + + base = row [ p.base00 p.base01 p.base02 p.base03 p.base04 p.base05 p.base06 p.base07 ]; + alt = row [ p.alt00 p.alt01 p.alt02 p.alt03 p.alt04 p.alt05 p.alt06 p.alt07 ]; + high = row [ p.high08 p.high09 p.high0A p.high0B p.high0C p.high0D p.high0E p.high0F ]; + low = row [ p.low08 p.low09 p.low0A p.low0B p.low0C p.low0D p.low0E p.low0F ]; + + # ── logo colors ── change $1 / $2 to any palette entry ─────────────────── + logoColor1 = p.base07; + logoColor2 = p.base07; + # ───────────────────────────────────────────────────────────────────────── +in { + home.packages = with pkgs; [ fastfetch ]; + xdg.configFile."neofetch/config.conf".source = ./config.conf; + xdg.configFile."fastfetch/logo.txt".source = ./logo.txt; + xdg.configFile."fastfetch/config.jsonc".text = '' + { + "$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json", + "logo": { + "type": "file", + "source": "~/.config/fastfetch/logo.txt", + "color": { + "1": "38;2;${rgb logoColor1}", + "2": "38;2;${rgb logoColor2}" + }, + "padding": { + "top": 1, + "right": 4 + } + }, + "display": { + "separator": " ", + "key": { "width": 16 }, + "color": { + "separator": "90" + } + }, + "modules": [ + { + "type": "title", + "colorUser": "blue", + "colorAt": "90", + "colorHost": "cyan" + }, + "separator", + { + "type": "os", + "key": "󱄅 os", + "keyColor": "blue", + "format": "{2} {8}" + }, + { + "type": "kernel", + "key": "󰌽 kernel", + "keyColor": "blue", + "format": "{2}" + }, + { + "type": "packages", + "key": "󰏗 pkgs", + "keyColor": "blue" + }, + { + "type": "uptime", + "key": "󰅐 uptime", + "keyColor": "blue" + }, + "break", + { + "type": "cpu", + "key": "󱛠 cpu", + "keyColor": "green", + "format": "{1} ({4}t @ {6})" + }, + { + "type": "gpu", + "key": "󰍹 gpu", + "keyColor": "green", + "format": "{2} [{6}]" + }, + { + "type": "memory", + "key": "󰑭 ram", + "keyColor": "green" + }, + { + "type": "disk", + "key": "󰋊 disk", + "keyColor": "green", + "folders": "/" + }, + "break", + { + "type": "wm", + "key": "󱂬 wm", + "keyColor": "yellow", + "format": "{2}" + }, + { + "type": "terminal", + "key": "󰆍 terminal", + "keyColor": "yellow" + }, + { + "type": "shell", + "key": "󱆃 shell", + "keyColor": "yellow" + }, + "break", + { + "type": "command", + "key": "󰃑 installed", + "keyColor": "magenta", + "text": "birth=$(stat -c %W /); echo \"$(( ($(date +%s) - birth) / 86400 )) days\"" + }, + { + "type": "command", + "key": "󰜅 generation", + "keyColor": "magenta", + "text": "nixos-rebuild list-generations | awk '$NF == \"True\" {print $2, $3}' | xargs -I {} date -d \"{}\" +\"%s\" | awk '{diff=systime()-$1; if(diff<3600) printf \"%d mins\\n\", diff/60; else if(diff<86400) printf \"%.0f hours\\n\", diff/3600; else printf \"%.0f days\\n\", diff/86400}'" + }, + "break", + { "type": "custom", "format": "${base}" }, + { "type": "custom", "format": "${alt}" }, + { "type": "custom", "format": "${high}" }, + { "type": "custom", "format": "${low}" } + ] + } + ''; +} diff --git a/modules/home/cli/fastfetch/logo.txt b/modules/home/cli/fastfetch/logo.txt new file mode 100644 index 0000000..40d6c99 --- /dev/null +++ b/modules/home/cli/fastfetch/logo.txt @@ -0,0 +1,14 @@ + +$2 $1⢀⣴⣦⡀ +$2⢀⣴⣶⣿⣿⣿⣿⣷⣶⣦⣤⣀⡀ $1⢀⣴⣿⡿⠋ +$2⢸⣿⣿⡿⠋⠉⠁⠉⠉⠉⠙⠛⠿⢷⣦⣄ $1⢀⣴⣿⡿⠋ +$2⠘⣿⣿⣇ ⢀⣤⣤⣤⣤⣄⣀⠈⠙⠛$1⢀⣴⣿⡿⠋ +$2 ⠘⣿⣿⣆ ⢸⣿⣿⠛⠛⠛⠛⠿⢃$1⣴⣿⡿⠋ +$2 ⠈⢻⣿⣧⡀ ⠹⣿⣦⡀ $1⢀⣴⣿⡿⠛$2⠻⣷⣦⡀ +$2 ⠙⠿⣿⣦⣄⠈⠙⢿⣷$2⣿⣿⣿$2⣿⣶⣄ ⠙⢿⣷⣄ +$2 ⠈⠻⢿⣷⣦⣄⡈⠙⠛⠛⠋⠙⢿⣷⡀ ⠙⢿⣷⣄ +$2 $1⢀⣴⣿⡿$2⠿⣿⣷⣶⣤⣤⣤⣼⣿⣷ ⠈⢻⣿⣦ +$2 $1⢀⣴⣿⡿⠋ $2⠈⠉⠛⠛⠛⠛⠛⠁ ⣿⣿⡇ +$2 $1⢀⣴⣿⡿⠋ $2⠠⢤⣀⣀⣀⣀⣀⣀⣤⣾⣿⣿⠇ +$2 $1⠻⡿⠋ $2⠈⠉⠙⠛⠛⠛⠛⠛⠛⠁ + diff --git a/modules/home/cli/neofetch/config.jsonc b/modules/home/cli/neofetch/config.jsonc deleted file mode 100644 index 6c125c4..0000000 --- a/modules/home/cli/neofetch/config.jsonc +++ /dev/null @@ -1,147 +0,0 @@ -{ - "$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json", - "logo": { - "type": "builtin", // Logo type: auto, builtin, small, file, etc. - // "source": "arch", - "width": 10, - "height": 10, - "padding": { - "top": 3, - "left": 2, - "right": 2 - }, - "color": { - "1": "blue", - "2": "white", - "3": "cyan" - } - }, - "display": { /* Display settings */}, - "modules": [ - "break", - { - "type": "custom", - "format": "\u001b[90m┌──────────────────────Hardware──────────────────────┐" - }, - { - "type": "host", - "key": "󰌢 PC", - "keyColor": "green", - "format": "{2}" - }, - { - "type": "cpu", - "key": "│ ├󱛠 ", - "keyColor": "green", - "format": "{1} | {4} @{6}" - }, - { - "type": "gpu", - "key": "│ ├󰍹 ", - "keyColor": "green", - "format": "{2} | {7}" - }, - { - "type": "memory", - "key": "│ ├󰑭 ", - "keyColor": "green", - "format": "{2}" - }, - // { - // "type": "disk", - // "key": "└ └󰋊 ", - // "keyColor": "green" - // }, - { - "type": "custom", - "format": "\u001b[90m└────────────────────────────────────────────────────┘" - }, - "break", - { - "type": "custom", - "format": "\u001b[90m┌──────────────────────Software──────────────────────┐" - }, - { - "type": "os", - "key": " OS", - "keyColor": "yellow", - "format": " {2} {8}" - }, - { - "type": "kernel", - "key": "│ ├󰌽 ", - "keyColor": "yellow", - "format": "{1} {2}" - }, - { - "type": "bios", - "key": "│ ├󰖡 ", - "keyColor": "yellow" - }, - { - "type": "packages", - "key": "│ ├󰏗 ", - "keyColor": "yellow" - }, - { - "type": "de", - "key": "󰧨 DE", - "keyColor": "blue", - "format": "{2} | {3}" - }, - { - "type": "lm", - "key": "│ ├󰍁 ", - "keyColor": "blue", - "format": "{1} {2} {3}" - }, - { - "type": "wm", - "key": "│ ├󱂬 ", - "keyColor": "blue", - "format": "{2} {5}" - }, - { - "type": "custom", - "format": "\u001b[90m└────────────────────────────────────────────────────┘" - }, - "break", - { - "type": "custom", - "format": "\u001b[90m┌──────────────────────Age───────────────────────────┐" - }, - { - "type": "command", - "key": " › OS Age ", - "keyColor": "magenta", - "text": "birth_install=$(stat -c %W /); current=$(date +%s); time_progression=$((current - birth_install)); days_difference=$((time_progression / 86400)); echo $days_difference days" - }, - { - "type": "command", - "key": " › Update ", - "keyColor": "magenta", - "text": "nixos-rebuild list-generations | awk '$NF == \"True\" {print $2, $3}' | xargs -I {} date -d \"{}\" +\"%s\" | awk '{diff=systime()-$1; printf \"%d days, %d hours, %d mins\\n\", diff/86400, (diff%86400)/3600, (diff%3600)/60}'" - }, - { - "type": "uptime", - "key": " › Uptime ", - "keyColor": "magenta" - }, - { - "type": "custom", - "format": "\u001b[90m└────────────────────────────────────────────────────┘" - }, - { - "type": "colors", - "paddingLeft": 2, - "block": { - "width": 3, - "range": [ - 0, - 15 - ] - } //, - //"symbol": "circle" - }, - ] -} \ No newline at end of file diff --git a/modules/home/cli/neofetch/default.nix b/modules/home/cli/neofetch/default.nix deleted file mode 100755 index 9906cd6..0000000 --- a/modules/home/cli/neofetch/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ pkgs, config, ... }: { - home.packages = with pkgs; [ fastfetch ]; - xdg.configFile."neofetch/config.conf".source = ./config.conf; - xdg.configFile."fastfetch/config.jsonc".source = ./config.jsonc; -} diff --git a/modules/shared/media/logo.ascii b/modules/shared/media/logo.ascii new file mode 100644 index 0000000..8478c2f --- /dev/null +++ b/modules/shared/media/logo.ascii @@ -0,0 +1,14 @@ + + ⢀⣴⣦⡀ +⢀⣴⣶⣿⣿⣿⣿⣷⣶⣦⣤⣀⡀ ⢀⣴⣿⡿⠋ +⢸⣿⣿⡿⠋⠉⠁⠉⠉⠉⠙⠛⠿⢷⣦⣄ ⢀⣴⣿⡿⠋ +⠘⣿⣿⣇ ⢀⣤⣤⣤⣤⣄⣀⠈⠙⠛⢀⣴⣿⡿⠋ + ⠘⣿⣿⣆ ⢸⣿⣿⠛⠛⠛⠛⠿⢃⣴⣿⡿⠋ + ⠈⢻⣿⣧⡀ ⠹⣿⣦⡀ ⢀⣴⣿⡿⠛⠻⣷⣦⡀ + ⠙⠿⣿⣦⣄⠈⠙⢿⣷⣿⣿⣿⣿⣶⣄ ⠙⢿⣷⣄ + ⠈⠻⢿⣷⣦⣄⡈⠙⠛⠛⠋⠙⢿⣷⡀ ⠙⢿⣷⣄ + ⢀⣴⣿⡿⠿⣿⣷⣶⣤⣤⣤⣼⣿⣷ ⠈⢻⣿⣦ + ⢀⣴⣿⡿⠋ ⠈⠉⠛⠛⠛⠛⠛⠁ ⣿⣿⡇ + ⢀⣴⣿⡿⠋ ⠠⢤⣀⣀⣀⣀⣀⣀⣤⣾⣿⣿⠇ + ⠻⡿⠋ ⠈⠉⠙⠛⠛⠛⠛⠛⠛⠁ +