This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # | |
| # File: msr.py | |
| # Version: 1.1 | |
| # Author: Damien Bobillot (damien.bobillot.2002+msr@m4x.org) | |
| # Licence: GNU GPL version 3 | |
| # Compatibility: tested with python 2.7 on Mac OS X, should work with any python installations. | |
| # | |
| # Driver for the magnetic strip card reader/writer MSR605, and other versions | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mybattery = widget({ type="textbox"}) | |
| ... | |
| mywibox[s].widgets = { | |
| ... | |
| mybattery, | |
| ... | |
| } | |
| mytimer = timer({ timeout = 30 }) | |
| -- i am sorry... | |
| mytimer:add_signal("timeout", function () mybattery.text = io.popen("acpi | sed -e 's/Battery [0-9]: //' -e's/until charged//' -e 's/remaining//' -e's/ //g' -e 's/,/ /g'"):read() end) |
NewerOlder