]> git.rmz.io Git - dotfiles.git/blobdiff - awesome/widgets/mpd_widget.lua
awesome/mpd_widget: center scroll widget when smaller than forced_width
[dotfiles.git] / awesome / widgets / mpd_widget.lua
index 180705492ec564a8336eede662a13fbdceb0b241..d5b72e9dd8716547f1ad4c56670737249adb4eaf 100644 (file)
@@ -15,14 +15,11 @@ widget._currentsong = {}
 
 widget.scroll = wibox.widget {
     layout = wibox.container.scroll.horizontal,
-    forced_width = 200,
-    expand = true,
+    max_size = 200,
     step_function = wibox.container.scroll.step_functions.linear_increase,
     speed = 20,
     {
         widget = widget._textbox,
-        align = 'center',
-        valign = 'center'
     }
 }
 
@@ -167,4 +164,11 @@ globalkeys = gears.table.join(globalkeys,
     awful.key({ modkey }, ".", function() widget._connection:send("next") end,
               { description = "next track", group = "mpd" })
 )
-return widget.scroll
+return {
+    layout = wibox.layout.align.horizontal,
+    forced_width = 200,
+    expand = "outside",
+    nil,
+    widget.scroll,
+    nil,
+}