diff --git a/Makefile b/Makefile index 68c1c07..687f897 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,7 @@ PLATFORM = $(shell uname) ifeq ($(PLATFORM), Linux) PREFIX = bin LIBDIR = lib + ETC_DIR = /etc MANDIR = share/man/man1 ifeq ($(shell uname -o), Android) DESTDIR = /data/data/com.termux/files/usr @@ -16,12 +17,14 @@ ifeq ($(PLATFORM), Linux) else ifeq ($(PLATFORM), Darwin) PREFIX = local/bin LIBDIR = local/lib + ETC_DIR = /etc MANDIR = local/share/man/man1 else ifeq ($(PLATFORM), FreeBSD) CFLAGS += -D__FREEBSD__ CFLAGS_DEBUG += -D__FREEBSD__ PREFIX = bin LIBDIR = lib + ETC_DIR = /etc MANDIR = share/man/man1 else ifeq ($(PLATFORM), windows32) CC = gcc @@ -38,9 +41,10 @@ debug: ./$(NAME) install: build - mkdir -p $(DESTDIR)/$(PREFIX) $(DESTDIR)/$(LIBDIR)/uwufetch $(DESTDIR)/$(MANDIR) + mkdir -p $(DESTDIR)/$(PREFIX) $(DESTDIR)/$(LIBDIR)/uwufetch $(DESTDIR)/$(MANDIR) $(ETC_DIR)/uwufetch cp $(NAME) $(DESTDIR)/$(PREFIX)/$(NAME) cp -r res/* $(DESTDIR)/$(LIBDIR)/uwufetch + cp default.config $(ETC_DIR)/uwufetch cp ./$(NAME).1.gz $(DESTDIR)/$(MANDIR)/ uninstall: diff --git a/default.config b/default.config new file mode 100644 index 0000000..47157a5 --- /dev/null +++ b/default.config @@ -0,0 +1,15 @@ +#distro=arch +#image=~/Pictures/picture.png +ascii=true +user=true +os=true +host=true +kernel=true +cpu=true +gpu=true +ram=true +resolution=true +shell=true +pkgs=true +uptime=true +colors=true diff --git a/uwufetch.1 b/uwufetch.1 index dc294d7..43e56fd 100644 --- a/uwufetch.1 +++ b/uwufetch.1 @@ -32,7 +32,8 @@ prints image instead of ascii logo uses a custom image if one is provided (disab .B -l --list prints a list of all supported distributions .SH CONFIGURATION -The config file is located in $HOME/.config/uwufetch/config (you need to create it), but you can change the path by using the \fB--config\fR option. +The system-wide config file is /etc/uwufetch/config, and you can use it to configure uwufetch globally or as a template for your own config. +The user config file is located in $HOME/.config/uwufetch/config (you need to create it), but you can change the path by using the \fB--config\fR option. .TP .SH EXAMPLE .EX diff --git a/uwufetch.1.gz b/uwufetch.1.gz index 566e898..8a5bf64 100644 Binary files a/uwufetch.1.gz and b/uwufetch.1.gz differ diff --git a/uwufetch.c b/uwufetch.c index 3540b1b..a846e64 100644 --- a/uwufetch.c +++ b/uwufetch.c @@ -162,6 +162,8 @@ struct configuration parse_config(struct info* user_info) { char homedir[512]; sprintf(homedir, "%s/.config/uwufetch/config", getenv("HOME")); config = fopen(homedir, "r"); + if (!config) + config = fopen("/etc/uwufetch/config", "r"); } } else config = fopen(user_info->config_directory, "r");