From 5855e573a9fc3ea638f183082b0965f7d7ffcc1e Mon Sep 17 00:00:00 2001 From: nekohepott Date: Wed, 17 Jun 2026 04:16:24 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BF=D0=BE=20=D0=B7=D0=B0=D0=B2=D0=B5=D1=82?= =?UTF-8?q?=D0=B0=D0=BC=20=D1=85=D0=BE=D1=85=D0=BE=D0=BB=D0=BE=D1=81=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.go | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/main.go b/main.go index 1364abb..46f5246 100644 --- a/main.go +++ b/main.go @@ -151,9 +151,11 @@ func getPkgs() string { return pkgs } if strings.HasPrefix(dist, "NixOS") { - out, _ := exec.Command("sh", "-c", "nix-env -qa --installed | wc -l").Output() - pkgs = strings.TrimSpace(string(out)) + " (nix)" - return pkgs + entries, err := os.ReadDir("/run/current-system/sw/bin") + if err != nil { + return "can't get nix packages" + } + return string(rune(len(entries))) + " (nix)" } return "unknown" } @@ -161,26 +163,17 @@ func getPkgs() string { func getAscii() string { var ascii string if strings.HasPrefix(dist, "Arch") { - content, err := os.ReadFile("ascii/arch.txt") - if err != nil { - return "no ascii, but thats arch btw\n" - } + content := " _ _ _\n /\\ | | | | (_)\n / \\ _ __ ___| |__ | | _ _ __ _ ___ __\n / /\\ \\ | '__/ __| '_ \\ | | | | '_ \\| | | \\ \\/ /\n / ____ \\| | | (__| | | | | |____| | | | | |_| |> <\n /_/ \\_\\_| \\___|_| |_| |______|_|_| |_|\\__,_/_/\\_\\\n" ascii = fmt.Sprintf(string(content)) return ascii } if strings.HasPrefix(dist, "Debian") { - content, err := os.ReadFile("ascii/debian.txt") - if err != nil { - return "no ascii, but thats necrokall\n" - } + content := " _____ _ _\n | __ \\ | | (_)\n | | | | ___ | |__ _ __ _ _ __\n | | | | / _ \\ | '_ \\ | | / _` | | '_ \\\n | |__| | | __/ | |_) | | | | (_| | | | | |\n |_____/ \\___| |_.__/ |_| \\__,_| |_| |_|\n" ascii = fmt.Sprintf(string(content)) return ascii } if strings.HasPrefix(dist, "NixOS") { - content, err := os.ReadFile("ascii/nix.txt") - if err != nil { - return "no ascii, but thats NIX POBEDA\n" - } + content := " _ _ _ ____ _____\n | \\ | (_) / __ \\ / ____|\n | \\| |___ _| | | | (___\n | . ` | \\ \\/ / | | |\\___ \\\n | |\\ | |> <| |__| |____) |\n |_| \\_|_/_/\\_\\\\____/|_____/\n" ascii = fmt.Sprintf(string(content)) return ascii }