Skip to content

Commit

Permalink
new OS + more config
Browse files Browse the repository at this point in the history
  • Loading branch information
13-CF committed Jun 17, 2021
1 parent 43fbee2 commit e227481
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ afetch is written in C99, meaning that it should be able to be compiled with alm
* Fedora (slow due to package manager)
* FreeBSD
* Gentoo
* MacOS (homebrew)
* Manjaro
* Mint
* NetBSD
Expand All @@ -40,13 +41,13 @@ afetch is written in C99, meaning that it should be able to be compiled with alm
* OpenSUSE Leap (slow due to package manager)
* OpenSUSE Tumbleweed (slow due to package manager)
* Parabola
* Pop!_OS
* Pop!\_OS
* postmarketOS
* Slackware
* Solus
* Ubuntu
* Void
* macOS (Homebrew)
* Zorin

afetch is made to be run anywhere, but if your operating system isn't in the list above then open an issue! If on Linux please show the output of `cat /etc/os-release`, or if you're using something else then `uname -s`.

Expand Down
3 changes: 3 additions & 0 deletions src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
#define ForceLowerCase false
#define ForceUpperCase false

/* See options in colour.h file */
#define TextColour WHITE

#define PrintColours false /* must be either 'true' or 'false' */
#define ColourCharacter "● "

Expand Down
22 changes: 16 additions & 6 deletions src/fetch.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,16 @@ void *os()
info.col7 = BGREEN " \\ \\____ /_/ ";
info.col8 = BGREEN " -_____\\\n";
info.getPkgCount = "xbps-query -l | wc -l";
} else if (strncmp(osname, "Zorin OS", 8) == 0) {
info.col1 = BBLUE " ______ \n";
info.col2 = BBLUE " /______\\ ";
info.col3 = BBLUE " / / \\ ";
info.col4 = BBLUE "/ / \\";
info.col5 = BBLUE "\\ / /";
info.col6 = BBLUE " \\ /___ / ";
info.col7 = BBLUE " \\______/ ";
info.col8 = BBLUE "";
info.getPkgCount = "dpkg -l | tail -n+6 | wc -l";
}
} else if (strncmp(sysInfo.sysname, "Darwin", 6) == 0) {
info.col1 = "" BYELLOW;
Expand Down Expand Up @@ -517,16 +527,16 @@ int main()
/* os function must be run to get info.col1 */
pthread_join(threads[1], NULL);
printf("%s", info.col1);
printf("%s %s%s%s\n", info.col2, UserText, WHITE, username);
printf("%s %s%s%s\n", info.col3, OsText, WHITE, osname);
printf("%s %s%s%s\n", info.col2, UserText, TextColour, username);
printf("%s %s%s%s\n", info.col3, OsText, TextColour, osname);
pthread_join(threads[2], NULL);
printf("%s %s%s%s\n", info.col4, KernelText, WHITE, krnlver);
printf("%s %s%s%s\n", info.col4, KernelText, TextColour, krnlver);
pthread_join(threads[3], NULL);
printf("%s %s%s%ldh %ldm\n", info.col5, UptimeText, WHITE, uptimeH,
printf("%s %s%s%ldh %ldm\n", info.col5, UptimeText, TextColour, uptimeH,
uptimeM);
pthread_join(threads[4], NULL);
printf("%s %s%s%s\n", info.col6, ShellText, WHITE, shellname);
printf("%s %s%s%s\n", info.col7, PackageText, WHITE, pkgCount);
printf("%s %s%s%s\n", info.col6, ShellText, TextColour, shellname);
printf("%s %s%s%s\n", info.col7, PackageText, TextColour, pkgCount);
printf("%s\n", info.col8);

pthread_create(&threads[5], NULL, colourDraw, NULL);
Expand Down

0 comments on commit e227481

Please sign in to comment.