Can a wibox in Awesome-WM be setup vertically

awesomeconfigurationlua

I use the venerable Awesome WM to manage tiled window layouts across a couple of screens. My configuration has a few goodies, but in general it follows a familiar pattern with a bar across the top with information about my keyboard layout, the tag situation, active windows, a system tray, and a clock.

current horizontal layout

For a while now I've had in mind that vertical screen real estate is too valuable to waste on this usage. It's not too bad on my desktop where I have multiple monitors and the bar is only on one of them (and I can rotate the displays!), but every time I use my 11" laptop I find myself wishing those 23 pixels were taken out of the width rather than the height of my screen.

What I would like to do is simply rotate the entire layout, text direction and all, and place it along the right edge sort of like this:

mock-up of desired vertical layout

When I've experimented with this in the past, all I've been able to achieve is a bar on that edge with items stacked it it vertically, but each item's orientation was still horizontal and obviously things like the task bar section did not play very nicely that way. I think I'm okay with the rotated text (and even tray icons) if I could just spin the whole thing.

Is this possible? If so, how?

Best Answer

A vertical wibox is possible, I used one with 3.4 since years and had to recreate setup with 3.5. Based on this mailing list discussion, here a short example with widgets re-ordered for my own needs, including margins to introduce spacing between widgets:

 -- Create the wibox
mywibox[s] = awful.wibox({ position="left",orientation="north", screen = s })

-- Widgets that are aligned to the bottom
local bottom_layout = wibox.layout.fixed.horizontal()
bottom_layout:add(wibox.layout.margin(mytextclock,0,5))
if s == 1 then bottom_layout:add(wibox.widget.systray()) end
bottom_layout:add(mypromptbox[s])

-- Now bring it all together (with the tasklist in the middle)
local layout = wibox.layout.align.horizontal()
layout:set_first(bottom_layout)
layout:set_second(wibox.layout.margin(mytasklist[s],5,5))
layout:set_third(mytaglist[s])

-- Rotate
-- http://comments.gmane.org/gmane.comp.window-managers.awesome/9676
local rotate = wibox.layout.rotate()
rotate:set_direction("east")
rotate:set_widget(layout)

-- Widgets from top to bottom
local wibox_layout = wibox.layout.fixed.vertical()
wibox_layout:add(mylauncher)
wibox_layout:add(wibox.layout.margin(mylayoutbox[s],0,0,5,5))
wibox_layout:add(rotate)

mywibox[s]:set_widget(wibox_layout)

When adjusting widget placements, reload configuration with Mod+Ctrl+r

To rotate systray, this code may do the trick (I did not test it)

if s == 1 then
   local systray = wibox.widget.systray()
   systray:set_horizontal(false)
   systray:set_base_size(100)
   right_layout:add(systray)
end

You can find a base configuration for Awesome 3.5 at https://github.com/ymartin59/awesome-vertical-wibox

Related Question