my complicated awesomewm config (SUNSETTED)
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.

121 lines
3.7 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. local beautiful = require("beautiful")
  2. local awful = require("awful")
  3. local gears = require("gears")
  4. local wibox = require("wibox")
  5. -- {{{ Wibar
  6. -- Create a wibox for each screen and add it
  7. local function set_wallpaper(s)
  8. -- Wallpaper
  9. if beautiful.wallpaper then
  10. local wallpaper = beautiful.wallpaper
  11. -- If wallpaper is a function, call it with the screen
  12. if type(wallpaper) == "function" then
  13. wallpaper = wallpaper(s)
  14. end
  15. gears.wallpaper.maximized(wallpaper, s, true)
  16. end
  17. end
  18. -- Re-set wallpaper when a screen's geometry changes (e.g. different resolution)
  19. screen.connect_signal("property::geometry", set_wallpaper)
  20. -- {{{ Non-widget modules
  21. -- The following modules are not exactly widgets, however they are part of the ui.
  22. -- Load the keybindings list
  23. require("core.widgets.hotkeys_popup")
  24. -- Load the menubar
  25. require("core.widgets.menubar")
  26. -- }}}
  27. awful.screen.connect_for_each_screen(function(s)
  28. -- Wallpaper
  29. set_wallpaper(s)
  30. -- Each screen has its own tag table.
  31. awful.tag({ "1", "2", "3", "4", "5", "6", "7", "8", "9" }, s, awful.layout.layouts[1])
  32. -- Create a promptbox for each screen
  33. s.mypromptbox = require("core.widgets.prompt")()
  34. -- Create an imagebox widget which will contain an icon indicating which layout we're using.
  35. -- Create the taglist
  36. s.mytaglist = require("core.widgets.taglist")(s)
  37. -- We need one layoutbox per screen.
  38. s.mylayoutbox = require("core.widgets.layout_box")(s)
  39. -- Create a tasklist widget
  40. s.mytasklist = require("core.widgets.tasklist")(s)
  41. -- Create the wibox
  42. s.mywibox = awful.wibar({
  43. position = "top",
  44. screen = s,
  45. bg = beautiful.topbar_bg,
  46. })
  47. -- Add screen lock
  48. require("widgets.lock")({screen = s, obscure = true})
  49. require("widgets.unitybar")(s,{
  50. top_widgets = {
  51. require("widgets.polytasklist")({
  52. vertical = true,
  53. stretch = false,
  54. --constraint = 180,
  55. names = false,
  56. margins = 5
  57. })(s),
  58. },
  59. bottom_widgets = {
  60. require("widgets.polylauncher")({vertical = true})
  61. }
  62. })
  63. -- Add widgets to the wibox
  64. s.mywibox:setup {
  65. expand = "outside",
  66. layout = wibox.layout.align.horizontal,
  67. { -- Left widgets
  68. {
  69. require("core.widgets.menu_launcher"),
  70. --require("widgets.polylauncher")({vertical = false}),
  71. --s.mytaglist,
  72. s.mypromptbox,
  73. layout = wibox.layout.fixed.horizontal,
  74. spacing = 3
  75. },
  76. widget = wibox.container.place,
  77. halign = "left",
  78. fill_horizontal = false,
  79. },
  80. -- Middle widget
  81. wibox.widget.textclock(),
  82. { -- Right widgets
  83. {
  84. require("widgets.drawer")({
  85. wibox.widget.systray()
  86. }),
  87. awful.widget.keyboardlayout(),
  88. require("widgets.wallpapers")({
  89. screen = s,
  90. path = os.getenv("HOME").."/Pictures/Wallpapers/",
  91. }),
  92. require("widgets.mailbox")({
  93. screen = s,
  94. style = {
  95. rounding = 1,
  96. }
  97. }),
  98. require("widgets.volume")({}),
  99. require("widgets.battery")({
  100. percentage = false,
  101. }),
  102. s.mylayoutbox,
  103. layout = wibox.layout.fixed.horizontal,
  104. spacing = 4
  105. },
  106. widget = wibox.container.place,
  107. halign = "right",
  108. fill_horizontal = false
  109. },
  110. }
  111. end)
  112. -- }}}