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.

61 lines
2.5 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. for i = 1,9 do
  23. keys = gears.table.join(keys,
  24. awful.key({global.modkey}, "#"..i+9,
  25. function()
  26. local tag = awful.screen.focused().tags[i]
  27. if tag then
  28. tag:view_only()
  29. end
  30. end,
  31. {description = "view tag #"..i, group = "tag"}),
  32. awful.key({global.modkey, "Control"}, "#"..i+9,
  33. function()
  34. local tag = awful.screen.focused().tags[i]
  35. if tag then
  36. awful.tag.viewtoggle(tag)
  37. end
  38. end,
  39. {description = "toggle tag #"..i, group = "tag"}),
  40. awful.key({global.modkey, "Shift"}, "#"..i+9,
  41. function()
  42. if client.focus then
  43. local tag = awful.screen.focused().tags[i]
  44. if tag then
  45. client.focus:move_to_tag(tag)
  46. end
  47. end
  48. end,
  49. {description = "move client to tag #"..i, group = "tag"}),
  50. awful.key({global.modkey, "Shift", "Control"}, "#"..i+9,
  51. function()
  52. if client.focus then
  53. local tag = awful.screen.focused().tags[i]
  54. if tag then
  55. client.focus:move_to_tag(tag)
  56. end
  57. end
  58. end,
  59. {description = "toggle client on tag #"..i, group = "tag"}))
  60. end
  61. root.keys(keys)