Reno is the second iteration of the AWMTK-powered AwesomeWM config.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

100 lines
3.3 KiB

  1. -- Module that adds default keybindings
  2. local awful = require("awful")
  3. local gears = require("gears")
  4. global.modkey = global.modkey or "Mod4"
  5. local keys = gears.table.join(
  6. awful.key({global.modkey}, "Up",
  7. function()
  8. awful.client.focus.byidx(1)
  9. end,
  10. {description = "switch to next client", group = "client"}),
  11. awful.key({global.modkey}, "Down",
  12. function()
  13. awful.client.focus.byidx(-1)
  14. end,
  15. {description = "switch to previous client", group = "client"}),
  16. awful.key({global.modkey, "Control"}, "Up",
  17. function()
  18. awful.screen.focus_relative(1)
  19. end,
  20. {description = "switch to next screen", group = "screen"}),
  21. awful.key({global.modkey, "Control"}, "Down",
  22. function()
  23. awful.screen.focus_relative(-1)
  24. end,
  25. {description = "switch to previous screen", group = "screen"}),
  26. awful.key({global.modkey}, "Tab",
  27. function()
  28. awful.client.focus.history.previous()
  29. if client.focus then
  30. client.focus:raise()
  31. end
  32. end,
  33. {description = "go back", group = "client"}),
  34. awful.key({global.modkey}, "Return",
  35. function()
  36. awful.spawn(global.terminal)
  37. end,
  38. {description = "Open terminal", group = "launcher"}),
  39. awful.key({global.modkey, "Shift"}, "Return",
  40. function()
  41. awful.spawn(global.browser)
  42. end,
  43. {description = "Open browser", group = "launcher"}))
  44. root.keys(keys)
  45. local clientkeys = gears.table.join(
  46. awful.key({global.modkey, "Shift"},"c",
  47. function(c)
  48. c:kill()
  49. end,
  50. {description = "close client", group = "client"}),
  51. awful.key({global.modkey}, "o",
  52. function(c)
  53. c:move_to_screen()
  54. end,
  55. {description = "move to screen", group = "client"}),
  56. awful.key({global.modkey}, "t",
  57. function(c)
  58. c.ontop = not c.ontop
  59. end,
  60. {description = "toggle ontop", group = "client"}),
  61. awful.key({global.modkey}, "b",
  62. function(c)
  63. c.below = not c.below
  64. end,
  65. {description = "toggle below", group = "client"}),
  66. awful.key({global.modkey}, "f",
  67. function(c)
  68. c.fullscreen = not c.fullscreen
  69. c:raise()
  70. end,
  71. {description = "toggle fullscreen", group = "client"}),
  72. awful.key({ global.modkey }, "n",
  73. function (c)
  74. c.minimized = true
  75. end ,
  76. {description = "minimize", group = "client"}),
  77. awful.key({ global.modkey }, "m",
  78. function (c)
  79. c.maximized = not c.maximized
  80. c:raise()
  81. end ,
  82. {description = "(un)maximize", group = "client"}))
  83. awful.rules.rules[1].properties.keys = clientkeys
  84. local clientbuttons = gears.table.join(
  85. awful.button({ }, 1, function (c)
  86. c:emit_signal("request::activate", "mouse_click", {raise = true})
  87. end),
  88. awful.button({ global.modkey }, 1, function (c)
  89. c:emit_signal("request::activate", "mouse_click", {raise = true})
  90. awful.mouse.client.move(c)
  91. end),
  92. awful.button({ global.modkey }, 3, function (c)
  93. c:emit_signal("request::activate", "mouse_click", {raise = true})
  94. awful.mouse.client.resize(c)
  95. end))
  96. awful.rules.rules[1].properties.buttons = clientbuttons