summaryrefslogtreecommitdiff
path: root/awesome/share
diff options
context:
space:
mode:
authormediocregopher <mediocregopher@gmail.com>2023-08-13 21:34:14 +0200
committermediocregopher <mediocregopher@gmail.com>2023-08-13 21:35:17 +0200
commit1957081c122fe231eb6120192489dd979d214317 (patch)
treeb8cd0812ec3c0452d54cb789ba938e6f0c0e8278 /awesome/share
parentef8da74f1ae38d9eceb68846fe9ef402c8e30fcf (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/share')
-rw-r--r--awesome/share/helper.pngbin0 -> 26778 bytes
-rw-r--r--awesome/share/pulseaudio.lua40
-rw-r--r--awesome/share/theme.lua22
3 files changed, 62 insertions, 0 deletions
diff --git a/awesome/share/helper.png b/awesome/share/helper.png
new file mode 100644
index 0000000..4b43bf7
--- /dev/null
+++ b/awesome/share/helper.png
Binary files differ
diff --git a/awesome/share/pulseaudio.lua b/awesome/share/pulseaudio.lua
new file mode 100644
index 0000000..765fd12
--- /dev/null
+++ b/awesome/share/pulseaudio.lua
@@ -0,0 +1,40 @@
+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
diff --git a/awesome/share/theme.lua b/awesome/share/theme.lua
new file mode 100644
index 0000000..c5ad11e
--- /dev/null
+++ b/awesome/share/theme.lua
@@ -0,0 +1,22 @@
+function load_theme(avgcolor, comcolor)
+
+ local theme = require("default/theme")
+
+ if avgcolor then
+ theme.bg_normal = avgcolor
+ theme.bg_focus = theme.bg_normal
+ theme.bg_urgent = "#ff0000" -- TODO should be opposite of bg_normal
+ theme.bg_minimize = theme.bg_normal
+ theme.bg_systray = theme.bg_normal
+ end
+
+ if comcolor then
+ theme.fg_normal = comcolor
+ theme.fg_focus = comcolor
+ theme.fg_urgent = "#ffffff"
+ theme.fg_minimize = comcolor
+ end
+
+ return theme
+
+end