forked from updateing/lcd4linux
-
Notifications
You must be signed in to change notification settings - Fork 0
lcd4linux fork, added some handy features.
License
netusb/lcd4linux
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
# $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(零),则图标是不可见的,并且将被空白替换。如果结果不是零,将显示图标。这对于闪烁效果或活动显示很有用。
About
lcd4linux fork, added some handy features.
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published
Languages
- C 88.5%
- M4 4.1%
- Shell 4.1%
- Makefile 3.0%
- Python 0.2%
- Perl 0.1%