liten "ledigt utrymme" function till conky
Postat: 07 jan 2009, 21:10
Har fixat en liten funktion för conky. Den visar ledigt utrymme på alla enheter som finns med i fstab.
free.py
tilläg till .conkyrc
Ni som vill får gärna komma med ideeer kring hur man får "snyggare" utskrift. typ enhet vänster justerat och ledigt utrymme höger justerat.
free.py
Kod: Markera allt
#!/usr/bin/python
import os
#os.popen('df -h /media/C > free_c.txt')
f = open('/etc/fstab', 'r')
for line in f:
if line[0]!='#':
line=line.split(' ')
if len(line)>1:
if line[1]!='none':
#print line[1]
command="df -h "+line[1]
#print command
os.popen("df -h "+line[1]+" >temp.txt")
temp=open('temp.txt','r')
temp.readline()
output=temp.readline()
output=output.split()
print line[1]+" "+output[3]
Kod: Markera allt
${execi 86400 python /home/marcus/scripts/free.py}