diff options
Diffstat (limited to 'VolumeWidget')
-rw-r--r-- | VolumeWidget/README.md | 21 | ||||
-rw-r--r-- | VolumeWidget/volWid.png | bin | 301 -> 0 bytes | |||
-rw-r--r-- | VolumeWidget/volume-icons/1.png | bin | 233 -> 0 bytes | |||
-rw-r--r-- | VolumeWidget/volume-icons/2.png | bin | 242 -> 0 bytes | |||
-rw-r--r-- | VolumeWidget/volume-icons/3.png | bin | 248 -> 0 bytes | |||
-rw-r--r-- | VolumeWidget/volume-icons/4.png | bin | 255 -> 0 bytes | |||
-rw-r--r-- | VolumeWidget/volume-icons/5.png | bin | 260 -> 0 bytes | |||
-rw-r--r-- | VolumeWidget/volume-icons/6.png | bin | 270 -> 0 bytes | |||
-rw-r--r-- | VolumeWidget/volume-icons/7.png | bin | 273 -> 0 bytes | |||
-rw-r--r-- | VolumeWidget/volume-icons/8.png | bin | 282 -> 0 bytes | |||
-rw-r--r-- | VolumeWidget/volume-icons/9.png | bin | 286 -> 0 bytes | |||
-rw-r--r-- | VolumeWidget/volume.lua | 34 |
12 files changed, 0 insertions, 55 deletions
diff --git a/VolumeWidget/README.md b/VolumeWidget/README.md deleted file mode 100644 index 312fa4d..0000000 --- a/VolumeWidget/README.md +++ /dev/null @@ -1,21 +0,0 @@ -## Volume widget -Simple and easy-to-install widget for Awesome Window Manager. - -This widget represents the sound level: ![Volume Wiget](./volWid.png) - -## Installation - -- 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/<username>/.config/awesome/volume-icons/" .. volumeLevel .. ".png") -``` - -- include `volume.lua` and add volume widget to your wibox in rc.lua: -``` -require("volume") -... -right_layout:add(volumeWidget) -``` diff --git a/VolumeWidget/volWid.png b/VolumeWidget/volWid.png Binary files differdeleted file mode 100644 index fdfdd20..0000000 --- a/VolumeWidget/volWid.png +++ /dev/null diff --git a/VolumeWidget/volume-icons/1.png b/VolumeWidget/volume-icons/1.png Binary files differdeleted file mode 100644 index 3f4e6b4..0000000 --- a/VolumeWidget/volume-icons/1.png +++ /dev/null diff --git a/VolumeWidget/volume-icons/2.png b/VolumeWidget/volume-icons/2.png Binary files differdeleted file mode 100644 index 9a488c7..0000000 --- a/VolumeWidget/volume-icons/2.png +++ /dev/null diff --git a/VolumeWidget/volume-icons/3.png b/VolumeWidget/volume-icons/3.png Binary files differdeleted file mode 100644 index a1bfb30..0000000 --- a/VolumeWidget/volume-icons/3.png +++ /dev/null diff --git a/VolumeWidget/volume-icons/4.png b/VolumeWidget/volume-icons/4.png Binary files differdeleted file mode 100644 index 8f11110..0000000 --- a/VolumeWidget/volume-icons/4.png +++ /dev/null diff --git a/VolumeWidget/volume-icons/5.png b/VolumeWidget/volume-icons/5.png Binary files differdeleted file mode 100644 index 613cb4a..0000000 --- a/VolumeWidget/volume-icons/5.png +++ /dev/null diff --git a/VolumeWidget/volume-icons/6.png b/VolumeWidget/volume-icons/6.png Binary files differdeleted file mode 100644 index 1defc8a..0000000 --- a/VolumeWidget/volume-icons/6.png +++ /dev/null diff --git a/VolumeWidget/volume-icons/7.png b/VolumeWidget/volume-icons/7.png Binary files differdeleted file mode 100644 index 8207899..0000000 --- a/VolumeWidget/volume-icons/7.png +++ /dev/null diff --git a/VolumeWidget/volume-icons/8.png b/VolumeWidget/volume-icons/8.png Binary files differdeleted file mode 100644 index 423f213..0000000 --- a/VolumeWidget/volume-icons/8.png +++ /dev/null diff --git a/VolumeWidget/volume-icons/9.png b/VolumeWidget/volume-icons/9.png Binary files differdeleted file mode 100644 index e7c40df..0000000 --- a/VolumeWidget/volume-icons/9.png +++ /dev/null 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 |