1
0
Fork 0
mirror of https://github.com/lcpz/awesome-copycats.git synced 2024-12-22 19:22:32 +00:00

alsa/alsabar bindings updated

This commit is contained in:
copycat-killer 2015-03-09 21:33:43 +01:00
parent 5787dbbfcf
commit f70c70f1b1
10 changed files with 65 additions and 42 deletions

2
lain

@ -1 +1 @@
Subproject commit 75db05552172584c57624b853384fa1a79acfcfb Subproject commit a535b86435d83bac68be5f2ca76680d37b3ac07d

View file

@ -430,22 +430,23 @@ globalkeys = awful.util.table.join(
-- ALSA volume control -- ALSA volume control
awful.key({ altkey }, "Up", awful.key({ altkey }, "Up",
function () function ()
awful.util.spawn("amixer -q set Master 1%+") awful.util.spawn(string.format("amixer -c %s set %s 1+", volumewidget.card, volumewidget.channel))
volumewidget.update() volumewidget.update()
end), end),
awful.key({ altkey }, "Down", awful.key({ altkey }, "Down",
function () function ()
awful.util.spawn("amixer -q set Master 1%-") awful.util.spawn(string.format("amixer -c %s set %s 1-", volumewidget.card, volumewidget.channel))
volumewidget.update() volumewidget.update()
end), end),
awful.key({ altkey }, "m", awful.key({ altkey }, "m",
function () function ()
awful.util.spawn("amixer -q set Master playback toggle") awful.util.spawn(string.format("amixer -c %s set %s toggle", volumewidget.card, volumewidget.channel))
--awful.util.spawn(string.format("amixer set %s toggle", volumewidget.channel))
volumewidget.update() volumewidget.update()
end), end),
awful.key({ altkey, "Control" }, "m", awful.key({ altkey, "Control" }, "m",
function () function ()
awful.util.spawn("amixer -q set Master playback 100%") awful.util.spawn(string.format("amixer -c %s set %s 100%%", volumewidget.card, volumewidget.channel))
volumewidget.update() volumewidget.update()
end), end),

View file

@ -183,11 +183,25 @@ batmargin:set_top(6)
batmargin:set_bottom(6) batmargin:set_bottom(6)
batupd = lain.widgets.bat({ batupd = lain.widgets.bat({
settings = function() settings = function()
if bat_now.perc == "N/A" then if bat_now.perc == "N/A" or bat_now.status == "Not present" then
bat_perc = 100 bat_perc = 100
baticon:set_image(beautiful.ac) baticon:set_image(beautiful.ac)
elseif bat_now.status == "Charging" then
bat_perc = tonumber(bat_now.perc)
baticon:set_image(beautiful.ac)
if bat_perc >= 98 then
batbar:set_color(green)
elseif bat_perc > 50 then
batbar:set_color(beautiful.fg_normal)
elseif bat_perc > 15 then
batbar:set_color(beautiful.fg_normal)
else
batbar:set_color(red)
end
else else
bat_perc = tonumber(bat_now.perc) bat_perc = tonumber(bat_now.perc)
if bat_perc >= 98 then if bat_perc >= 98 then
batbar:set_color(green) batbar:set_color(green)
elseif bat_perc > 50 then elseif bat_perc > 50 then
@ -235,6 +249,7 @@ diskwidget:set_bgimage(beautiful.widget_bg)
-- ALSA volume bar -- ALSA volume bar
volicon = wibox.widget.imagebox(beautiful.vol) volicon = wibox.widget.imagebox(beautiful.vol)
volume = lain.widgets.alsabar({width = 55, ticks = true, ticks_size = 6, volume = lain.widgets.alsabar({width = 55, ticks = true, ticks_size = 6,
card = "1", step = "2%",
settings = function() settings = function()
if volume_now.status == "off" then if volume_now.status == "off" then
volicon:set_image(beautiful.vol_mute) volicon:set_image(beautiful.vol_mute)
@ -485,22 +500,23 @@ globalkeys = awful.util.table.join(
-- ALSA volume control -- ALSA volume control
awful.key({ altkey }, "Up", awful.key({ altkey }, "Up",
function () function ()
awful.util.spawn("amixer -q set " .. volume.channel .. " " .. volume.step .. "+") awful.util.spawn(string.format("amixer -c %s set %s %s+", volume.card, volume.channel, volume.step))
volume.update() volume.update()
end), end),
awful.key({ altkey }, "Down", awful.key({ altkey }, "Down",
function () function ()
awful.util.spawn("amixer -q set " .. volume.channel .. " " .. volume.step .. "-") awful.util.spawn(string.format("amixer -c %s set %s %s-", volume.card, volume.channel, volume.step))
volume.update() volume.update()
end), end),
awful.key({ altkey }, "m", awful.key({ altkey }, "m",
function () function ()
awful.util.spawn("amixer -q set " .. volume.channel .. " playback toggle") awful.util.spawn(string.format("amixer -c %s set %s toggle", volume.card, volume.channel))
--awful.util.spawn(string.format("amixer set %s toggle", volume.card, volume.channel))
volume.update() volume.update()
end), end),
awful.key({ altkey, "Control" }, "m", awful.key({ altkey, "Control" }, "m",
function () function ()
awful.util.spawn("amixer -q set " .. volume.channel .. " playback 100%") awful.util.spawn(string.format("amixer -c %s set %s 100", volume.card, volume.channel))
volume.update() volume.update()
end), end),

View file

@ -430,22 +430,23 @@ globalkeys = awful.util.table.join(
-- ALSA volume control -- ALSA volume control
awful.key({ altkey }, "Up", awful.key({ altkey }, "Up",
function () function ()
awful.util.spawn("amixer -q set Master 1%+") awful.util.spawn(string.format("amixer -c %s set %s 1+", volumewidget.card, volumewidget.channel))
volumewidget.update() volumewidget.update()
end), end),
awful.key({ altkey }, "Down", awful.key({ altkey }, "Down",
function () function ()
awful.util.spawn("amixer -q set Master 1%-") awful.util.spawn(string.format("amixer -c %s set %s 1-", volumewidget.card, volumewidget.channel))
volumewidget.update() volumewidget.update()
end), end),
awful.key({ altkey }, "m", awful.key({ altkey }, "m",
function () function ()
awful.util.spawn("amixer -q set Master playback toggle") awful.util.spawn(string.format("amixer -c %s set %s toggle", volumewidget.card, volumewidget.channel))
--awful.util.spawn(string.format("amixer set %s toggle", volumewidget.channel))
volumewidget.update() volumewidget.update()
end), end),
awful.key({ altkey, "Control" }, "m", awful.key({ altkey, "Control" }, "m",
function () function ()
awful.util.spawn("amixer -q set Master playback 100%") awful.util.spawn(string.format("amixer -c %s set %s 100%%", volumewidget.card, volumewidget.channel))
volumewidget.update() volumewidget.update()
end), end),

View file

@ -562,23 +562,24 @@ globalkeys = awful.util.table.join(
-- ALSA volume control -- ALSA volume control
awful.key({ altkey }, "Up", awful.key({ altkey }, "Up",
function () function ()
awful.util.spawn("amixer -q set " .. myvolumebar.channel .. " " .. myvolumebar.step .. "+") awful.util.spawn(string.format("amixer -c %s set %s %s+", myvolumebar.card, myvolumebar.channel, myvolumebar.step))
myvolumebar.notify() myvolumebar.update()
end), end),
awful.key({ altkey }, "Down", awful.key({ altkey }, "Down",
function () function ()
awful.util.spawn("amixer -q set " .. myvolumebar.channel .. " " .. myvolumebar.step .. "-") awful.util.spawn(string.format("amixer -c %s set %s %s-", myvolumebar.card, myvolumebar.channel, myvolumebar.step))
myvolumebar.notify() myvolumebar.update()
end), end),
awful.key({ altkey }, "m", awful.key({ altkey }, "m",
function () function ()
awful.util.spawn("amixer -q set " .. myvolumebar.channel .. " playback toggle") awful.util.spawn(string.format("amixer -c %s set %s toggle", myvolumebar.card, myvolumebar.channel))
myvolumebar.notify() --awful.util.spawn(string.format("amixer set %s toggle", myvolumebar.card, myvolumebar.channel))
myvolumebar.update()
end), end),
awful.key({ altkey, "Control" }, "m", awful.key({ altkey, "Control" }, "m",
function () function ()
awful.util.spawn("amixer -q set " .. myvolumebar.channel .. " playback 100%") awful.util.spawn(string.format("amixer -c %s set %s 100", myvolumebar.card, myvolumebar.channel))
myvolumebar.notify() myvolumebar.update()
end), end),
-- MPD control -- MPD control

View file

@ -501,22 +501,23 @@ globalkeys = awful.util.table.join(
-- ALSA volume control -- ALSA volume control
awful.key({ altkey }, "Up", awful.key({ altkey }, "Up",
function () function ()
awful.util.spawn("amixer -q set Master 1%+") awful.util.spawn(string.format("amixer -c %s set %s 1+", volumewidget.card, volumewidget.channel))
volumewidget.update() volumewidget.update()
end), end),
awful.key({ altkey }, "Down", awful.key({ altkey }, "Down",
function () function ()
awful.util.spawn("amixer -q set Master 1%-") awful.util.spawn(string.format("amixer -c %s set %s 1-", volumewidget.card, volumewidget.channel))
volumewidget.update() volumewidget.update()
end), end),
awful.key({ altkey }, "m", awful.key({ altkey }, "m",
function () function ()
awful.util.spawn("amixer -q set Master playback toggle") awful.util.spawn(string.format("amixer -c %s set %s toggle", volumewidget.card, volumewidget.channel))
--awful.util.spawn(string.format("amixer set %s toggle", volumewidget.channel))
volumewidget.update() volumewidget.update()
end), end),
awful.key({ altkey, "Control" }, "m", awful.key({ altkey, "Control" }, "m",
function () function ()
awful.util.spawn("amixer -q set Master playback 100%") awful.util.spawn(string.format("amixer -c %s set %s 100%%", volumewidget.card, volumewidget.channel))
volumewidget.update() volumewidget.update()
end), end),

View file

@ -476,22 +476,23 @@ globalkeys = awful.util.table.join(
-- ALSA volume control -- ALSA volume control
awful.key({ altkey }, "Up", awful.key({ altkey }, "Up",
function () function ()
awful.util.spawn("amixer -q set Master 1%+") awful.util.spawn(string.format("amixer -c %s set %s 1+", volumewidget.card, volumewidget.channel))
volumewidget.update() volumewidget.update()
end), end),
awful.key({ altkey }, "Down", awful.key({ altkey }, "Down",
function () function ()
awful.util.spawn("amixer -q set Master 1%-") awful.util.spawn(string.format("amixer -c %s set %s 1-", volumewidget.card, volumewidget.channel))
volumewidget.update() volumewidget.update()
end), end),
awful.key({ altkey }, "m", awful.key({ altkey }, "m",
function () function ()
awful.util.spawn("amixer -q set Master playback toggle") awful.util.spawn(string.format("amixer -c %s set %s toggle", volumewidget.card, volumewidget.channel))
--awful.util.spawn(string.format("amixer set %s toggle", volumewidget.channel))
volumewidget.update() volumewidget.update()
end), end),
awful.key({ altkey, "Control" }, "m", awful.key({ altkey, "Control" }, "m",
function () function ()
awful.util.spawn("amixer -q set Master playback 100%") awful.util.spawn(string.format("amixer -c %s set %s 100%%", volumewidget.card, volumewidget.channel))
volumewidget.update() volumewidget.update()
end), end),

View file

@ -428,23 +428,24 @@ globalkeys = awful.util.table.join(
-- ALSA volume control -- ALSA volume control
awful.key({ altkey }, "Up", awful.key({ altkey }, "Up",
function () function ()
awful.util.spawn("amixer -q set " .. volume.channel .. " " .. volume.step .. "+") awful.util.spawn(string.format("amixer -c %s set %s %s+", volume.card, volume.channel, volume.step))
volume.notify() volume.update()
end), end),
awful.key({ altkey }, "Down", awful.key({ altkey }, "Down",
function () function ()
awful.util.spawn("amixer -q set " .. volume.channel .. " " .. volume.step .. "-") awful.util.spawn(string.format("amixer -c %s set %s %s-", volume.card, volume.channel, volume.step))
volume.notify() volume.update()
end), end),
awful.key({ altkey }, "m", awful.key({ altkey }, "m",
function () function ()
awful.util.spawn("amixer -q set " .. volume.channel .. " playback toggle") awful.util.spawn(string.format("amixer -c %s set %s toggle", volume.card, volume.channel))
volume.notify() --awful.util.spawn(string.format("amixer set %s toggle", volume.card, volume.channel))
volume.update()
end), end),
awful.key({ altkey, "Control" }, "m", awful.key({ altkey, "Control" }, "m",
function () function ()
awful.util.spawn("amixer -q set " .. volume.channel .. " playback 100%") awful.util.spawn(string.format("amixer -c %s set %s 100", volume.card, volume.channel))
volume.notify() volume.update()
end), end),
-- MPD control -- MPD control

View file

@ -437,22 +437,23 @@ globalkeys = awful.util.table.join(
-- ALSA volume control -- ALSA volume control
awful.key({ altkey }, "Up", awful.key({ altkey }, "Up",
function () function ()
awful.util.spawn("amixer -q set Master 1%+") awful.util.spawn(string.format("amixer -c %s set %s 1+", volumewidget.card, volumewidget.channel))
volumewidget.update() volumewidget.update()
end), end),
awful.key({ altkey }, "Down", awful.key({ altkey }, "Down",
function () function ()
awful.util.spawn("amixer -q set Master 1%-") awful.util.spawn(string.format("amixer -c %s set %s 1-", volumewidget.card, volumewidget.channel))
volumewidget.update() volumewidget.update()
end), end),
awful.key({ altkey }, "m", awful.key({ altkey }, "m",
function () function ()
awful.util.spawn("amixer -q set Master playback toggle") awful.util.spawn(string.format("amixer -c %s set %s toggle", volumewidget.card, volumewidget.channel))
--awful.util.spawn(string.format("amixer set %s toggle", volumewidget.channel))
volumewidget.update() volumewidget.update()
end), end),
awful.key({ altkey, "Control" }, "m", awful.key({ altkey, "Control" }, "m",
function () function ()
awful.util.spawn("amixer -q set Master playback 100%") awful.util.spawn(string.format("amixer -c %s set %s 100%%", volumewidget.card, volumewidget.channel))
volumewidget.update() volumewidget.update()
end), end),

Binary file not shown.

Before

Width:  |  Height:  |  Size: 880 KiB

After

Width:  |  Height:  |  Size: 33 KiB