1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-09-30 05:59:07 +00:00

Add support for arch linux to $distribution

This commit is contained in:
Nikolas Garofil 2010-04-15 16:49:55 +02:00
parent 5ef6de8822
commit 5ecb0f7030

View File

@ -2376,9 +2376,15 @@ void print_distribution(struct text_object *obj, char *p, int p_max_size)
{ {
(void)obj; (void)obj;
int i, bytes_read; int i, bytes_read;
char* buf = readfile("/proc/version", &bytes_read, 1); char* buf;
struct stat sb;
if(stat("/etc/arch-release", &sb) == 0) {
snprintf(p, p_max_size, "Arch Linux");
return;
}
snprintf(p, p_max_size, "Unknown"); snprintf(p, p_max_size, "Unknown");
buf = readfile("/proc/version", &bytes_read, 1);
if(buf) { if(buf) {
/* I am assuming the distribution name is the first string in /proc/version that: /* I am assuming the distribution name is the first string in /proc/version that:
- is preceded by a '(' - is preceded by a '('