-
Notifications
You must be signed in to change notification settings - Fork 11
Managing Lcdproc configuration with cme
This page explains how to use cme to manage lcdproc configuration file /etc/LCDd.conf.
On Debian/Ubuntu:
apt-get install cme libconfig-model-lcdproc-perl
To get the optional graphical interface, add:
apt-get install libconfig-model-tkui-perl
Run
cpanm App::Cme
cpanm Config::Model::LcdProc
cpanm Config::Model::TkUI
Since /etc/LCDd.conf is owned by root, using sudo is necessary.
Most of the time, running sudo cme check lcdproc is enough to check your configuration. If all is well, cme will show:
$ sudo cme check lcdproc
loading data
checking data
check done
LCDd.conf delivered with lcdproc provides a configuration for all available drivers. cme will consider valid only the configuration enabled in server section. So cme will complain about the file provided by lcdproc:
$ sudo cme check lcdproc
loading data
Configuration item 'LCDd' (class LCDd) has a Load data structure (perl) error:
load_data: tried to load hidden element 'CFontz' with
$wrong data = {
'OffBrightness' => '0',
'Brightness' => '1000',
'Size' => '20x4',
'NewFirmware' => 'no',
'Reboot' => 'no',
'Device' => '/dev/ttyS0',
'Contrast' => '350',
'Speed' => '9600'
};
The solution is to use -force option so the configuration for unused driver is ignored:
$ sudo cme check lcdproc -force
loading data
checking data
check done
To avoid using -force, you can choose to edit LCDd.conf and remove the unused configuration. Or you can run sudo cme fix lcdproc -force.
Then, a check will succeed without -force option:
$ sudo cme check lcdproc
loading data
checking data
check done
Once you run sudo cme edit lcdproc -force (-force option may not be needed), you will see a window like:

The green arrow means that the value is different from the default value. For instance Driver
is set to curses. This screen shot was taken after loading the configuration file provided by lcdproc 0.5.4 where Driver is indeed set to curses.
This driver is probably not what you need. The first thing to do is:
- right-click on Driver
- set the driver you need (e.g
imon) - click on store
- note that the
cursesline at the bottom of the left window was replaced byimon

Continuing with imon example, you can now close the server entry
(to make room) by clicking on - left of server and open the imon
configuration by clicking on the '+` left of imon:

You'll probably need to change imon device file:
- right click on
Device - change the device file value
- store the value
Once, this is done, you need to save the changes to the configuration by clicking on File->save menu.
If you have trouble running the graphical interface, you can use
a shell like interface by running cme edit command with -ui shell option:
$ cme edit lcdproc -force -ui shell
>:$ ls
server curses menu
>:$ ll
name value type comment
server <LCDd::server> node
curses <LCDd::curses> node
menu <LCDd::menu> node
>:$ cd server
>: server $ ls
AutoRotate Backlight Bind Driver DriverPath Foreground GoodBye Heartbeat Hello NextScreenKey Port PrevScreenKey ReportLevel ReportToSyslog ScrollDownKey ScrollUpKey ServerScreen TitleSpeed ToggleRotateKey User WaitTime
>: server $ ll Driver
name value type comment
Driver curses enum choice: bayrad CFontz CFontzPacket curses CwLnx ea65 EyeboxOne g15 glcd glcdlib glk hd44780 icp_a106 imon imonlcd IOWarrior irman joy lb216 lcdm001 lcterm lirc lis MD8800 mdm166a ms6931 mtc_s16209x MtxOrb mx5000 NoritakeVFD picolcd pyramid sdeclcd sed1330 sed1520 serialPOS serialVFD shuttleVFD sli stv5730 svga t6963 text tyan ula200 vlsys_m428 xosd
>: server $ set Driver=imon
>: server $ cd -
>:$ cd imon
>: imon $ ls
CharMap Device Size
>: imon $ ll Device
name value type comment
Device /dev/lcd0 uniline
>: imon $ set Device=/dev/lcd1
>: imon $ ll Device
name value type comment
Device /dev/lcd1 uniline
>: imon $ exit
For more details, see the documentation on available commands
You can use the modify subcommand of cme to perform a similar task on the
command line:
cme modify lcdproc -force server Driver=imon - imon Device=/dev/lcd1
The command used after the -force option follow the syntax described in
Config::Model::Loader documentation.
You can use the check subcommand of cme to check the validity of
/etc/LCDd.conf:
cme check lcdproc