1
0
mirror of https://github.com/gryf/wmdocklib.git synced 2025-12-19 04:20:17 +01:00

1575762: initialization of pixmask

this is an important modification.  I hope it won't break too many programs
based on this library, or at least not in such a way that will make you
upset with me and my work...

well: the library offers now three charsets and a 16 colours palette.
but: you must use them.

there is no support yet for named colours.

the only working examples are pywmdatetime and pywmhdmon.
This commit is contained in:
mfrasca
2006-10-12 17:29:17 +00:00
parent c1508bdbcd
commit ed4b557ab0
4 changed files with 338 additions and 274 deletions

View File

@@ -57,8 +57,6 @@ import os
import wmdocklib
from wmdocklib import char_width, char_height
width = 64
height = 64
@@ -425,7 +423,7 @@ def main():
config = fileConfig
for i in clConfig.iteritems():
config[i[0]] = i[1]
parseColors(defaultRGBFiles, config, xpm)
#parseColors(defaultRGBFiles, config, xpm)
pathsToMonitor = []
for i in range(1,1000):
@@ -450,7 +448,7 @@ def main():
58, 4 + i * (char_height + 1))
procStat = config.get('procstat', defaultProcStat)
skipping = int(config.get('skipconf', 0))
actMonEnabled = int(config.get('monitoring'))
actMonEnabled = int(config.get('monitoring',0))
if not os.access(procStat, os.R_OK):
sys.stderr.write(
"Can't read your procstat file, try setting it with -p. ")
@@ -461,7 +459,6 @@ def main():
except IndexError:
programName = ''
sys.argv[0] = programName
wmdocklib.setDefaultPixmap(xpm)
wmdocklib.openXwindow(sys.argv, width, height)
signal.signal(signal.SIGCHLD, handler)
@@ -472,86 +469,76 @@ def main():
hdmon = PywmHDMon(pathsToMonitor, procStat, actMonEnabled, skipping)
hdmon.mainLoop()
xpm = \
['160 100 13 1',
' \tc #208120812081',
'.\tc #00000000FFFF',
'o\tc #C71BC30BC71B',
'O\tc #861782078E38',
'+\tc #EFBEF3CEEFBE',
'@\tc #618561856185',
'#\tc #9E79A2899E79',
'$\tc #410341034103',
'o\tc #2020b2b2aaaa s indicator',
'/\tc #2020b2b2aaaa s graph',
'-\tc #707070707070 s graphbg',
'_\tc #000000000000 s background',
'%\tc #2081B2CAAEBA s text',
' ...............................................................................................',
' .///..___..ooo..___..___.......................................................................',
' .///..___..ooo..___..___.......................................................................',
' .///..___..ooo..___..___.......................................................................',
' ________________________________________________________ .///..___..___..___..___.......................................................................',
' ________________________________________________________ .///..___..___..___..___.......................................................................',
' ________________________________________________________ .///..___..___..___..___.......................................................................',
' ________________________________________________________ .///..___..___..ooo..___.......................................................................',
' ________________________________________________________ .///..___..___..ooo..___.......................................................................',
' ________________________________________________________ .///..___..___..ooo..___.......................................................................',
' ________________________________________________________ .///..___..___..___..___.......................................................................',
' ________________________________________________________ .///..___..___..___..___.......................................................................',
' ________________________________________________________ .///..___..___..___..___.......................................................................',
' ________________________________________________________ .///..___..___..___..ooo.......................................................................',
' ________________________________________________________ .///..___..___..___..ooo.......................................................................',
' ________________________________________________________ .///..___..___..___..ooo.......................................................................',
' ________________________________________________________ .///...........................................................................................',
' ________________________________________________________ .///...........................................................................................',
' ________________________________________________________ .///...........................................................................................',
' ________________________________________________________ .///...........................................................................................',
' ________________________________________________________ .///...........................................................................................',
' ________________________________________________________ .///...........................................................................................',
' ________________________________________________________ .///...........................................................................................',
' ________________________________________________________ .///...........................................................................................',
' ________________________________________________________ .///...........................................................................................',
' ________________________________________________________ .///...........................................................................................',
' ________________________________________________________ .///...........................................................................................',
' ________________________________________________________ .///...........................................................................................',
' ________________________________________________________ .///...........................................................................................',
' ________________________________________________________ .///...........................................................................................',
' ________________________________________________________ .///...........................................................................................',
' ________________________________________________________ .///...........................................................................................',
' ________________________________________________________ .///...........................................................................................',
' ________________________________________________________ .///...........................................................................................',
' ________________________________________________________ .///...........................................................................................',
' ________________________________________________________ .///...........................................................................................',
' ________________________________________________________ .///...........................................................................................',
' ________________________________________________________ .///...........................................................................................',
' ________________________________________________________ .///...........................................................................................',
' ________________________________________________________ .///...........................................................................................',
' ________________________________________________________ .///...........................................................................................',
' ________________________________________________________ .///...........................................................................................',
' ________________________________________________________ .///...........................................................................................',
' ________________________________________________________ .///...........................................................................................',
' ________________________________________________________ .///...........................................................................................',
' ________________________________________________________ .///...........................................................................................',
' ________________________________________________________ .///...........................................................................................',
' ________________________________________________________ .///...........................................................................................',
' ________________________________________________________ .///...........................................................................................',
' ________________________________________________________ .///...........................................................................................',
' ________________________________________________________ .///...........................................................................................',
' ________________________________________________________ .///...........................................................................................',
' ________________________________________________________ .///...........................................................................................',
' ________________________________________________________ .///...-------------------------------------------------------------------------------------...',
' ________________________________________________________ .///...-------------------------------------------------------------------------------------...',
' ________________________________________________________ .///...-------------------------------------------------------------------------------------...',
' ________________________________________________________ .///...-------------------------------------------------------------------------------------...',
' ________________________________________________________ .///...........................................................................................',
' ________________________________________________________ .///////////////////////////////////////////////////////////////////////////////////////////...',
' ________________________________________________________ .///////////////////////////////////////////////////////////////////////////////////////////...',
' .///////////////////////////////////////////////////////////////////////////////////////////...',
' .///////////////////////////////////////////////////////////////////////////////////////////...',
' ...............................................................................................',
' ...............................................................................................',
] + wmdocklib.char_map
background = \
['0000000000000000000000000000000000000000000000000000000000000000',
'0044400555002220055500555000000000000000000000000000000000000000',
'0044400555002220055500555000000000000000000000000000000000000000',
'0044400555002220055500555000000000000000000000000000000000000000',
'0044400555005550055500555000000000000000000000000000000000000000',
'0044400555005550055500555000000000000000000000000000000000000000',
'0044400555005550055500555000000000000000000000000000000000000000',
'0044400555005550022200555000000000000000000000000000000000000000',
'0044400555005550022200555000000000000000000000000000000000000000',
'0044400555005550022200555000000000000000000000000000000000000000',
'0044400555005550055500555000000000000000000000000000000000000000',
'0044400555005550055500555000000000000000000000000000000000000000',
'0044400555005550055500555000000000000000000000000000000000000000',
'0044400555005550055500222000000000000000000000000000000000000000',
'0044400555005550055500222000000000000000000000000000000000000000',
'0044400555005550055500222000000000000000000000000000000000000000',
'0044400000000000000000000000000000000000000000000000000000000000',
'0044400000000000000000000000000000000000000000000000000000000000',
'0044400000000000000000000000000000000000000000000000000000000000',
'0044400000000000000000000000000000000000000000000000000000000000',
'0044400000000000000000000000000000000000000000000000000000000000',
'0044400000000000000000000000000000000000000000000000000000000000',
'0044400000000000000000000000000000000000000000000000000000000000',
'0044400000000000000000000000000000000000000000000000000000000000',
'0044400000000000000000000000000000000000000000000000000000000000',
'0044400000000000000000000000000000000000000000000000000000000000',
'0044400000000000000000000000000000000000000000000000000000000000',
'0044400000000000000000000000000000000000000000000000000000000000',
'0044400000000000000000000000000000000000000000000000000000000000',
'0044400000000000000000000000000000000000000000000000000000000000',
'0044400000000000000000000000000000000000000000000000000000000000',
'0044400000000000000000000000000000000000000000000000000000000000',
'0044400000000000000000000000000000000000000000000000000000000000',
'0044400000000000000000000000000000000000000000000000000000000000',
'0044400000000000000000000000000000000000000000000000000000000000',
'0044400000000000000000000000000000000000000000000000000000000000',
'0044400000000000000000000000000000000000000000000000000000000000',
'0044400000000000000000000000000000000000000000000000000000000000',
'0044400000000000000000000000000000000000000000000000000000000000',
'0044400000000000000000000000000000000000000000000000000000000000',
'0044400000000000000000000000000000000000000000000000000000000000',
'0044400000000000000000000000000000000000000000000000000000000000',
'0044400000000000000000000000000000000000000000000000000000000000',
'0044400000000000000000000000000000000000000000000000000000000000',
'0044400000000000000000000000000000000000000000000000000000000000',
'0044400000000000000000000000000000000000000000000000000000000000',
'0044400000000000000000000000000000000000000000000000000000000000',
'0044400000000000000000000000000000000000000000000000000000000000',
'0044400000000000000000000000000000000000000000000000000000000000',
'0044400000000000000000000000000000000000000000000000000000000000',
'0044400000000000000000000000000000000000000000000000000000000000',
'0044400000000000000000000000000000000000000000000000000000000000',
'0044400000000000000000000000000000000000000000000000000000000000',
'0044400077777777777777777777777777777777777777777777777777777777',
'0044400077777777777777777777777777777777777777777777777777777777',
'0044400077777777777777777777777777777777777777777777777777777777',
'0044400077777777777777777777777777777777777777777777777777777777',
'0044400000000000000000000000000000000000000000000000000000000000',
'0044444444444444444444444444444444444444444444444444444444444444',
'0044444444444444444444444444444444444444444444444444444444444444',
'0044444444444444444444444444444444444444444444444444444444444444',
'0044444444444444444444444444444444444444444444444444444444444444',
'0000000000000000000000000000000000000000000000000000000000000000',
'0000000000000000000000000000000000000000000000000000000000000000',
]
char_width, char_height = wmdocklib.initPixmap(background,
font_name='6x8',
bg='7', fg='a')
if __name__ == '__main__':
main()