diff options
Diffstat (limited to 'src/config_swap.c')
-rw-r--r-- | src/config_swap.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/config_swap.c b/src/config_swap.c index 090117f..228085d 100644 --- a/src/config_swap.c +++ b/src/config_swap.c @@ -33,6 +33,14 @@ int config_swap_load(struct node* n) { int percent; sysinfo(&si); + + // Return early if swap is not enabled + if(si.totalswap == 0) { + strcpy(n->color, C_YELLOW); + strcpy(n->text, "none"); + return 0; + } + percent = (si.totalswap - si.freeswap) * 100 / si.totalswap; if(percent < 20) { |