On Tue, 2013-01-08 at 07:34 +0100, Hanno Hecker wrote: > On Mon, 07 Jan 2013 13:38:26 +0000 > Ian Campbell <i...@hellion.org.uk> wrote: > > > On Sun, 2013-01-06 at 19:31 +0100, Hanno Hecker wrote: > > > the attached patch loads "/etc/qcontrol/local.lua" if it exists and has no > > > errors. Maybe this should not be only for ts41x.lua :) > > > > Thanks. Do you find this preferential to just editing ts41x.lua directly > > for some reason? > I like it when I can drop my local configs in some directory where > they're read without having to modify the original configs.
This makes sense. I'd be inclined to go a bit further than you and have /etc/qcontrol.conf contain nothing but a loop over /etc/qcontrol.conf.d/* reading multiple files. The current symlink would move to /etc/qcontrol.conf.d/50hardware.lua. It could also conditionally create e.g. 60lcd.lua on systems where the LCD support might be present etc. I'll take a look at this at some point (in my Copious Free Time...). > > Since qcontrol actually reads /etc/qcontrol.conf which is created as a > > symlink by the package perhaps locally creating that as a real file > > which reads /etc/qcontrol/ts41x.lua and also contains your local > > configuration would be another option? > Hmm, this is what I've done until now. You can also make this config > dynamic, i.e. read the machine type, register() it and then load the > machine specific file and local additions. I considered that in the past -- http://www.hellion.org.uk/blog/posts/consolidating-qcontrol-configuration-files/ My conclusion was that the complexity cost in the configuration file was too high. > > Do you have anything generically useful in your local config? The > > shipped examples are pretty simplistic, especially wrt LCD and button > > handling and I'm open to (or, better, patches ;-)) ideas to make them > > more useful. > Do a > svn checkout http://svn.ankh-morp.org:8080/qcontrol_config/ > and take a look into trunk/lcd-menu.lua (there's also a "dynamic" > qcontrol.conf) Wow ;-) At some point (again in my CFT) I'd like to pick this up, if that's ok with you. I'll let you know and ask permission (we'd probably need to talk licensing) when I eventually get to it. I notice you've observed a lack of opendir in lua. That might be a good argument for doing the iteration over /etc/qcontrol.conf.d in the C part I suppose. Thanks, Ian. -- Ian Campbell Current Noise: Cradle Of Filth - Manticore The control of the production of wealth is the control of human life itself. -- Hilaire Belloc -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org