From c2617a059f8a226ff3028ec03f8fed00b5c3f026 Mon Sep 17 00:00:00 2001 From: streetturtle Date: Tue, 14 Jul 2015 09:04:27 +0200 Subject: update readme --- VolumeWidget/README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/VolumeWidget/README.md b/VolumeWidget/README.md index 2c4a717..651bd2d 100644 --- a/VolumeWidget/README.md +++ b/VolumeWidget/README.md @@ -7,6 +7,12 @@ This widget represents the sound level: ![Volume Wiget](./volWid.png) - clone/copy volume.lua file and volume-icons folder to your `~/home/username/.config/awesome/` folder; +- change path to the icons in `volume.lua`: + +``` + widget:set_image("/home//.config/awesome/volume-icons/" .. volumeLevel .. ".png") +``` + - include `volume.lua` and add volume widget to your wibox in rc.lua: ``` require("volume") -- cgit v1.2.3 From 8887e19b5db55c8ef3efe7a47e29bc96127d0896 Mon Sep 17 00:00:00 2001 From: streetturtle Date: Tue, 14 Jul 2015 09:04:53 +0200 Subject: Update README.md --- VolumeWidget/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VolumeWidget/README.md b/VolumeWidget/README.md index 651bd2d..312fa4d 100644 --- a/VolumeWidget/README.md +++ b/VolumeWidget/README.md @@ -10,7 +10,7 @@ This widget represents the sound level: ![Volume Wiget](./volWid.png) - change path to the icons in `volume.lua`: ``` - widget:set_image("/home//.config/awesome/volume-icons/" .. volumeLevel .. ".png") +widget:set_image("/home//.config/awesome/volume-icons/" .. volumeLevel .. ".png") ``` - include `volume.lua` and add volume widget to your wibox in rc.lua: -- cgit v1.2.3 From 53af2779017f9aa6da219ed61123d5933881ceb1 Mon Sep 17 00:00:00 2001 From: streetturtle Date: Thu, 16 Jul 2015 13:09:42 +0200 Subject: Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index f6408f3..7c5a7a3 100644 --- a/README.md +++ b/README.md @@ -1 +1,3 @@ # AwesomeWM + +Some of my settings/widgets for Awesome which could be interesting for somebody. -- cgit v1.2.3 From b7f23fa80da1569a5a4580b9bdbd6cda29702088 Mon Sep 17 00:00:00 2001 From: streetturtle Date: Sat, 18 Jul 2015 10:11:36 +0200 Subject: warning widget added --- BatteryWidget/battery.lua | 44 +++++++++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/BatteryWidget/battery.lua b/BatteryWidget/battery.lua index 09e0ed6..3e9dd9a 100644 --- a/BatteryWidget/battery.lua +++ b/BatteryWidget/battery.lua @@ -7,39 +7,49 @@ function showBatteryWidgetPopup() naughty.notify({ text = awful.util.pread("acpi | cut -d, -f 2,3"), title = "Battery status", - timeout = 2, hover_timeout = 0.5, + timeout = 5, hover_timeout = 0.5, width = 160, }) end +function showWarningWidgetPopup() + local charge = tonumber(awful.util.pread("acpi | cut -d, -f 2 | egrep -o '[0-9]{1,3}'")) + if (charge < 15) then + naughty.notify({ + text = "Huston, we have a problem", + title = "Battery dying", + timeout = 5, hover_timeout = 0.5, + position = "bottom_right", + bg = "#ff1122", + width = 160, + }) + end +end + function showBatteryWidgetIcon() local charge = tonumber(awful.util.pread("acpi | cut -d, -f 2 | egrep -o '[0-9]{1,3}'")) local batteryType if (charge >= 0 and charge < 20) then batteryType=20 - elseif (charge >= 20 and charge < 40) then batteryType=40 - elseif (charge >= 40 and charge < 60) then batteryType=60 - elseif (charge >= 60 and charge < 80) then batteryType=80 - elseif (charge >= 80 and charge < 100) then batteryType=100 + elseif (charge >= 20 and charge < 40) then batteryType=40 + elseif (charge >= 40 and charge < 60) then batteryType=60 + elseif (charge >= 60 and charge < 80) then batteryType=80 + elseif (charge >= 80 and charge <= 100) then batteryType=100 end - batteryIcon:set_image("/home/pashik/.config/awesome/battery-icons/" .. batteryType .. ".png") + batteryIcon:set_image("/home/username/.config/awesome/battery-icons/" .. batteryType .. ".png") end batteryIcon = wibox.widget.imagebox() showBatteryWidgetIcon() -batteryIcon:connect_signal("mouse::enter", - function() - showBatteryWidgetPopup() - end -) +batteryIcon:connect_signal("mouse::enter", function() showBatteryWidgetPopup() end) -- timer to refresh battery icon batteryWidgetTimer = timer({ timeout = 5 }) -batteryWidgetTimer:connect_signal("timeout", - function() - showBatteryWidgetIcon() - end -) +batteryWidgetTimer:connect_signal("timeout", function() showBatteryWidgetIcon() end) +batteryWidgetTimer:start() -batteryWidgetTimer:start() \ No newline at end of file +-- timer to refresh battery warning +batteryWarningTimer = timer({ timeout = 50 }) +batteryWarningTimer:connect_signal("timeout", function() showWarningWidgetPopup() end) +batteryWarningTimer:start() \ No newline at end of file -- cgit v1.2.3 From 50285d43173ca48e1b618d9d2146191a47cb9811 Mon Sep 17 00:00:00 2001 From: streetturtle Date: Sat, 18 Jul 2015 13:31:59 +0200 Subject: update readme --- BatteryWidget/README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/BatteryWidget/README.md b/BatteryWidget/README.md index fa3925e..8ffa364 100644 --- a/BatteryWidget/README.md +++ b/BatteryWidget/README.md @@ -1,9 +1,11 @@ ## Battery widget Simple and easy-to-install widget for Awesome Window Manager. -Basically this widget consists of an icon which shows the battery status: ![Battery Widget](./batWid1.png) +This widget consists of -And a pop-up window, which shows up when you hover over it: ![Battery Widget](./batWid2.png) + - an icon which shows the battery status: ![Battery Widget](./batWid1.png) + - a pop-up window, which shows up when you hover over it: ![Battery Widget](./batWid2.png) + - a pop-up warning message which appears when battery level is less that 15%. ## Installation @@ -14,6 +16,8 @@ sudo apt-get install acpi ``` - clone/copy battery.lua file and battery-icons folder to your ~/home/username/.config/awesome/ folder; +- change path to the icons in `battery.lua`; + - include `battery.lua` and add battery widget to your wibox in rc.lua: ``` require("battery") -- cgit v1.2.3 From 21c929ce206f3bdd8cbf0ef57a3b839ed62d725b Mon Sep 17 00:00:00 2001 From: streetturtle Date: Sun, 19 Jul 2015 14:51:58 +0200 Subject: small refactoring + readme --- BatteryWidget/README.md | 2 +- BatteryWidget/batWid3.png | Bin 0 -> 8284 bytes 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 BatteryWidget/batWid3.png diff --git a/BatteryWidget/README.md b/BatteryWidget/README.md index 8ffa364..531a15c 100644 --- a/BatteryWidget/README.md +++ b/BatteryWidget/README.md @@ -5,7 +5,7 @@ This widget consists of - an icon which shows the battery status: ![Battery Widget](./batWid1.png) - a pop-up window, which shows up when you hover over it: ![Battery Widget](./batWid2.png) - - a pop-up warning message which appears when battery level is less that 15%. + - a pop-up warning message which appears when battery level is less that 15%: ![Battery Widget](./batWid3.png) ## Installation diff --git a/BatteryWidget/batWid3.png b/BatteryWidget/batWid3.png new file mode 100644 index 0000000..feeb453 Binary files /dev/null and b/BatteryWidget/batWid3.png differ -- cgit v1.2.3