diff --git a/README.md b/README.md index c966979..c748c55 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,7 @@ which function paleofetch will call display. Current available getter functions * `get_gpu1`, `get_gpu2`: Print the GPU on your system. If you don't have both integrated graphics and an external GPU, `get_gpu2` will likely be blank * `get_gpu`: (Tries to) print your current GPU * `get_colors1`, `get_colors2`: Prints the colors of your terminal +* `get_pcname`: Prints the PC name on the first line of ./config_scripts/pcname.txt To include a blank line between entries, put `SPACER \` between the two lines you want to separate. @@ -98,5 +99,10 @@ FAQ --- Q: Do you really run neofetch every time you open a terminal? + A: Yes, I like the way it looks and like that it causes my prompt to start midway down the screen. I do acknowledge that the information it presents is not actually useful. + +Q: I put a name in ./config_scripts/pcname.txt but it is not printing the name? + +A: You need to uncomment the line with `get_pcname()` in `paleofetch.h`. diff --git a/config.h b/config.h index 39c621c..fa1325a 100644 --- a/config.h +++ b/config.h @@ -23,6 +23,7 @@ SPACER \ { "", get_colors1, false }, \ { "", get_colors2, false }, \ + //{ "PC name: ", get_pcname, false }, \ //PC name is commented out by default as it requires editing pcname.txt in config_scripts to add a name. } #define CPU_CONFIG \ diff --git a/config_scripts/pcname.txt b/config_scripts/pcname.txt new file mode 100644 index 0000000..015fc55 --- /dev/null +++ b/config_scripts/pcname.txt @@ -0,0 +1,2 @@ + +Put your computers name in the line above. If left blank with get_pcname() still in config.h, "PC name: " will still be printed, but nothing after that. diff --git a/paleofetch.c b/paleofetch.c index 72ce826..9d2cc5c 100644 --- a/paleofetch.c +++ b/paleofetch.c @@ -630,6 +630,12 @@ static char *get_colors2() { return colors2; } +static char *get_pcname(){ + char pc_name[1024] // I doubt anyone has a PC with a name over 1024 charectors. + FILE *fp_pcname = fopen("./config_scripts/pcname.txt","r"); // open the file as fp_pcname + fscanf(fp_pcname,"%[^\n]",pc_name); // read pc name + return *pc_name; +} static char *spacer() { return calloc(1, 1); // freeable, null-terminated string of length 1 diff --git a/paleofetch.h b/paleofetch.h index 0e4578f..f7118b2 100644 --- a/paleofetch.h +++ b/paleofetch.h @@ -21,6 +21,7 @@ static char *get_title(), *get_colors1(), *get_colors2(), *spacer(); + *get_pcname(); #define SPACER {"", spacer, false}, #define REMOVE(A) { (A), NULL, sizeof(A) - 1 , 0 }