From 2c2bbb73d0c81b11c96ad245b977d7166c575178 Mon Sep 17 00:00:00 2001 From: Polesznyák Márk Date: Sun, 28 Dec 2025 10:49:51 +0100 Subject: chore: cleanup of gitignore(s), fetcha Makefile and license --- fetcha/.gitignore | 6 ----- fetcha/LICENSE | 24 ++++++++++++++++++ fetcha/Makefile | 2 +- fetcha/config.h | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ fetcha/license.txt | 24 ------------------ 5 files changed, 99 insertions(+), 31 deletions(-) delete mode 100644 fetcha/.gitignore create mode 100644 fetcha/LICENSE create mode 100644 fetcha/config.h delete mode 100644 fetcha/license.txt (limited to 'fetcha') diff --git a/fetcha/.gitignore b/fetcha/.gitignore deleted file mode 100644 index 34bfeb3..0000000 --- a/fetcha/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -*.o -*.out -*.d - -fetcha -config.h diff --git a/fetcha/LICENSE b/fetcha/LICENSE new file mode 100644 index 0000000..3d3e667 --- /dev/null +++ b/fetcha/LICENSE @@ -0,0 +1,24 @@ +BSD 2-Clause License + +Copyright (c) 2025, cryobs + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/fetcha/Makefile b/fetcha/Makefile index 95b2464..476e679 100644 --- a/fetcha/Makefile +++ b/fetcha/Makefile @@ -5,7 +5,7 @@ VERSION = 1.0.0 CC = cc CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700L -DVERSION=\"${VERSION}\" -CFLAGS = -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Wno-format-truncation -Os -MMD ${CPPFLAGS} +CFLAGS = -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Wno-format-truncation -Os ${CPPFLAGS} LDFLAGS = -lX11 SRC = fetcha.c modules.c diff --git a/fetcha/config.h b/fetcha/config.h new file mode 100644 index 0000000..99c43a5 --- /dev/null +++ b/fetcha/config.h @@ -0,0 +1,74 @@ +#include "modules.h" +#include + + +static const int ascii_pad = 3; /* padding ascii/info */ +static const int info_align = 0; /* align info by separator */ +static const int header_show = 1; /* if 0 doot print header */ +static const int color_palette_show = 1; +static const char *info_sep = ": "; +static const int numerate_same = 1; + +/* + * colors ANSI + * NAME Normal Light + * Black : 30 (90) + * Red : 31 (91) + * Green : 32 (92) + * Yellow: 33 (93) + * Blue : 34 (94) + * Purple: 35 (95) + * Aqua : 36 (96) + * White : 37 (97) + * + * colorpallete: + * [0-4] - secondary colors + * [5-9] - text colors: + * 5 - info text + * 6 - info separator + * 7 - header separator + * 8 - boundary + * 9 - ? + */ + +static const int colors[10] = {34, 34, 35, 33, 34, 97, 34, 90, 34, 34}; + +/* + * character header/info + * if 1 char: boundary len == header len + * if 2 char: boundary len == 2 * header len + */ +static const char *boundary_char = ""; + +/* + * separator for header info + */ +static const char *header_sep = "@"; + +/* + * information + * Label, func + */ +static info_item config_items[] = { + { "Distro", get_os }, + { "Kernel", get_kernel }, + { "Packages", get_packages }, + { "WM", get_wm }, + { "Terminal", get_terminal }, + { "Memory", get_memory }, + +}; + +const size_t config_items_len = sizeof config_items / sizeof config_items[0]; + + +static const char *ascii_art = +"$2 /\\\n" +" / \\\n" +" /\\ \\\n" +"$1 / \\\n" +" / ,, \\\n" +" / | | -\\\n" +"/_-'' ''-_\\\n" +; + diff --git a/fetcha/license.txt b/fetcha/license.txt deleted file mode 100644 index 3d3e667..0000000 --- a/fetcha/license.txt +++ /dev/null @@ -1,24 +0,0 @@ -BSD 2-Clause License - -Copyright (c) 2025, cryobs - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- cgit v1.2.3