summaryrefslogtreecommitdiff
path: root/VolumeWidget/volume.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 /VolumeWidget/volume.lua
parenta079c79ab81a4bc2f7cf7971db6373fefe1e6110 (diff)
new widgets added
Diffstat (limited to 'VolumeWidget/volume.lua')
-rw-r--r--VolumeWidget/volume.lua34
1 files changed, 0 insertions, 34 deletions
diff --git a/VolumeWidget/volume.lua b/VolumeWidget/volume.lua
deleted file mode 100644
index 34c12f5..0000000
--- a/VolumeWidget/volume.lua
+++ /dev/null
@@ -1,34 +0,0 @@
-local wibox = require("wibox")
-local awful = require("awful")
-
-volume_widget = wibox.widget.imagebox()
-
-function update_volume(widget)
- local fd = io.popen("amixer -D pulse sget Master")
- local status = fd:read("*all")
- fd:close()
-
- local volume = string.match(status, "(%d?%d?%d)%%")
- volume = tonumber(string.format("% 3d", volume))
-
- status = string.match(status, "%[(o[^%]]*)%]")
-
- if (volume >= 0 and volume < 10) then volumeLevel=1
- elseif (volume >= 10 and volume < 20) then volumeLevel=2
- elseif (volume >= 20 and volume < 30) then volumeLevel=3
- elseif (volume >= 30 and volume < 40) then volumeLevel=4
- elseif (volume >= 40 and volume < 50) then volumeLevel=5
- elseif (volume >= 50 and volume < 60) then volumeLevel=6
- elseif (volume >= 60 and volume < 70) then volumeLevel=7
- elseif (volume >= 70 and volume < 80) then volumeLevel=8
- elseif (volume >= 80 and volume <= 100) then volumeLevel=9
- end
-
- widget:set_image("/home/pashik/.config/awesome/volume-icons/" .. volumeLevel .. ".png")
-end
-
-update_volume(volume_widget)
-
-mytimer = timer({ timeout = 0.2 })
-mytimer:connect_signal("timeout", function () update_volume(volume_widget) end)
-mytimer:start() \ No newline at end of file