]> git.madduck.net Git - etc/awesome.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

parametrise spacer "widget"
authormartin f. krafft <madduck@madduck.net>
Tue, 27 Feb 2018 03:13:45 +0000 (16:13 +1300)
committermartin f. krafft <madduck@madduck.net>
Tue, 27 Feb 2018 03:13:45 +0000 (16:13 +1300)
.config/awesome/rc.lua

index 4a1632905614c2d3dcf5bc6df3a4c9f4821ac7e0..acf457afad2ca97717b66b76bba1fd4bb652957c 100644 (file)
@@ -173,8 +173,11 @@ menubar.utils.terminal = terminal -- Set the terminal for applications that requ
 --    forced_width = 4,
 --    widget = wibox.widget.separator
 --}
 --    forced_width = 4,
 --    widget = wibox.widget.separator
 --}
-local spacer = wibox.widget.textbox()
-spacer:set_text(" │ ")
+local function make_spacer(text)
+    local spacer = wibox.widget.textbox()
+    spacer:set_text(text or " │ ")
+    return spacer
+end
 
 -- Keyboard map indicator and switcher
 mykeyboardlayout = awful.widget.keyboardlayout()
 
 -- Keyboard map indicator and switcher
 mykeyboardlayout = awful.widget.keyboardlayout()
@@ -193,7 +196,7 @@ local lain_bat = lain.widget.bat({
 clocksarray = clocksarray.get_clocksarray("%a %d %b %H:%M:%S %Z", {
         ["NZ"] = "Pacific/Auckland",
         ["DE"] = "Europe/Berlin"
 clocksarray = clocksarray.get_clocksarray("%a %d %b %H:%M:%S %Z", {
         ["NZ"] = "Pacific/Auckland",
         ["DE"] = "Europe/Berlin"
-    }, spacer)
+    }, make_spacer())
 
 -- Create a wibox for each screen and add it
 local taglist_buttons = gears.table.join(
 
 -- Create a wibox for each screen and add it
 local taglist_buttons = gears.table.join(
@@ -286,34 +289,31 @@ awful.screen.connect_for_each_screen(function(s)
 
     -- Add widgets to the wibox
     local right_widgets = gears.table.join(clocksarray, {
 
     -- Add widgets to the wibox
     local right_widgets = gears.table.join(clocksarray, {
-        spacer,
-        --spacing = 4,
-        --spacing_widget = spacer,
+        make_spacer(" "),
+        wibox.widget.systray(),
         s.mylayoutbox,
         layout = wibox.layout.fixed.horizontal,
     })
 
     if s == screen.primary then
         right_widgets = gears.table.join({
         s.mylayoutbox,
         layout = wibox.layout.fixed.horizontal,
     })
 
     if s == screen.primary then
         right_widgets = gears.table.join({
-            wibox.widget.systray(),
-            spacer,
+            make_spacer(" "),
             ccwidgets.btc_widget,
             ccwidgets.btc_widget,
-            spacer,
+            make_spacer(),
             ccwidgets.eth_widget,
             ccwidgets.eth_widget,
-            spacer,
+            make_spacer(),
             lain_bat.widget,
             lain_bat.widget,
-            spacer,
+            make_spacer(),
         }, right_widgets)
     end
 
     s.mywibox:setup {
         layout = wibox.layout.align.horizontal,
         { -- Left widgets
         }, right_widgets)
     end
 
     s.mywibox:setup {
         layout = wibox.layout.align.horizontal,
         { -- Left widgets
-            spacing = 4,
-            spacing_widget = spacer,
             layout = wibox.layout.fixed.horizontal,
             --s.namebox,
             s.mytaglist,
             layout = wibox.layout.fixed.horizontal,
             --s.namebox,
             s.mytaglist,
+            make_spacer(" "),
             s.mypromptbox,
         },
         s.mytasklist, -- Middle widget
             s.mypromptbox,
         },
         s.mytasklist, -- Middle widget