diff options
author | mediocregopher <mediocregopher@gmail.com> | 2023-08-13 21:34:14 +0200 |
---|---|---|
committer | mediocregopher <mediocregopher@gmail.com> | 2023-08-13 21:35:17 +0200 |
commit | 1957081c122fe231eb6120192489dd979d214317 (patch) | |
tree | b8cd0812ec3c0452d54cb789ba938e6f0c0e8278 /awesome/pulseaudio.lua | |
parent | ef8da74f1ae38d9eceb68846fe9ef402c8e30fcf (diff) |
Update branch with all changes which could be brought in from private branches
For a while I was keeping a private branch where there were a lot of
non-public things included, and that became the de-facto branch while
this one lagged. This one is now up-to-date, all private stuff is dealt
with via config files which are not committed.
Diffstat (limited to 'awesome/pulseaudio.lua')
-rw-r--r-- | awesome/pulseaudio.lua | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/awesome/pulseaudio.lua b/awesome/pulseaudio.lua deleted file mode 100644 index 765fd12..0000000 --- a/awesome/pulseaudio.lua +++ /dev/null @@ -1,40 +0,0 @@ -local io = io -local math = math -local tonumber = tonumber -local tostring = tostring -local string = string -local naughty = require("naughty") - -function volumeInfo() - volmin = 0 - volmax = 65536 - local f = io.popen("pacmd dump |grep set-sink-volume|grep analog-stereo") - local g = io.popen("pacmd dump |grep set-sink-mute|grep analog-stereo") - local v = f:read() - local mute = g:read() - if mute ~= nil and string.find(mute, "no") then - volume = math.floor(tonumber(string.sub(v, string.find(v, 'x')-1)) * 100 / volmax) - else - volume = "off" - end - f:close() - g:close() - return "vol:"..volume.." " -end - -function muteAll() - local outh = io.popen("pactl list short sources | awk '{print $1}'") - while true do - local i = outh:read() - if i == nil then break end - io.popen("pactl set-source-mute " .. i .. " 1"):close() - end - outh:close() -end - -function unmuted() - local outh = io.popen("pactl list sources | grep 'Mute: no'") - local any = outh:read() - outh:close() - return any ~= nil -end |