Sunday, January 15, 2017

upgrade to awesome 4.0

awesomeWM v4.0 release came out last Christmas, I spent some time to migrate my rc.lua to v4.0. Tones of features are changed.

Recommended readings:

v4.0 NEWS:
Porting tips From 3.5 to 4.0:

Here are the main changes to my personal rc.lua:

- awful.screen added new method to iterate all screens
  - only go over all screens once via the main awful.screen.connect_for_each_screen() loop
  - all for s = 1, screen.count() loops are removed

- hotkey popups : [Mod4+s] gives you the hotkeys help of awesome and vim
  - awful.key takes a table for the descriptions
  - some vim keys are predefined in awesome-git/lib/awful/hotkeys_popup/keys/vim.lua

- New wallpaper setup: the helper function set_wallpaper will check if beautiful.wallpaper is a function, if so, run it, otherwise, setup with gears.

-awful.util.pread is removed, use io.popen instead
  - Caution: this is not recommended in awesome, but I only use them for tooltips and timer updates.
  - there's a new awful.spawn.easy_async for other purposes, check awesome-git/lib/awful/spawn.lua as a reference.

- use declarative widget syntax for adding widgets to the wibox
  - imperative style is still supported

awful.widget.textclock is renamed to wibox.widget.textclock

- titlebars are enabled for all normal clients and dialogs by default in v4.0
  - I hide the titlebar by default but add [Mod4+Shift+t] to toggle it

mytextbox:set_text("foo") is changed to mytextbox.set_text = "foo"

- awful.util.spawn is renamed to awful.spawn

- use double quotes ("") for most of the strings

My rc.lua:

No comments:

Post a Comment