summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstreetturtle <streetturtle@gmail.com>2020-11-09 10:53:07 -0500
committerstreetturtle <streetturtle@gmail.com>2020-11-09 10:53:07 -0500
commit6a229f6fceefd461cd2ada461d3d5611bb5f28f8 (patch)
treedbddd1a1978715377b0df3ca961e2612b66ab611
parent69eff31bb789711a49c25dfdb22061abf0393227 (diff)
[experiments-volume] improvements
-rw-r--r--experiments/volume/arc-widget.lua2
-rw-r--r--experiments/volume/volume.lua26
2 files changed, 25 insertions, 3 deletions
diff --git a/experiments/volume/arc-widget.lua b/experiments/volume/arc-widget.lua
index fb56518..85cc20a 100644
--- a/experiments/volume/arc-widget.lua
+++ b/experiments/volume/arc-widget.lua
@@ -28,7 +28,7 @@ function widget.get_widget()
end,
unmute = function(self)
self.colors = {beautiful.fg_color}
- end
+ end
}
end
diff --git a/experiments/volume/volume.lua b/experiments/volume/volume.lua
index ae7605e..2e9bc18 100644
--- a/experiments/volume/volume.lua
+++ b/experiments/volume/volume.lua
@@ -43,7 +43,7 @@ local popup = awful.popup{
local function build_main_line(device)
if device.active_port ~= nil and device.ports[device.active_port] ~= nil then
- return device.properties.device_description .. ' - ' .. device.ports[device.active_port]
+ return device.properties.device_description .. ' ยท ' .. device.ports[device.active_port]
else
return device.properties.device_description
end
@@ -90,13 +90,35 @@ local function build_rows(devices, on_checkbox_click, device_type)
spacing = 8,
layout = wibox.layout.align.horizontal
},
- margins = 8,
+ margins = 4,
layout = wibox.container.margin
},
bg = beautiful.bg_normal,
widget = wibox.container.background
}
+ row:connect_signal("mouse::enter", function(c) c:set_bg(beautiful.bg_focus) end)
+ row:connect_signal("mouse::leave", function(c) c:set_bg(beautiful.bg_normal) end)
+
+ local old_cursor, old_wibox
+ row:connect_signal("mouse::enter", function(c)
+ local wb = mouse.current_wibox
+ old_cursor, old_wibox = wb.cursor, wb
+ wb.cursor = "hand1"
+ end)
+ row:connect_signal("mouse::leave", function(c)
+ if old_wibox then
+ old_wibox.cursor = old_cursor
+ old_wibox = nil
+ end
+ end)
+
+ row:connect_signal("button::press", function(c)
+ spawn.easy_async(string.format([[sh -c 'pacmd set-default-%s "%s"']], device_type, device.name), function()
+ on_checkbox_click()
+ end)
+ end)
+
table.insert(device_rows, row)
end