update awesome config.

This commit is contained in:
2018-10-09 01:08:03 +08:00
parent 237b0602ae
commit bde53ae930
2 changed files with 70 additions and 67 deletions

View File

@@ -212,7 +212,7 @@ root.buttons(awful.util.table.join(
globalkeys = awful.util.table.join(
-- Take a screenshot
-- https://github.com/copycat-killer/dots/blob/master/bin/screenshot
awful.key({ altkey }, "p", function() os.execute("screenshot") end),
awful.key({ modkey }, "p", function() os.execute("screenshot") end),
-- Hotkeys
awful.key({ modkey, }, "s", hotkeys_popup.show_help,
@@ -226,9 +226,9 @@ globalkeys = awful.util.table.join(
{description = "go back", group = "tag"}),
-- Non-empty tag browsing
awful.key({ altkey }, "Left", function () lain.util.tag_view_nonempty(-1) end,
awful.key({ modkey, "Shift" }, "Left", function () lain.util.tag_view_nonempty(-1) end,
{description = "view previous nonempty", group = "tag"}),
awful.key({ altkey }, "Right", function () lain.util.tag_view_nonempty(1) end,
awful.key({ modkey, "Shift" }, "Right", function () lain.util.tag_view_nonempty(1) end,
{description = "view previous nonempty", group = "tag"}),
-- Default client focus
@@ -300,15 +300,15 @@ globalkeys = awful.util.table.join(
end),
-- On the fly useless gaps change
awful.key({ altkey, "Control" }, "+", function () lain.util.useless_gaps_resize(1) end),
awful.key({ altkey, "Control" }, "-", function () lain.util.useless_gaps_resize(-1) end),
-- awful.key({ altkey, "Control" }, "+", function () lain.util.useless_gaps_resize(1) end),
-- awful.key({ altkey, "Control" }, "-", function () lain.util.useless_gaps_resize(-1) end),
-- Dynamic tagging
awful.key({ modkey, "Shift" }, "n", function () lain.util.add_tag() end),
awful.key({ modkey, "Shift" }, "r", function () lain.util.rename_tag() end),
awful.key({ modkey, "Shift" }, "Left", function () lain.util.move_tag(1) end), -- move to next tag
awful.key({ modkey, "Shift" }, "Right", function () lain.util.move_tag(-1) end), -- move to previous tag
awful.key({ modkey, "Shift" }, "d", function () lain.util.delete_tag() end),
-- awful.key({ modkey, "Shift" }, "n", function () lain.util.add_tag() end),
-- awful.key({ modkey, "Shift" }, "r", function () lain.util.rename_tag() end),
-- awful.key({ modkey, "Shift" }, "Left", function () lain.util.move_tag(1) end), -- move to next tag
-- awful.key({ modkey, "Shift" }, "Right", function () lain.util.move_tag(-1) end), -- move to previous tag
-- awful.key({ modkey, "Shift" }, "d", function () lain.util.delete_tag() end),
-- Standard program
awful.key({ modkey, }, "Return", function () awful.spawn(terminal) end,
@@ -350,37 +350,37 @@ globalkeys = awful.util.table.join(
awful.key({ modkey, }, "z", function () awful.screen.focused().quake:toggle() end),
-- Widgets popups
awful.key({ altkey, }, "c", function () lain.widget.calendar.show(7) end),
awful.key({ altkey, }, "h", function () if beautiful.fs then beautiful.fs.show(7) end end),
awful.key({ altkey, }, "w", function () if beautiful.weather then beautiful.weather.show(7) end end),
-- awful.key({ altkey, }, "c", function () lain.widget.calendar.show(7) end),
-- awful.key({ altkey, }, "h", function () if beautiful.fs then beautiful.fs.show(7) end end),
-- awful.key({ altkey, }, "w", function () if beautiful.weather then beautiful.weather.show(7) end end),
-- ALSA volume control
awful.key({ }, "XF86AudioRaiseVolume",
function ()
os.execute(string.format("amixer set %s 1%%+", beautiful.volume.channel))
beautiful.volume.update()
end),
awful.key({ }, "XF86AudioLowerVolume",
function ()
os.execute(string.format("amixer set %s 1%%-", beautiful.volume.channel))
beautiful.volume.update()
end),
awful.key({ }, "XF86AudioMute",
function ()
os.execute(string.format("amixer set %s toggle", beautiful.volume.togglechannel or beautiful.volume.channel))
beautiful.volume.update()
end),
awful.key({ altkey, "Control" }, "m",
function ()
os.execute(string.format("amixer set %s 100%%", beautiful.volume.channel))
beautiful.volume.update()
end),
-- awful.key({ }, "XF86AudioRaiseVolume",
-- function ()
-- os.execute(string.format("amixer set %s 1%%+", beautiful.volume.channel))
-- beautiful.volume.update()
-- end),
-- awful.key({ }, "XF86AudioLowerVolume",
-- function ()
-- os.execute(string.format("amixer set %s 1%%-", beautiful.volume.channel))
-- beautiful.volume.update()
-- end),
-- awful.key({ }, "XF86AudioMute",
-- function ()
-- os.execute(string.format("amixer set %s toggle", beautiful.volume.togglechannel or beautiful.volume.channel))
-- beautiful.volume.update()
-- end),
-- awful.key({ altkey, "Control" }, "m",
-- function ()
-- os.execute(string.format("amixer set %s 100%%", beautiful.volume.channel))
-- beautiful.volume.update()
-- end),
awful.key({ altkey, "Control" }, "0",
function ()
os.execute(string.format("amixer -q set %s 0%%", beautiful.volume.channel))
beautiful.volume.update()
end),
-- awful.key({ altkey, "Control" }, "0",
-- function ()
-- os.execute(string.format("amixer -q set %s 0%%", beautiful.volume.channel))
-- beautiful.volume.update()
-- end),
-- MPD control
awful.key({ altkey, "Control" }, "Up",
@@ -403,18 +403,18 @@ globalkeys = awful.util.table.join(
awful.spawn.with_shell("mpc next")
beautiful.mpd.update()
end),
awful.key({ altkey }, "0",
function ()
local common = { text = "MPD widget ", position = "top_middle", timeout = 2 }
if beautiful.mpd.timer.started then
beautiful.mpd.timer:stop()
common.text = common.text .. lain.util.markup.bold("OFF")
else
beautiful.mpd.timer:start()
common.text = common.text .. lain.util.markup.bold("ON")
end
naughty.notify(common)
end),
-- awful.key({ altkey }, "0",
-- function ()
-- local common = { text = "MPD widget ", position = "top_middle", timeout = 2 }
-- if beautiful.mpd.timer.started then
-- beautiful.mpd.timer:stop()
-- common.text = common.text .. lain.util.markup.bold("OFF")
-- else
-- beautiful.mpd.timer:start()
-- common.text = common.text .. lain.util.markup.bold("ON")
-- end
-- naughty.notify(common)
-- end),
-- Copy primary to clipboard (terminals to gtk)
--awful.key({ modkey }, "c", function () awful.spawn("xsel | xsel -i -b") end),
@@ -423,14 +423,14 @@ globalkeys = awful.util.table.join(
-- User programs
-- awful.key({ modkey }, "e", function () awful.spawn(gui_editor) end),
awful.key({ modkey }, "e", function () awful.spawn("pcmanfm") end),
-- awful.key({ modkey }, "e", function () awful.spawn("pcmanfm") end),
-- awful.key({ modkey }, "q", function () awful.spawn(browser) end),
awful.key({ modkey }, "q", function ()
local matcher = function (c)
return awful.rules.match(c, {class = "Firefox"})
end
awful.client.run_or_raise("firefox", matcher)
end),
-- awful.key({ modkey }, "q", function ()
-- local matcher = function (c)
-- return awful.rules.match(c, {class = "Firefox"})
-- end
-- awful.client.run_or_raise("firefox", matcher)
-- end),
-- Default
--[[ Menubar
@@ -579,9 +579,12 @@ awful.rules.rules = {
properties = { titlebars_enabled = false } },
-- Set Firefox to always map on the second tag on screen 1.
{ rule = { class = "Firefox" },
{ rule = { class = "Nightly" },
properties = { screen = 1, tag = screen[1].tags[2] } },
{ rule = { class = "mpv"},
properties = { screen = 1, tag = screen[1].tags[4], switchtotag = true, fullscreen = true } },
{ rule = { class = "VirtualBox" },
properties = { screen = 1, tag = screen[1].tags[5] } },