forked from updateing/lcd4linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME
More file actions
147 lines (121 loc) · 6.7 KB
/
Copy pathREADME
File metadata and controls
147 lines (121 loc) · 6.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# $Id$
# $URL$
Sorry, there is no README anymore.
Go to http://lcd4linux.bulix.org for all the documentation.
图标小部件 https://wiki.lcd4linux.tk/doku.php/widget_icon
图标小部件用于显示用户定义的字符(我们称它们为图标)。只有当显示屏支持用户定义的字符(大多数显示器都支持图标),并且您为图标保留了一些字符,或者您的显示屏是图形字符(例如 T6963)时,您只能使用图标。有关详细信息,请参阅显示驱动器的文档。
如果由于任何原因无法显示图标,则将改用星号 ('*)。
图标小部件的定义非常简单:
Widget <name> {
class 'icon'
speed <number>
visible <expr>
frame <expr>
foreground <color>
background <color>
bitmap {
row1 <string>
row2 <string>
...
row8 <string>
}
}
参数:
速度 speed 动画间隔 (msec), 默认: 100 msec, 0 (零) 表示永远不会 (静态图标)
可见 visible 表示控制可见性(用于闪烁效果)
框架 frame 表示控制要从图标地图中显示的帧(在需要同步 2 个或更多动画图标时有用)
前景 foreground 活动像素的颜色 (RRGGBBAA 或 RRGGBB),默认是不透明的黑色"00000ff"(详情请参阅颜色)
背景 background 非活动像素的颜色 (RRGGBBAA 或 RRGGBB),默认是透明的"ffff00"(有关详细信息,请参阅颜色)
位图.行* bitmap.row* 定义位图的字符串
例子:
静态图标:
Widget Lightning {
class 'icon'
bitmap {
row1 '...***'
row2 '..***.'
row3 '.***..'
row4 '.****.'
row5 '..**..'
row6 '.**...'
row7 '**....'
row8 '*.....'
}
}
动画图标:
Widget Heartbeat {
class 'Icon'
speed 800
Bitmap {
Row1 '.....|.....'
Row2 '.*.*.|.*.*.'
Row3 '*****|*.*.*'
Row4 '*****|*...*'
Row5 '.***.|.*.*.'
Row6 '.***.|.*.*.'
Row7 '..*..|..*..'
Row8 '.....|.....'
}
}
我认为这不需要进一步的解释...
\
\
使用"帧"参数同步图标:(请参阅此页面底部的附件以进行演示)
Widget MailIcon_left {
class 'Icon'
speed 100
update 100
# Note that the following bitmap only needs to be half of it's current size,
#+ as it's a reversing animation, but has been extended for purpose of illustration
Bitmap {
Row1 '.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....'
Row2 '.....|.....|.....|.....|.....|.....|.....|....*|...**|..***|.****|*****|*****|*****|*****|*****|*****|.****|..***|...**|....*|.....|.....|.....|.....|.....|.....|.....|.....|.....'
Row3 '.....|.....|.....|.....|.....|.....|.....|....*|...*.|..*.*|.*.*.|*.*..|*.*..|*.*..|*.*..|*.*..|*.*..|.*.*.|..*.*|...*.|....*|.....|.....|.....|.....|.....|.....|.....|.....|.....'
Row4 '.....|.....|.....|.....|.....|.....|.....|....*|...*.|..*..|.*..*|*..*.|*..*.|*..*.|*..*.|*..*.|*..*.|.*..*|..*..|...*.|....*|.....|.....|.....|.....|.....|.....|.....|.....|.....'
Row5 '.....|.....|.....|.....|.....|.....|.....|....*|...*.|..*..|.*...|*...*|*...*|*...*|*...*|*...*|*...*|.*...|..*..|...*.|....*|.....|.....|.....|.....|.....|.....|.....|.....|.....'
Row6 '.....|.....|.....|.....|.....|.....|.....|....*|...*.|..*..|.*...|*....|*....|*....|*....|*....|*....|.*...|..*..|...*.|....*|.....|.....|.....|.....|.....|.....|.....|.....|.....'
Row7 '.....|.....|.....|.....|.....|.....|.....|....*|...**|..***|.****|*****|*****|*****|*****|*****|*****|.****|..***|...**|....*|.....|.....|.....|.....|.....|.....|.....|.....|.....'
Row8 '.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....'
}
# Note that the first call to bar8 increments/decrements the counter
#+ and that the visibility formula does not need to be so complicated for the purpose of this example.
visible ( test::bar(8,29,0,1) > 6 & test::bar(8,29,0,0) < 21 ) * ( exec(mailcheck_script,mailcheck_refresh) > 0 )
# Select which frame we want shown
frame test::bar(8,29,0,0)
}
Widget MailIcon_right {
class 'Icon'
speed 100
update 100
# Notes in MailIcon_left apply here, too
frame test::bar(8,29,0,0)
Bitmap {
Row1 '.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|'
Row2 '.....|.....|....*|...**|..***|.****|*****|*****|*****|*****|*****|*****|*****|*****|*****|*****|*****|*****|*****|*****|*****|*****|.****|..***|...**|....*|.....|.....|.....|.....|'
Row3 '.....|.....|....*|...*.|..*.*|.*.*.|*.*..|.*...|*....|....*|...*.|..*.*|..*.*|..*.*|..*.*|..*.*|..*.*|...*.|....*|*....|.*...|*.*..|.*.*.|..*.*|...*.|....*|.....|.....|.....|.....|'
Row4 '.....|.....|....*|...*.|..*..|.*...|*..*.|..*..|.*...|*..*.|..*..|.*..*|.*..*|.*..*|.*..*|.*..*|.*..*|..*..|*..*.|.*...|..*..|*..*.|.*...|..*..|...*.|....*|.....|.....|.....|.....|'
Row5 '.....|.....|....*|...*.|..*..|.*...|*...*|...**|..**.|.**..|**...|*...*|*...*|*...*|*...*|*...*|*...*|**...|.**..|..**.|...**|*...*|.*...|..*..|...*.|....*|.....|.....|.....|.....|'
Row6 '.....|.....|....*|...*.|..*..|.*...|*....|.....|.....|.....|.....|....*|....*|....*|....*|....*|....*|.....|.....|.....|.....|*....|.*...|..*..|...*.|....*|.....|.....|.....|.....|'
Row7 '.....|.....|....*|...**|..***|.****|*****|*****|*****|*****|*****|*****|*****|*****|*****|*****|*****|*****|*****|*****|*****|*****|.****|..***|...**|....*|.....|.....|.....|.....|'
Row8 '.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|'
}
# The bar8 counter has already been incremented by MailIcon_left
visible ( test::bar(8,29,0,0) > 1 & test::bar(8,29,0,0) < 26 ) * ( exec(mailcheck_script,mailcheck_refresh) > 0 )
frame test::bar(8,29,0,0)
}
\
mailcheck_script可能是类似:
#!/usr/bin/php
<?php
$mbox = imap_open("{localhost/tls/novalidate-cert}", "username", "password", OP_HALFOPEN)
or die("can't connect: " . imap_last_error());
$status = imap_status($mbox, "{localhost}Inbox", SA_UNSEEN);
if ($status) {
echo $status->unseen;
} else {
echo "0";
}
imap_close($mbox);
?>
能见度
您可以指定可见的表示形式,每次更新图标(每个速度msec)都会对该表示进行评估。如果表示体评估为 0(零),则图标是不可见的,并且将被空白替换。如果结果不是零,将显示图标。这对于闪烁效果或活动显示很有用。