fastfetch
This commit is contained in:
127
modules/home/cli/fastfetch/config.conf
Executable file
127
modules/home/cli/fastfetch/config.conf
Executable file
@@ -0,0 +1,127 @@
|
||||
|
||||
print_info() {
|
||||
info ""
|
||||
info "├─ Distro " distro
|
||||
info "├─ Kernel " kernel
|
||||
info "├─ Pkgs " packages
|
||||
info "├─ Compositor " de
|
||||
info "├─ CPU " cpu
|
||||
info "├─ GPU " gpu
|
||||
info "├─ Term " term
|
||||
prin "$(color 0) $(color 1) $(color 2) $(color 3) $(color 4) $(color 5) $(color 6) $(color 7)"
|
||||
prin "$(color 8) $(color 9) $(color 10) $(color 11) $(color 12) $(color 13) $(color 14) $(color 15)"
|
||||
|
||||
}
|
||||
|
||||
##--------- Title
|
||||
title_fqdn="off"
|
||||
|
||||
##--------- Kernel
|
||||
kernel_shorthand="off"
|
||||
|
||||
##--------- Distro
|
||||
distro_shorthand="on"
|
||||
os_arch="off"
|
||||
|
||||
##--------- Uptime
|
||||
uptime_shorthand="off"
|
||||
|
||||
##--------- Memory
|
||||
memory_percent="off"
|
||||
memory_unit="mib"
|
||||
|
||||
##--------- Packages
|
||||
package_managers="on"
|
||||
|
||||
##--------- Shell
|
||||
shell_path="off"
|
||||
shell_version="on"
|
||||
|
||||
##--------- CPU
|
||||
speed_type="bios_limit"
|
||||
speed_shorthand="off"
|
||||
cpu_brand="on"
|
||||
cpu_speed="off"
|
||||
cpu_cores="off"
|
||||
cpu_temp="off"
|
||||
|
||||
##--------- GPU
|
||||
gpu_brand="on"
|
||||
gpu_type="dedicated"
|
||||
|
||||
##--------- Resolution
|
||||
refresh_rate="off"
|
||||
|
||||
##--------- GTK
|
||||
gtk_shorthand="off"
|
||||
gtk2="on"
|
||||
gtk3="on"
|
||||
|
||||
##--------- IP
|
||||
public_ip_host="http://ident.me"
|
||||
public_ip_timeout=2
|
||||
|
||||
##--------- DE
|
||||
de_version="on"
|
||||
|
||||
##--------- Disk
|
||||
disk_show=('/')
|
||||
disk_subtitle="mount"
|
||||
disk_percent="on"
|
||||
|
||||
##--------- Song
|
||||
music_player="auto"
|
||||
song_format="%artist% - %album% - %title%"
|
||||
song_shorthand="off"
|
||||
mpc_args=()
|
||||
|
||||
##--------- Text Colors
|
||||
colors=(0 0 0 4 7 7)
|
||||
|
||||
##--------- Text Options
|
||||
bold="on"
|
||||
underline_enabled="on"
|
||||
underline_char=""
|
||||
separator=":"
|
||||
|
||||
##--------- Color Blocks
|
||||
block_range=(0 15)
|
||||
color_blocks="on"
|
||||
block_width=3
|
||||
block_height=1
|
||||
col_offset="auto"
|
||||
|
||||
##--------- Progress Bars
|
||||
bar_char_elapsed="-"
|
||||
bar_char_total="="
|
||||
bar_border="on"
|
||||
bar_length=15
|
||||
bar_color_elapsed="distro"
|
||||
bar_color_total="distro"
|
||||
|
||||
cpu_display="off"
|
||||
memory_display="off"
|
||||
battery_display="off"
|
||||
disk_display="off"
|
||||
|
||||
##--------- Backend Settings
|
||||
image_backend="kitty"
|
||||
image_source="auto"
|
||||
|
||||
##--------- Ascii Options
|
||||
ascii_distro="nixos_small"
|
||||
ascii_bold="on"
|
||||
|
||||
##--------- Image Options
|
||||
image_loop="off"
|
||||
thumbnail_dir="${XDG_CACHE_HOME:-${HOME}/.cache}/thumbnails/neofetch"
|
||||
crop_mode="normal"
|
||||
crop_offset="center"
|
||||
image_size="auto"
|
||||
gap=2
|
||||
yoffset=0
|
||||
xoffset=0
|
||||
background_color=
|
||||
|
||||
##--------- Misc Options
|
||||
stdout="off"
|
||||
115
modules/home/cli/fastfetch/config.jsonc
Normal file
115
modules/home/cli/fastfetch/config.jsonc
Normal file
@@ -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]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
149
modules/home/cli/fastfetch/default.nix
Executable file
149
modules/home/cli/fastfetch/default.nix
Executable file
@@ -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}" }
|
||||
]
|
||||
}
|
||||
'';
|
||||
}
|
||||
14
modules/home/cli/fastfetch/logo.txt
Normal file
14
modules/home/cli/fastfetch/logo.txt
Normal file
@@ -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⠈⠉⠙⠛⠛⠛⠛⠛⠛⠁
|
||||
|
||||
Reference in New Issue
Block a user