From 387ab4a8b1f08f1db9993d19f5c523a1b5ae2d16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Wed, 25 Jan 2017 19:42:04 +0100 Subject: [PATCH] move ac widget to match new layout --- contrib/{README => README.md} | 15 ++++++++++----- contrib/{ac.lua => ac_linux.lua} | 4 ++-- 2 files changed, 12 insertions(+), 7 deletions(-) rename contrib/{README => README.md} (94%) rename contrib/{ac.lua => ac_linux.lua} (87%) diff --git a/contrib/README b/contrib/README.md similarity index 94% rename from contrib/README rename to contrib/README.md index 88e15e1..45e266a 100644 --- a/contrib/README +++ b/contrib/README.md @@ -28,12 +28,17 @@ could also depend on Lua libraries that are not distributed with the core Lua distribution. Ease of installation and use does not necessarily have to apply to contributed widgets. -vicious.contrib.ac - - provide status about the power supply (AC) - - takes the AC device as an argument, i.e "AC" or "ACAD" - - the device is linked under /sys/class/power_supply/ and should +**vicious.contrib.ac** + +Provide status about the power supply (AC) +Supported platforms: Linux (required tools: `sysfs`) + +- Arguments: + * takes the AC device as an argument, i.e "AC" or "ACAD" + * the device is linked under /sys/class/power_supply/ and should have a file called "online" - - if AC is connected, $1 returns "On", if not it returns "Off", +- Returns + * if AC is connected, $1 returns "On", if not it returns "Off", if AC doesn't exist, $1 is "N/A" vicious.contrib.ati diff --git a/contrib/ac.lua b/contrib/ac_linux.lua similarity index 87% rename from contrib/ac.lua rename to contrib/ac_linux.lua index 48d1961..73afb03 100644 --- a/contrib/ac.lua +++ b/contrib/ac_linux.lua @@ -14,7 +14,7 @@ local math = { } -- }}} -local ac = {} +local ac_linux = {} -- {{{ AC widget type local function worker(format, warg) @@ -32,4 +32,4 @@ end -- }}} -return setmetatable(_M, { __call = function(_, ...) return worker(...) end }) +return setmetatable(ac_linux, { __call = function(_, ...) return worker(...) end })