summaryrefslogtreecommitdiff
path: root/keybindings.lua
diff options
context:
space:
mode:
Diffstat (limited to 'keybindings.lua')
-rw-r--r--keybindings.lua54
1 files changed, 32 insertions, 22 deletions
diff --git a/keybindings.lua b/keybindings.lua
index 9800bbd..e731788 100644
--- a/keybindings.lua
+++ b/keybindings.lua
@@ -2,6 +2,7 @@ local awful = require("awful")
local gears = require("gears")
local hotkeys_popup = require("awful.hotkeys_popup")
local menubar = require("menubar")
+local pavolctld = require("lib.pavolctld")
-- Enable hotkeys help widget for VIM and other apps
-- when client with a matching name is opened:
-- require("awful.hotkeys_popup.keys")
@@ -45,7 +46,7 @@ globalkeys = gears.table.join(
key(w , "F10", awesome.restart , { group = "awesome" , description = "reload awesome" }),
key(ws, "F10", awesome.quit , { group = "awesome" , description = "quit awesome" }),
key(w , "Tab", awful.tag.history.restore , { group = "tag" , description = "go back" }),
- --
+ -- Window Management
key(w , "j", function () awful.client.focus.byidx( 1) end, { group = "client" , description = "focus next by index" }),
key(w , "k", function () awful.client.focus.byidx(-1) end, { group = "client" , description = "focus previous by index" }),
key(ws, "j", function () awful.client.swap.byidx( 1) end, { group = "client" , description = "swap with next client by index" }),
@@ -73,24 +74,23 @@ globalkeys = gears.table.join(
key(w , "F12", function () awful.spawn("shutdownprompt Shutdown") end, { group = "system" , description = "shutdown system" }),
key(a , "m", function () awful.spawn("mounter -m") end, { group = "system" , description = "mount drive prompt" }),
key(as, "m", function () awful.spawn("mounter -u") end, { group = "system" , description = "unmount drive prompt" }),
- key(w , "F5", function () awful.spawn("bl set 0") end, { group = "system" , description = "set brightness to 0%" }),
- key(w , "F6", function () awful.spawn("bl set 25") end, { group = "system" , description = "set brightness to 25%" }),
- key(w , "F7", function () awful.spawn("bl set 50") end, { group = "system" , description = "set brightness to 50%" }),
- key(w , "F8", function () awful.spawn("bl set 100") end, { group = "system" , description = "set brightness to 100%" }),
-- Screenshots
key({}, "Print", function () awful.spawn("screenshot -x") end, { group = "misc" , description = "screenshot, copy to clipboard" }),
key(a , "Print", function () awful.spawn("screenshot -xc") end, { group = "misc" , description = "screenshot, crop, copy to clipboard" }),
key(w , "Print", function () awful.spawn("screenshot") end, { group = "misc" , description = "screenshot, save to screenshots dir" }),
- key(wa, "Print", function () awful.spawn("screenshot -c") end, { group = "misc" , description = "screenshot, crop, save to screenshots dir" })
+ key(wa, "Print", function () awful.spawn("screenshot -c") end, { group = "misc" , description = "screenshot, crop, save to screenshots dir" }),
+ -- Monitor Controls
+ key(w , "F5", function () awful.spawn("bl set 0") end, { group = "monitor" , description = "set monitor brightness to 0%" }),
+ key(w , "F6", function () awful.spawn("bl set 25") end, { group = "monitor" , description = "set monitor brightness to 25%" }),
+ key(w , "F7", function () awful.spawn("bl set 50") end, { group = "monitor" , description = "set monitor brightness to 50%" }),
+ key(w , "F8", function () awful.spawn("bl set 100") end, { group = "monitor" , description = "set monitor brightness to 100%" }),
+ key({}, "XF86MonBrightnessUp", function () awful.spawn("bl inc 10") end, { group = "monitor" , description = "increase monitor brightness by 10%" }),
+ key({}, "XF86MonBrightnessDown", function () awful.spawn("bl dec 10") end, { group = "monitor" , description = "decrease monitor brightness by 10%" }),
+ -- Volume Controls
+ key({}, "XF86AudioRaiseVolume", function () pavolctld.volume_inc(5) end, { group = "volume" , description = "increase volume by 5%" }),
+ key({}, "XF86AudioLowerVolume", function () pavolctld.volume_dec(5) end, { group = "volume" , description = "decrease volume by 5%" }),
+ key({}, "XF86AudioMute", pavolctld.mute_toggle , { group = "volume" , description = "toggle audio mute" })
)
---Audio Raise Volume Increase volume
---Audio Lower Volume Decrease volume
---Audio Mute Toggle mute
---Backlight Controls:
---Mon Brightness Up Increase brightness
---Mon Brightness Down Decrease brightness
---Alt + Mon Brightness Up Increase brightness by half-step
---Alt + Mon Brightness Down Decrease brightness by half-step
-- Client protection
@@ -104,20 +104,30 @@ local function unProtectClient(c)
c.screen:emit_signal("arrange")
end
local function killClient(c)
- if c.prevent_kill == nil or not c.prevent_kill then
+ if not c.prevent_kill then
c:kill()
end
end
+-- Client swap with master (more similar to dwm)
+local function masterswap(c)
+ local m = awful.client.getmaster()
+ if m ~= c then
+ c:swap(awful.client.getmaster())
+ else
+ c:swap(awful.client.next(1, c))
+ end
+end
+
-- Client keys
clientkeys = gears.table.join(
- key(w , "q", killClient , { description = "close", group = "client" }),
- key(w , "x", protectClient , { description = "close", group = "client" }),
- key(ws, "x", unProtectClient , { description = "close", group = "client" }),
- key(wc, "space", awful.client.floating.toggle , { description = "toggle floating", group = "client" }),
- key(w , "Return", function (c) c:swap(awful.client.getmaster()) end, { description = "move to master", group = "client" }),
- key(ws, ",", function (c) c:move_to_screen(c.screen.index - 1) end, { description = "move to previous screen", group = "client" }),
- key(ws, ",", function (c) c:move_to_screen(c.screen.index + 1) end, { description = "move to next screen", group = "client" })
+ key(w , "q", killClient , { description = "close", group = "client" }),
+ key(w , "x", protectClient , { description = "prevent closing", group = "client" }),
+ key(ws, "x", unProtectClient , { description = "allow closing", group = "client" }),
+ key(wc, "space", awful.client.floating.toggle , { description = "toggle floating", group = "client" }),
+ key(w , "Return", masterswap , { description = "move to master", group = "client" }),
+ key(ws, ",", function (c) c:move_to_screen(c.screen.index - 1) end, { description = "move to left screen", group = "client" }),
+ key(ws, ".", function (c) c:move_to_screen() end, { description = "move to right screen", group = "client" })
)
-- Bind all key numbers to tags.