Skip to content
This repository was archived by the owner on Apr 28, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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`.
1 change: 1 addition & 0 deletions config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
2 changes: 2 additions & 0 deletions config_scripts/pcname.txt
Original file line number Diff line number Diff line change
@@ -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.
6 changes: 6 additions & 0 deletions paleofetch.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions paleofetch.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down