Create config file, adapt diskusage
This commit is contained in:
parent
fdc7764050
commit
f4a168a3a5
|
|
@ -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'
|
||||||
|
}
|
||||||
|
|
@ -1,14 +1,8 @@
|
||||||
import os
|
import os
|
||||||
|
from config import bcolors,env
|
||||||
|
|
||||||
barWidth = 50
|
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
|
# Function to generate usage bar based on percentage of storage in use
|
||||||
def generateBar(percentage):
|
def generateBar(percentage):
|
||||||
no_used = int((percentage/100)*barWidth)
|
no_used = int((percentage/100)*barWidth)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue