1
0
Fork 0
mirror of https://github.com/lcpz/awesome-copycats.git synced 2024-10-22 20:41:22 +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
awful.key({ altkey }, "Up",
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()
end),
awful.key({ altkey }, "Down",
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()
end),
awful.key({ altkey }, "m",
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()
end),
awful.key({ altkey, "Control" }, "m",
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()
end),

View file

@ -183,11 +183,25 @@ batmargin:set_top(6)
batmargin:set_bottom(6)
batupd = lain.widgets.bat({
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
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
bat_perc = tonumber(bat_now.perc)
if bat_perc >= 98 then
batbar:set_color(green)
elseif bat_perc > 50 then
@ -235,6 +249,7 @@ diskwidget:set_bgimage(beautiful.widget_bg)
-- ALSA volume bar
volicon = wibox.widget.imagebox(beautiful.vol)
volume = lain.widgets.alsabar({width = 55, ticks = true, ticks_size = 6,
card = "1", step = "2%",
settings = function()
if volume_now.status == "off" then
volicon:set_image(beautiful.vol_mute)
@ -485,22 +500,23 @@ globalkeys = awful.util.table.join(
-- ALSA volume control
awful.key({ altkey }, "Up",
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()
end),
awful.key({ altkey }, "Down",
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()
end),
awful.key({ altkey }, "m",
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()
end),
awful.key({ altkey, "Control" }, "m",
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()
end),

View file

@ -430,22 +430,23 @@ globalkeys = awful.util.table.join(
-- ALSA volume control
awful.key({ altkey }, "Up",
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()
end),
awful.key({ altkey }, "Down",
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()
end),
awful.key({ altkey }, "m",
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()
end),
awful.key({ altkey, "Control" }, "m",
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()
end),

View file

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

View file

@ -501,22 +501,23 @@ globalkeys = awful.util.table.join(
-- ALSA volume control
awful.key({ altkey }, "Up",
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()
end),
awful.key({ altkey }, "Down",
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()
end),
awful.key({ altkey }, "m",
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()
end),
awful.key({ altkey, "Control" }, "m",
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()
end),

View file

@ -476,22 +476,23 @@ globalkeys = awful.util.table.join(
-- ALSA volume control
awful.key({ altkey }, "Up",
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()
end),
awful.key({ altkey }, "Down",
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()
end),
awful.key({ altkey }, "m",
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()
end),
awful.key({ altkey, "Control" }, "m",
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()
end),

View file

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

View file

@ -437,22 +437,23 @@ globalkeys = awful.util.table.join(
-- ALSA volume control
awful.key({ altkey }, "Up",
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()
end),
awful.key({ altkey }, "Down",
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()
end),
awful.key({ altkey }, "m",
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()
end),
awful.key({ altkey, "Control" }, "m",
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()
end),

Binary file not shown.

Before

Width:  |  Height:  |  Size: 880 KiB

After

Width:  |  Height:  |  Size: 33 KiB