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.

69 lines
2.8 KiB

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. -- Static set of tags that you find in the default awesomewm config
  9. local awful = require("awful")
  10. local gears = require("gears")
  11. awful.screen.connect_for_each_screen(function(s)
  12. -- Clear tags
  13. for _, tag in pairs(s.tags) do
  14. tag:delete()
  15. end
  16. -- Add 9 default tags
  17. awful.tag({"1", "2", "3", "4", "5", "6", "7", "8", "9"}, s,
  18. awful.layout.suit.floating)
  19. end)
  20. -- keybindings for tags
  21. local keys = root.keys()
  22. keys = gears.table.join(keys,
  23. awful.key({global.modkey}, "Left",
  24. awful.tag.viewprev,
  25. {description = "view next tag", group = "tag"}),
  26. awful.key({global.modkey}, "Right",
  27. awful.tag.viewnext,
  28. {description = "view previous tag", group = "tag"}))
  29. for i = 1,9 do
  30. keys = gears.table.join(keys,
  31. awful.key({global.modkey}, "#"..i+9,
  32. function()
  33. local tag = awful.screen.focused().tags[i]
  34. if tag then
  35. tag:view_only()
  36. end
  37. end,
  38. {description = "view tag #"..i, group = "tag"}),
  39. awful.key({global.modkey, "Control"}, "#"..i+9,
  40. function()
  41. local tag = awful.screen.focused().tags[i]
  42. if tag then
  43. awful.tag.viewtoggle(tag)
  44. end
  45. end,
  46. {description = "toggle tag #"..i, group = "tag"}),
  47. awful.key({global.modkey, "Shift"}, "#"..i+9,
  48. function()
  49. if client.focus then
  50. local tag = awful.screen.focused().tags[i]
  51. if tag then
  52. client.focus:move_to_tag(tag)
  53. end
  54. end
  55. end,
  56. {description = "move client to tag #"..i, group = "tag"}),
  57. awful.key({global.modkey, "Shift", "Control"}, "#"..i+9,
  58. function()
  59. if client.focus then
  60. local tag = awful.screen.focused().tags[i]
  61. if tag then
  62. client.focus:move_to_tag(tag)
  63. end
  64. end
  65. end,
  66. {description = "toggle client on tag #"..i, group = "tag"}))
  67. end
  68. root.keys(keys)