feat: the great nix purge
Browse files
+1 −4 .gitignore
| @@ -1,4 +1 @@ | ||
| 1 | -bin | |
| 2 | -result | |
| 3 | - | |
| 4 | -lock | |
| 1 | +sfetch |
+1 −2 Makefile
| @@ -3,14 +3,13 @@ CC := gcc | ||
| 3 | 3 | CFLAGS := -Wall -Wextra -Werror -std=c11 -pedantic -O2 |
| 4 | 4 | |
| 5 | 5 | SRC := src/main.c |
| 6 | -TARGET := bin/sfetch | |
| 6 | +TARGET := sfetch | |
| 7 | 7 | |
| 8 | 8 | .PHONY: all clean install uninstall |
| 9 | 9 | |
| 10 | 10 | all: $(TARGET) |
| 11 | 11 | |
| 12 | 12 | $(TARGET): $(SRC) |
| 13 | - @mkdir -p bin | |
| 14 | 13 | $(CC) $(CFLAGS) $< -o $@ |
| 15 | 14 | |
| 16 | 15 | install: $(TARGET) |
+0 −0 assets/screenshot.png
+0 −27 flake.lock deleted file mode 100644
| @@ -1,27 +0,0 @@ | ||
| 1 | -{ | |
| 2 | - "nodes": { | |
| 3 | - "nixpkgs": { | |
| 4 | - "locked": { | |
| 5 | - "lastModified": 1789149629, | |
| 6 | - "narHash": "sha256-H6GwaZzZf+4npqv0tph94w9tZddSjFjmQrVsW0z78uk=", | |
| 7 | - "owner": "nixos", | |
| 8 | - "repo": "nixpkgs", | |
| 9 | - "rev": "eaad089433ca2bb662274377d33df3d0e51ef28b", | |
| 10 | - "type": "github" | |
| 11 | - }, | |
| 12 | - "original": { | |
| 13 | - "owner": "nixos", | |
| 14 | - "ref": "nixos-unstable", | |
| 15 | - "repo": "nixpkgs", | |
| 16 | - "type": "github" | |
| 17 | - } | |
| 18 | - }, | |
| 19 | - "root": { | |
| 20 | - "inputs": { | |
| 21 | - "nixpkgs": "nixpkgs" | |
| 22 | - } | |
| 23 | - } | |
| 24 | - }, | |
| 25 | - "root": "root", | |
| 26 | - "version": 7 | |
| 27 | -} |
+0 −49 flake.nix deleted file mode 100644
| @@ -1,49 +0,0 @@ | ||
| 1 | -{ | |
| 2 | - description = "A suckless system fetch utility written in C"; | |
| 3 | - | |
| 4 | - inputs = { | |
| 5 | - nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; | |
| 6 | - }; | |
| 7 | - | |
| 8 | - outputs = { | |
| 9 | - self, | |
| 10 | - nixpkgs, | |
| 11 | - }: let | |
| 12 | - supportedSystems = ["x86_64-linux" "aarch64-linux"]; | |
| 13 | - forEachSupportedSystem = f: | |
| 14 | - nixpkgs.lib.genAttrs supportedSystems (system: | |
| 15 | - f { | |
| 16 | - pkgs = import nixpkgs {inherit system;}; | |
| 17 | - }); | |
| 18 | - in { | |
| 19 | - packages = forEachSupportedSystem ({pkgs}: { | |
| 20 | - default = pkgs.stdenv.mkDerivation { | |
| 21 | - pname = "sfetch"; | |
| 22 | - version = "0.1.3"; | |
| 23 | - | |
| 24 | - src = self; | |
| 25 | - | |
| 26 | - nativeBuildInputs = with pkgs; [ gnumake gcc ]; | |
| 27 | - | |
| 28 | - buildPhase = '' | |
| 29 | - make | |
| 30 | - ''; | |
| 31 | - | |
| 32 | - installPhase = '' | |
| 33 | - make install PREFIX=$out | |
| 34 | - ''; | |
| 35 | - }; | |
| 36 | - }); | |
| 37 | - | |
| 38 | - devShells = forEachSupportedSystem ({pkgs}: { | |
| 39 | - default = pkgs.mkShell { | |
| 40 | - packages = with pkgs; [ gnumake gcc man-pages man-pages-posix clang-tools ]; | |
| 41 | - shellHook = '' | |
| 42 | - if [ -f ~/.bashrc ]; then | |
| 43 | - source ~/.bashrc | |
| 44 | - fi | |
| 45 | - ''; | |
| 46 | - }; | |
| 47 | - }); | |
| 48 | - }; | |
| 49 | -} |
+0 −0 readme.org
+1 −10 src/main.c
| @@ -64,10 +64,6 @@ void printOS(void) { | ||
| 64 | 64 | #endif |
| 65 | 65 | } |
| 66 | 66 | int printStats(void) { |
| 67 | - char *term = getenv("TERM_PROGRAM"); | |
| 68 | - if (!term) { | |
| 69 | - term = getenv("TERM"); | |
| 70 | - } | |
| 71 | 67 | char *wm = getenv("XDG_SESSION_DESKTOP"); |
| 72 | 68 | if (!wm) { |
| 73 | 69 | wm = getenv("DESKTOP_SESSION"); |
| @@ -82,20 +78,15 @@ int printStats(void) { | ||
| 82 | 78 | printf(C_GREEN "Kernel: " C_RESET "%s %s\n",info.sysname, info.release); |
| 83 | 79 | printf(C_BLUE "Host: " C_RESET "%s\n", info.nodename); |
| 84 | 80 | printf(C_RED "WM: " C_RESET "%s (%s)\n", wm ? wm : "unknown / tty", session ? session : "unknown"); |
| 85 | - printf(C_PURPLE "Term: " C_RESET "%s\n", term ? term : "unknown"); | |
| 86 | 81 | return 0; |
| 87 | 82 | } |
| 88 | 83 | int main(int argc, char **argv) { |
| 89 | 84 | for (int i = 1; i < argc; i++) { |
| 90 | - if (strcmp(argv[i], "-h") == 0 || strcmp(argv[i], "--help") == 0) { | |
| 91 | - printf("usage: %s [-v/-h]\n", argv[0]); | |
| 92 | - return 0; | |
| 93 | - } | |
| 94 | 85 | if (strcmp(argv[i], "-v") == 0 || strcmp(argv[i], "--version") == 0) { |
| 95 | 86 | printf("sfetch-%s\n", version); |
| 96 | 87 | return 0; |
| 97 | 88 | } |
| 98 | - fprintf(stderr, "Unknown argument: %s\nUsage: %s [-v/-h]\n", argv[i], argv[0]); | |
| 89 | + fprintf(stderr, "unknown argument: %s\nusage: %s [-v]\n", argv[i], argv[0]); | |
| 99 | 90 | return 1; |
| 100 | 91 | } |
| 101 | 92 | printAscii(); |