summaryrefslogtreecommitdiff
path: root/MouseBatteryWidget/mouse-battery.lua
diff options
context:
space:
mode:
authorstreetturtle <streetturtle@gmail.com>2017-01-30 21:38:50 -0500
committerstreetturtle <streetturtle@gmail.com>2017-01-30 21:38:50 -0500
commit2c387ecc1049454aa1d37d093e37e2b8e37aecf3 (patch)
tree700c11c23686a1ccc2c2e71dd1fcd8677b65809b /MouseBatteryWidget/mouse-battery.lua
parenta079c79ab81a4bc2f7cf7971db6373fefe1e6110 (diff)
new widgets added
Diffstat (limited to 'MouseBatteryWidget/mouse-battery.lua')
-rw-r--r--MouseBatteryWidget/mouse-battery.lua33
1 files changed, 0 insertions, 33 deletions
diff --git a/MouseBatteryWidget/mouse-battery.lua b/MouseBatteryWidget/mouse-battery.lua
deleted file mode 100644
index 7b3fd4c..0000000
--- a/MouseBatteryWidget/mouse-battery.lua
+++ /dev/null
@@ -1,33 +0,0 @@
-local wibox = require("wibox")
-local awful = require("awful")
-
--- text widget
-mouse_widget = wibox.widget.textbox()
-mouse_widget:set_font('Play 9')
-
-function update_mouse_widget(widget)
- local current = awful.util.pread(
- "upower -i /org/freedesktop/UPower/devices/mouse_0003o046Do101Ax0006 " ..
- "| grep percentage | grep -E -o '[0-9]+'")
- widget:set_text(current)
-end
-
-mouse_timer = timer({ timeout = 3600 })
-mouse_timer:connect_signal("timeout", function () update_mouse_widget(mouse_widget) end)
-mouse_timer:start()
-mouse_timer:emit_signal("timeout")
-
--- icon widget
-mouse_battery_icon = wibox.widget.imagebox()
-
-function update_mouse_battery_icon(icon)
- local iconName = awful.util.pread("upower -i /org/freedesktop/UPower/devices/mouse_0003o046Do101Ax0006 " ..
- "| grep icon-name | grep -oP \"(?<=').*(?=')\"")
- icon:set_image("/usr/share/icons/gnome/scalable/status/" .. string.gsub(iconName, "\n", "") .. ".svg")
-end
-
-mouse_battery_timer = timer({ timeout = 60 })
-mouse_battery_timer:connect_signal("timeout", function() update_mouse_battery_icon(mouse_battery_icon) end)
-mouse_battery_timer:start()
-
-mouse_battery_timer:emit_signal("timeout")