forked from abrik1/tinyfetch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tinyfetch.c
30 lines (25 loc) · 823 Bytes
/
tinyfetch.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <stdio.h>
#include <stdlib.h>
#include "config.h"
int main(void){
if (SHOW_USER == 1){
printf("\x1b[31muser:\x1b[0m %s\n", getenv("USER"));
}
if(SHOW_SH == 1){
printf("\x1b[32msh:\x1b[0m %s\n", getenv("SHELL"));
}
if(SHOW_TERM == 1){
printf("\x1b[33mterm:\x1b[0m %s\n", getenv("TERM"));
}
if(SHOW_LOCALE == 1){
printf("\x1b[34mlocale:\x1b[0m %s\n", getenv("LANG"));
}
if(SHOW_COLS == 1){
if(COL_BLOCKS_COL == 1){
printf("\x1b[35mcolors: \x1b[0m\x1b[41m%s\x1b[42m%s\x1b[43m%s\x1b[44m%s\x1b[45m%s\x1b[0m\n", col_block, col_block, col_block, col_block, col_block);
} else {
printf("\x1b[35mcolors: \x1b[0m\x1b[31m%s\x1b[32m%s\x1b[33m%s\x1b[34m%s\x1b[35m%s\x1b[0m\n", col_block, col_block, col_block, col_block, col_block);
}
}
return 0;
}