From f4a168a3a57a4514e7a2d11233a934f106fc6eb0 Mon Sep 17 00:00:00 2001 From: Stefan Weijers Date: Sun, 25 Jul 2021 13:48:11 +0200 Subject: [PATCH] Create config file, adapt diskusage --- config.py | 13 +++++++++++++ diskusage.py | 8 +------- 2 files changed, 14 insertions(+), 7 deletions(-) create mode 100644 config.py diff --git a/config.py b/config.py new file mode 100644 index 0000000..38dc282 --- /dev/null +++ b/config.py @@ -0,0 +1,13 @@ +class bcolors: + EMPTY = '\033[34m' #BLUE + MIDWAY = '\033[33m' #YELLOW + FULL = '\033[31m' #RED + RESET = '\033[0m' #RESET COLOR + UNUSED = '\033[90m' #UNUSED + +class env: + mountpoints = ['/'] # Add mountpoints here to be displayed in diskusage script + services = { # Add services here to be displayed in the services display script +# 'service name' : 'display name' + 'gdm': 'GNOME Display Manager' + } diff --git a/diskusage.py b/diskusage.py index 719154b..39cc6c4 100644 --- a/diskusage.py +++ b/diskusage.py @@ -1,14 +1,8 @@ import os +from config import bcolors,env barWidth = 50 -class bcolors: - EMPTY = '\033[34m' #BLUE - MIDWAY = '\033[33m' #YELLOW - FULL = '\033[31m' #RED - RESET = '\033[0m' #RESET COLOR - UNUSED = '\033[90m' #UNUSED - # Function to generate usage bar based on percentage of storage in use def generateBar(percentage): no_used = int((percentage/100)*barWidth)