本帖最后由 waylon 于 2015-9-10 00:38 编辑
完整配置的CONF文件内容:- # Create by waylon (waylon.bbs@gmail.com)
- # Create date: 2015/9/9
- Display dpf {
- Driver 'DPF'
- Port 'usb0'
- Font '6x8'
- Foreground FG_Default
- Background BG_Default
- Basecolor BG_Default
- Orientation 0 # 0 = standard, 1 = rotate 90° CW, 2 = rotate 180°, 3 = rotate 90° CCW
- Backlight 3 # Backlight variable control, 0..7 (0=off, 7=max)
- }
- # Head
- Widget Machine {
- class 'Text'
- expression uname('nodename')
- width 8
- align 'L'
- update minute
- Background BG_Head
- Foreground FG_Head
- }
- Widget Date {
- class 'Text'
- expression flagOnOff?(strftime('%m-%d %H:%M',time())):(uptime('Run %dd %H:%M'))
- width 13
- align 'R'
- update tick
- Background BG_Head
- Foreground FG_Head
- }
- # CPU status
- Widget CPU {
- class 'Text'
- expression proc_stat::cpu('busy', 500)
- prefix 'CPU '
- postfix '%'
- width 9
- precision 1
- align 'R'
- update tick
- }
- Widget CPUBar {
- class 'Bar'
- expression proc_stat::cpu('busy', 500)
- length 9
- max 100
- direction 'E' #E,W,N,S
- style 'H'
- update tick
- Foreground FG_BarFrame
- Background BG_BarGreen
- BarColor0 BC_Red
- BarColor1 BC_Red
- }
- Widget Load {
- class 'Text'
- expression loadavg(1)
- prefix 'Load'
- postfix loadavg(1)>1.0?'!':' '
- width 9
- precision 1
- align 'R'
- update second
- Foreground FG_Blue
- }
- # Volume Status
- Widget Vol {
- class 'Text'
- expression (statfs('/volume'.flagState, 'blocks') - statfs('/volume'.flagState, 'bavail')) / statfs('/volume'.flagState, 'blocks') * 100
- prefix 'Vol'.flagState
- postfix '%'
- precision 1
- width 11
- align 'R'
- update tick
- }
- Widget VolBar {
- class 'Bar'
- expression (statfs('/volume'.flagState, 'blocks') - statfs('/volume'.flagState, 'bavail')) / statfs('/volume'.flagState, 'blocks')
- #expression2 statfs('/volume1', 'bavail') / statfs('/volume1', 'blocks')
- max 1
- length 11
- direction 'E'
- style 'H'
- update tick
- Foreground FG_BarFrame
- Background BG_BarGreen
- BarColor0 BG_BarRed
- BarColor1 BG_BarRed
- }
- Widget VolU {
- class 'Text'
- expression (statfs('/volume'.flagState, 'blocks') - statfs('/volume'.flagState, 'bavail')) * statfs('/volume'.flagState, 'bsize') / 1024 / 1024 / 1024
- precision 1
- prefix 'U'
- postfix 'GB'
- width 11
- align 'R'
- update tick
- Foreground FG_Red
- }
- Widget VolF {
- class 'Text'
- expression statfs('/volume'.flagState, 'bavail') * statfs('/volume'.flagState, 'bsize') / 1024 / 1024 / 1024 / ((statfs('/volume'.flagState, 'bavail') * statfs('/volume'.flagState, 'bsize')> 1024*1024*1024*1024)?1024:1)
- precision 1
- prefix 'Free'
- postfix (statfs('/volume'.flagState, 'bavail') * statfs('/volume'.flagState, 'bsize')> 1024*1024*1024*1024)?'T':'G'
- width 11
- align 'R'
- update tick
- Foreground BG_BarGreen
- }
- # Disk status
- Widget Disk {
- class 'Text'
- expression 'Disk'
- width 5
- align 'L'
- update minute
- }
- Widget Disk1 {
- class 'Text'
- expression diskname1
- width 5
- align 'C'
- update tick
- Background BG_Transparency
- }
- Widget Disk1BG {
- class 'Image'
- file imgpath . 'diskhead' . (diskstats(diskpath1, 'read_sectors', 500)|diskstats(diskpath1, 'write_sectors', 500)?'1':'0') . '.png'
- reload 1
- update tick
- inverted 0
- visible 1
- }
- Widget Disk2 {
- class 'Text'
- expression diskname2
- width 5
- align 'C'
- update tick
- Background BG_Transparency
- }
- Widget Disk2BG {
- class 'Image'
- file imgpath . 'diskhead' . (diskstats(diskpath2, 'read_sectors', 500)|diskstats(diskpath2, 'write_sectors', 500)?'1':'0') . '.png'
- reload 1
- update tick
- inverted 0
- visible 1
- }
- Widget Disk3 {
- class 'Text'
- expression diskname3
- width 5
- align 'C'
- update tick
- Background BG_Transparency
- }
- Widget Disk3BG {
- class 'Image'
- file imgpath . 'diskhead' . (diskstats(diskpath3, 'read_sectors', 500)|diskstats(diskpath3, 'write_sectors', 500)?'1':'0') . '.png'
- reload 1
- update tick
- inverted 0
- visible 1
- }
- Widget Disk1BarR {
- class 'Bar'
- expression diskstats(diskpath1, 'read_sectors', 500)
- max 8
- length 1
- direction 'N'
- style 'H'
- update tick
- Foreground FG_DiskFrame
- Background BG_Disk
- BarColor0 BC_Yellow
- BarColor1 BC_Yellow
- }
- Widget Disk1BarW {
- class 'Bar'
- expression diskstats(diskpath1, 'write_sectors', 500)
- max 8
- length 1
- direction 'N'
- style 'H'
- update tick
- Foreground FG_DiskFrame
- Background BG_Disk
- BarColor0 BC_Red
- BarColor1 BC_Red
- }
- Widget Disk2BarR {
- class 'Bar'
- expression diskstats(diskpath2, 'read_sectors', 500)
- max 8
- length 1
- direction 'N'
- style 'H'
- update tick
- Foreground FG_DiskFrame
- Background BG_Disk
- BarColor0 BC_Yellow
- BarColor1 BC_Yellow
- }
- Widget Disk2BarW {
- class 'Bar'
- expression diskstats(diskpath2, 'write_sectors', 500)
- max 8
- length 1
- direction 'N'
- style 'H'
- update tick
- Foreground FG_DiskFrame
- Background BG_Disk
- BarColor0 BC_Red
- BarColor1 BC_Red
- }
- Widget Disk3BarR {
- class 'Bar'
- expression diskstats(diskpath3, 'read_sectors', 500)
- max 8
- length 1
- direction 'N'
- style 'H'
- update tick
- Foreground FG_DiskFrame
- Background BG_Disk
- BarColor0 BC_Yellow
- BarColor1 BC_Yellow
- }
- Widget Disk3BarW {
- class 'Bar'
- expression diskstats(diskpath3, 'write_sectors', 500)
- max 8
- length 1
- direction 'N'
- style 'H'
- update tick
- Foreground FG_DiskFrame
- Background BG_Disk
- BarColor0 BC_Red
- BarColor1 BC_Red
- }
- Widget DiskR {
- class 'Text'
- expression 'R ' . (diskstats(diskpath1, 'read_sectors', 500)|diskstats(diskpath2, 'read_sectors', 500)|diskstats(diskpath3, 'read_sectors', 500)?'\177':'')
- width 4
- align 'L'
- update tick
- Foreground FG_Yellow
- }
- Widget DiskW {
- class 'Text'
- expression 'W ' . (diskstats(diskpath1, 'write_sectors', 500)|diskstats(diskpath2, 'write_sectors', 500)|diskstats(diskpath3, 'write_sectors', 500)?'\176':'')
- width 4
- align 'L'
- update tick
- Foreground FG_Red
- }
- Widget Disk1R {
- class 'Text'
- expression diskstats(diskpath1, 'read_sectors', 500)/2/(diskstats(diskpath1, 'read_sectors', 500)/2>1024?1024:1)
- postfix diskstats(diskpath1, 'read_sectors', 500)/2>1024?'M':''
- precision 0
- width 4
- align 'R'
- update tick
- Foreground FG_Disk
- Background BG_Disk
- }
- Widget Disk1W {
- class 'Text'
- expression diskstats(diskpath1, 'write_sectors', 500)/2/(diskstats(diskpath1, 'write_sectors', 500)/2>1024?1024:1)
- postfix diskstats(diskpath1, 'write_sectors', 500)/2>1024?'M':''
- precision 0
- width 4
- align 'R'
- update tick
- Foreground FG_Disk
- Background BG_Disk
- }
- Widget Disk2R {
- class 'Text'
- expression diskstats(diskpath2, 'read_sectors', 500)/2/(diskstats(diskpath2, 'read_sectors', 500)/2>1024?1024:1)
- postfix diskstats(diskpath2, 'read_sectors', 500)/2>1024?'M':''
- precision 0
- width 4
- align 'R'
- update tick
- Foreground FG_Disk
- Background BG_Disk
- }
- Widget Disk2W {
- class 'Text'
- expression diskstats(diskpath2, 'write_sectors', 500)/2/(diskstats(diskpath2, 'write_sectors', 500)/2>1024?1024:1)
- postfix diskstats(diskpath2, 'write_sectors', 500)/2>1024?'M':''
- precision 0
- width 4
- align 'R'
- update tick
- Foreground FG_Disk
- Background BG_Disk
- }
- Widget Disk3R {
- class 'Text'
- expression diskstats(diskpath3, 'read_sectors', 500)/2/(diskstats(diskpath3, 'read_sectors', 500)/2>1024?1024:1)
- postfix diskstats(diskpath3, 'read_sectors', 500)/2>1024?'M':''
- precision 0
- width 4
- align 'R'
- update tick
- Foreground FG_Disk
- Background BG_Disk
- }
- Widget Disk3W {
- class 'Text'
- expression diskstats(diskpath3, 'write_sectors', 500)/2/(diskstats(diskpath3, 'write_sectors', 500)/2>1024?1024:1)
- postfix diskstats(diskpath3, 'write_sectors', 500)/2>1024?'M':''
- precision 0
- width 4
- align 'R'
- update tick
- Foreground FG_Disk
- Background BG_Disk
- }
- # Network status
- Widget Net {
- class 'Text'
- expression 'Network'
- width 9
- align 'L'
- update minute
- }
- Widget NetUpBar {
- class 'Bar'
- expression netdev(netdev, 'Tx_bytes', 500)/1024/1024
- max 100/8 #100Mbps:12.5MB/s
- length 9
- direction 'E'
- style 'H'
- update second
- Foreground FG_BarFrame
- Background '666666'
- BarColor0 BC_Yellow
- BarColor1 BC_Yellow
- }
- Widget NetDwBar {
- class 'Bar'
- expression netdev(netdev, 'Rx_bytes', 500)/1024/1024
- max 100/8 #100Mbps:12.5MB/s
- length 9
- direction 'E'
- style 'H'
- update second
- Foreground FG_BarFrame
- Background '666666'
- BarColor0 BC_Blue
- BarColor1 BC_Blue
- }
- Widget NetUp {
- class 'Text'
- expression netdev::fast('eth0', 'Tx_bytes', 500)/1024/(netdev::fast('eth0', 'Tx_bytes', 500)/1024>1024?1024:1)
- prefix 'U'
- postfix (netdev::fast('eth0', 'Tx_bytes', 500)/1024>1024?'M':'K').'B/s'
- width 9
- precision 0
- align 'R'
- update second
- Foreground FG_Yellow
- }
- Widget NetDw {
- class 'Text'
- expression netdev::fast('eth0', 'Rx_bytes', 500)/1024/(netdev::fast('eth0', 'Rx_bytes', 500)/1024>1024?1024:1)
- prefix 'D'
- postfix (netdev::fast('eth0', 'Rx_bytes', 500)/1024>1024?'M':'K').'B/s'
- precision 0
- width 9
- align 'R'
- update second
- Foreground FG_Blue
- }
- # Memory status
- Widget RAM {
- class 'Text'
- expression 'Memory'
- width 11
- align 'L'
- update minute
- }
- Widget RAMBar {
- class 'Bar'
- expression (meminfo('MemTotal') - meminfo('MemFree'))/meminfo('MemTotal')
- min 0
- max 1
- length 11
- direction 'E'
- style 'H'
- update second
- Foreground FG_BarFrame
- Background BG_BarGreen
- BarColor0 BC_Yellow
- BarColor1 BC_Yellow
- }
- Widget RAMBarU {
- class 'Bar'
- expression (meminfo('MemTotal') - meminfo('MemFree') - meminfo('Cached'))/meminfo('MemTotal')
- min 0
- max 1
- length 11
- direction 'E'
- style 'H'
- update second
- Foreground FG_BarFrame
- Background BG_Transparency
- BarColor0 BC_Red
- BarColor1 BC_Red
- }
- Widget RAMFp {
- class 'Text'
- expression meminfo('MemFree')/meminfo('MemTotal') * 100
- postfix '%'
- precision 0
- width 3
- align 'R'
- update second
- Foreground FG_Green
- }
- Widget RAMUp {
- class 'Text'
- expression (meminfo('MemTotal') - meminfo('MemFree') - meminfo('Cached'))/meminfo('MemTotal') * 100
- postfix '%'
- precision 0
- width 3
- align 'R'
- update second
- Foreground FG_Red
- }
- Widget RAMCp {
- class 'Text'
- expression meminfo('Cached')/meminfo('MemTotal') * 100
- postfix '%'
- precision 0
- width 3
- align 'R'
- update second
- Foreground FG_Yellow
- }
- Widget RAMF {
- class 'Text'
- expression meminfo('MemFree')/1024/(meminfo('MemFree')/1024>1024?1024:1)
- prefix 'F'
- postfix meminfo('MemFree')/1024>1024?'G':'M'
- precision meminfo('MemFree')/1024>1024?2:0
- width 7
- align 'R'
- update second
- Foreground FG_Green
- }
- Widget RAMU {
- class 'Text'
- expression (meminfo('MemTotal') - meminfo('MemFree') - meminfo('Cached'))/1024/((meminfo('MemTotal') - meminfo('MemFree') - meminfo('Cached'))/1024>1024?1024:1)
- prefix 'U'
- postfix (meminfo('MemTotal') - meminfo('MemFree') - meminfo('Cached'))/1024>1024?'G':'M'
- precision (meminfo('MemTotal') - meminfo('MemFree') - meminfo('Cached'))/1024>1024?2:0
- width 7
- align 'R'
- update second
- Foreground FG_Red
- }
- Widget RAMC {
- class 'Text'
- expression meminfo('Cached')/1024/(meminfo('Cached')/1024>1024?1024:1)
- prefix 'C'
- postfix meminfo('Cached')/1024>1024?'G':'M'
- precision meminfo('Cached')/1024>1024?2:0
- width 7
- align 'R'
- update second
- Foreground FG_Yellow
- }
- Widget Foot {
- class 'Text'
- expression '-= waylon.wang =-'
- align 'C'
- width 21
- update minute
- Foreground FG_BarFrame
- }
- # Timer
- Widget FlagOnOffTimer {
- class 'Timer'
- expression flagOnOff=(time() % 10 < 5)?0:1
- active 1
- update tick
- }
- Widget FlagStateTimer {
- class 'Timer'
- expression flagState=(time() % 15 < 5)?1:((time() % 15 > 9)?3:2)
- active 1
- update tick
- }
- Widget LcdLightTimer{
- class 'Timer'
- expression LCD::backlight(file::readline(cfgpath . 'light.conf', 1))
- active 1
- update second * 5
- }
- Display 'DPF'
- Layout layout_128x128 {
- # Title
- Row01.Col01 'Machine'
- Row01.Col09 'Date'
- # CPU & Volume
- Row03.Col01 'CPU'
- Row03.Col11 'Vol'
- Row04.Col01 'CPUBar'
- Row04.Col11 'VolBar'
- Row05.Col01 'Load'
- Row05.Col11 'VolF'
- # Disks
- Row07.Col01 'Disk'
- Row08.Col01 'DiskR'
- Row08.Col05 'Disk1BarR'
- Row08.Col06 'Disk1R'
- Row08.Col11 'Disk2BarR'
- Row08.Col12 'Disk2R'
- Row08.Col17 'Disk3BarR'
- Row08.Col18 'Disk3R'
- Row09.Col01 'DiskW'
- Row09.Col05 'Disk1BarW'
- Row09.Col06 'Disk1W'
- Row09.Col11 'Disk2BarW'
- Row09.Col12 'Disk2W'
- Row09.Col17 'Disk3BarW'
- Row09.Col18 'Disk3W'
- # Network & Memory
- Row11.Col01 'Net'
- Row11.Col11 'RAM'
- Row12.Col01 'NetUpBar'
- Row12.Col11 'RAMBar'
- Row13.Col01 'NetUp'
- Row13.Col11 'RAMU'
- Row13.Col19 'RAMUp'
- Row14.Col01 'NetDwBar'
- Row14.Col11 'RAMC'
- Row14.Col19 'RAMCp'
- Row15.Col01 'NetDw'
- Row15.Col11 'RAMF'
- Row15.Col19 'RAMFp'
- # Foot
- Row16.Col01 'Foot'
- # Layer
- Layer 1{
- X49.Y25 'Disk1BG'
- X49.Y61 'Disk2BG'
- X49.Y97 'Disk3BG'
- }
- Layer 0 {
- Row07.Col05 'Disk1' #Overlap Disk1BG
- Row07.Col11 'Disk2' #Overlap Disk2BG
- Row07.Col17 'Disk3' #Overlap Disk3BG
- Row12.Col11 'RAMBarU' #Overlap RAMBar
- }
- # Timer
- Timer1 'FlagOnOffTimer'
- Timer2 'FlagStateTimer'
- Timer3 'LcdLightTimer'
- }
- Layout 'layout_128x128'
- Variables {
- # Time variables
- tick 500
- second 1000
- minute 60000
- # Disk variables
- diskname1 '1/2'
- diskname2 '3'
- diskname3 '4'
- diskpath1 'md2'
- diskpath2 'md3'
- diskpath3 'md4'
- # File path
- cfgpath '/volume1/homes/waylon/lcd4linux/'
- imgpath '/volume1/homes/waylon/lcd4linux/'
- # Background color
- BG_Default '000000'
- BG_Head '336699'
- BG_Disk '333333'
- BG_BarRed 'FF0000'
- BG_BarGreen '00FF00'
- BG_Transparency '00000000'
- # Foreground color
- FG_Default 'FFFFFF'
- FG_Head 'FFFFFF'
- FG_Disk 'CCCCCC'
- FG_BarFrame '6F6F6F'
- FG_DiskFrame '666666'
- FG_Red 'FF0000'
- FG_Blue '99CCFF'
- FG_Green '00FF00'
- FG_Yellow 'FFCC33'
- # Bar color
- BC_Red 'FF0000'
- BC_Blue '99CCFF'
- BC_Yellow 'FFCC33'
- }
复制代码
|