Create config file, adapt diskusage

This commit is contained in:
Stefan Weijers 2021-07-25 13:48:11 +02:00
parent fdc7764050
commit f4a168a3a5
2 changed files with 14 additions and 7 deletions

13
config.py Normal file
View File

@ -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'
}

View File

@ -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)