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.

114 lines
4.1 KiB

2 years ago
2 years ago
  1. -- This file is part of Reno desktop.
  2. --
  3. -- Reno desktop is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
  4. --
  5. -- Reno desktop is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  6. --
  7. -- You should have received a copy of the GNU General Public License along with Reno desktop. If not, see <https://www.gnu.org/licenses/>.
  8. -- Module that adds default keybindings
  9. local awful = require("awful")
  10. local gears = require("gears")
  11. global.modkey = global.modkey or "Mod4"
  12. local keys = gears.table.join(
  13. awful.key({global.modkey}, "Up",
  14. function()
  15. awful.client.focus.byidx(1)
  16. end,
  17. {description = "switch to next client", group = "client"}),
  18. awful.key({global.modkey}, "Down",
  19. function()
  20. awful.client.focus.byidx(-1)
  21. end,
  22. {description = "switch to previous client", group = "client"}),
  23. awful.key({global.modkey, "Control"}, "Up",
  24. function()
  25. awful.screen.focus_relative(1)
  26. end,
  27. {description = "switch to next screen", group = "screen"}),
  28. awful.key({global.modkey, "Control"}, "Down",
  29. function()
  30. awful.screen.focus_relative(-1)
  31. end,
  32. {description = "switch to previous screen", group = "screen"}),
  33. awful.key({global.modkey}, "Tab",
  34. function()
  35. awful.client.focus.history.previous()
  36. if client.focus then
  37. client.focus:raise()
  38. end
  39. end,
  40. {description = "go back", group = "client"}),
  41. awful.key({global.modkey}, "Return",
  42. function()
  43. awful.spawn(global.terminal)
  44. end,
  45. {description = "Open terminal", group = "launcher"}),
  46. awful.key({global.modkey, "Shift"}, "Return",
  47. function()
  48. awful.spawn(global.browser)
  49. end,
  50. {description = "Open browser", group = "launcher"}))
  51. root.keys(keys)
  52. local buttons = gears.table.join(
  53. awful.button({}, 3, function() end),
  54. awful.button({}, 4, awful.tag.viewnext),
  55. awful.button({}, 5, awful.tag.viewprev)
  56. )
  57. root.buttons(buttons)
  58. local clientkeys = gears.table.join(
  59. awful.key({global.modkey, "Shift"},"c",
  60. function(c)
  61. c:kill()
  62. end,
  63. {description = "close client", group = "client"}),
  64. awful.key({global.modkey}, "o",
  65. function(c)
  66. c:move_to_screen()
  67. end,
  68. {description = "move to screen", group = "client"}),
  69. awful.key({global.modkey}, "t",
  70. function(c)
  71. c.ontop = not c.ontop
  72. end,
  73. {description = "toggle ontop", group = "client"}),
  74. awful.key({global.modkey}, "b",
  75. function(c)
  76. c.below = not c.below
  77. end,
  78. {description = "toggle below", group = "client"}),
  79. awful.key({global.modkey}, "f",
  80. function(c)
  81. c.fullscreen = not c.fullscreen
  82. c:raise()
  83. end,
  84. {description = "toggle fullscreen", group = "client"}),
  85. awful.key({ global.modkey }, "n",
  86. function (c)
  87. c.minimized = true
  88. end ,
  89. {description = "minimize", group = "client"}),
  90. awful.key({ global.modkey }, "m",
  91. function (c)
  92. c.maximized = not c.maximized
  93. c:raise()
  94. end ,
  95. {description = "(un)maximize", group = "client"}))
  96. awful.rules.rules[1].properties.keys = clientkeys
  97. local clientbuttons = gears.table.join(
  98. awful.button({ }, 1, function (c)
  99. c:emit_signal("request::activate", "mouse_click", {raise = true})
  100. end),
  101. awful.button({ global.modkey }, 1, function (c)
  102. c:emit_signal("request::activate", "mouse_click", {raise = true})
  103. awful.mouse.client.move(c)
  104. end),
  105. awful.button({ global.modkey }, 3, function (c)
  106. c:emit_signal("request::activate", "mouse_click", {raise = true})
  107. awful.mouse.client.resize(c)
  108. end))
  109. awful.rules.rules[1].properties.buttons = clientbuttons