Update to awesome-3.5
authorFabien Ninoles <fabien@tzone.org>
Sun, 14 Jun 2015 22:18:07 -0400
changeset 11 7226709dc4c4
parent 10 449bcf8e92c2
child 12 ffc02bf394cb
Update to awesome-3.5
awesome/my.lua
awesome/rc.lua
--- a/awesome/my.lua	Sat Jan 03 11:21:56 2015 -0500
+++ b/awesome/my.lua	Sun Jun 14 22:18:07 2015 -0400
@@ -1,20 +1,14 @@
-require("naughty")
-require("awful")
-require("debug")
-require("vicious")
-require("wicked")
-require("beautiful")
-require("timer")
+local naughty = require("naughty")
+local awful = require("awful")
+local debug = require("debug")
+local vicious = require("vicious")
+local wicked = require("wicked")
+local beautiful = require("beautiful")
+local timer = require("timer")
+local wibox = require("wibox")
 
 local ipairs = ipairs
 local pairs = pairs
-local naughty = naughty
-local awful = awful
-local debug = debug
-local vicious = vicious
-local wicked = wicked
-local beautiful = beautiful
-local timer = timer
 
 local capi = {
    keygrabber = keygrabber,
@@ -25,6 +19,10 @@
 
 module("my")
 
+local function get_gradient_colors(c1, c2, c3)
+   return { type = "linear", from = { 0, 0 }, to = { 0, 20 }, stops = { { 0, c1 }, { 0.5, c2 }, { 1, c3 } }}
+end
+
 local in_error = false
 function notify_error(err)
    -- Make sure we don't go into an endless error loop
@@ -75,7 +73,7 @@
    -- Graph properties
    w:set_width(30)
    w:set_background_color("#729fcf")
-   w:set_gradient_colors({ "#729fcf", "LightBlue", "white" })
+   w:set_color(get_gradient_colors("#729fcf", "LightBlue", "white"))
 -- Register widget
    vicious.register(w, vicious.widgets.cpu, "$1", 1)
    return w
@@ -83,7 +81,7 @@
 
 local function widgets_mdp()
    -- Initialize widget
-   local w = capi.widget({ type = "textbox" })
+   local w = wibox.widget.textbox()
    -- Register widget
    vicious.register(w, vicious.widgets.mpd,
                     function (widget, args)
@@ -103,14 +101,14 @@
    w:set_width(10)
    w:set_vertical(true)
    w:set_background_color("#729fcf")
-   w:set_gradient_colors({ "#729fcf", "LightBlue", "white" })
+   w:set_color(get_gradient_colors("#729fcf", "LightBlue", "white"))
 -- Register widget
    vicious.register(w, vicious.widgets.mem, "$1", 5)
    return w
 end
 
 local function widgets_net(device)
-   local w = capi.widget({ type = "textbox"})
+   local w = wibox.widget.textbox()
    -- w:set_vertical(true)
    w.width = 150
    w.align = 'center'
@@ -121,13 +119,13 @@
 end
 
 local function widgets_mode()
-   local w = capi.widget({ type = "textbox"})
+   local w = wibox.widget.textbox()
    widgets.mode_widget = w
    return w
 end
 
 local function widgets_keyboard()
-   local w = capi.widget({ type = "textbox"})
+   local w = wibox.widget.textbox()
    widgets.keyboard_widget = w
    return w
 end
@@ -311,10 +309,10 @@
 
 function sloppy_install(delay)
    sloppy_timer = timer({ timeout = delay })
-   sloppy_timer:add_signal("timeout", sloppy_on_timeout)
+   sloppy_timer:connect_signal("timeout", sloppy_on_timeout)
    sloppy_timer:start()
-   capi.client.add_signal("manage", function (c)
-                             c:add_signal("mouse::enter", sloppy_mouse_enter)
+   capi.client.connect_signal("manage", function (c)
+                             c:connect_signal("mouse::enter", sloppy_mouse_enter)
    end)
-   capi.client.add_signal("focus", function () sloppy_timer:stop() end)
+   capi.client.connect_signal("focus", function () sloppy_timer:stop() end)
 end
--- a/awesome/rc.lua	Sat Jan 03 11:21:56 2015 -0500
+++ b/awesome/rc.lua	Sun Jun 14 22:18:07 2015 -0400
@@ -1,16 +1,17 @@
-require("debug")
+local debug = require("debug")
 --
 -- Standard awesome library
-require("awful")
-require("awful.autofocus")
+local awful = require("awful")
+awful.autofocus = require("awful.autofocus")
+local wibox = require("wibox")
 -- Theme handling library
-require("beautiful")
+local beautiful = require("beautiful")
 -- Notification library
-require("naughty")
+local naughty = require("naughty")
 -- shifty - dynamic tagging library
-require("shifty")
+local shifty = require("shifty")
 -- Revelation
-require("revelation")
+local revelation = require("revelation")
 -- vicious widgets
 local vicious = require("vicious")
 local wicked = require("wicked")
@@ -19,7 +20,7 @@
 
 -- require("keychains")
 
-require("my")
+local my = require("my")
 
 -- {{{ Error handling
 -- Check if awesome encountered an error during startup and fell back to
@@ -32,7 +33,7 @@
 
 -- Handle runtime errors after startup
 do
-   awesome.add_signal("debug::error", my.notify_error)
+   awesome.connect_signal("debug::error", my.notify_error)
 end
 -- }}}
 
@@ -85,7 +86,7 @@
       awful.layout.suit.fair,
       awful.layout.suit.fair.horizontal,
       awful.layout.suit.max,
-      awful.layout.suit.max.fullscreen,
+      -- awful.layout.suit.max.fullscreen,
       awful.layout.suit.magnifier,
       awful.layout.suit.floating
    }
@@ -94,7 +95,7 @@
 use_titlebar = true
 
 -- Remove the focus follow mouse install by shifty.
-shifty.config.sloppy = false
+-- shifty.config.sloppy = false
 
 -- Shifty configured tags.
 shifty.config.tags = {
@@ -140,6 +141,11 @@
       layout   = awful.layout.suit.tile,
       position = 6,
    },
+   OZoNE = {
+      layout = awful.layout.suit.max,
+      position = 7,
+      spawn = terminal .. " -e ssh o"
+   }
 }
 
 -- SHIFTY: application matching rules
@@ -253,7 +259,7 @@
 
 --  Wibox
 -- Create a textbox widget
-mytextclock = awful.widget.textclock({align = "right"})
+mytextclock = awful.widget.textclock()
 
 -- Create a laucher widget and a main menu
 myawesomemenu = {
@@ -272,11 +278,11 @@
          {"open terminal", terminal}}
 })
 
-mylauncher = awful.widget.launcher({image = image(beautiful.awesome_icon),
+mylauncher = awful.widget.launcher({image = beautiful.awesome_icon,
                                     menu = mymainmenu})
 
 -- Create a systray
-mysystray = widget({type = "systray", align = "right"})
+mysystray = wibox.widget.systray({align = "right"})
 
 -- Create a wibox for each screen and add it
 mywibox = {}
@@ -327,8 +333,7 @@
    -- status box
 
    -- Create a promptbox for each screen
-   mypromptbox[s] =
-      awful.widget.prompt({layout = awful.widget.layout.leftright})
+   mypromptbox[s] = awful.widget.prompt()
    -- Create an imagebox widget which will contains an icon indicating which
    -- layout we're using.  We need one layoutbox per screen.
    mylayoutbox[s] = awful.widget.layoutbox(s)
@@ -338,38 +343,35 @@
                              awful.button({}, 4, function() awful.layout.inc(layouts, 1) end),
                              awful.button({}, 5, function() awful.layout.inc(layouts, -1) end)))
    -- Create a taglist widget
-   mytaglist[s] = awful.widget.taglist.new(s,
-                                           awful.widget.taglist.label.all,
-                                           mytaglist.buttons)
+   mytaglist[s] = awful.widget.taglist(s, awful.widget.taglist.filter.all, mytaglist.buttons)
 
    -- Create a tasklist widget
-   mytasklist[s] = awful.widget.tasklist.new(
-      function(c)
-        return awful.widget.tasklist.label.currenttags(c, s)
-      end,
-      mytasklist.buttons)
-
+   mytasklist[s] = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, mytasklist.buttons)
 
    -- Create the wibox
    mywibox[s] = awful.wibox({position = "top", screen = s})
    -- Add widgets to the wibox - order matters
-   mywibox[s].widgets = {
-      {
-         myktwidget,
-         mylauncher,
-         s == 1 and mycpuwidget or nil,
-         s == 1 and mymemwidget or nil,
-         mytaglist[s],
-         mypromptbox[s],
-         layout = awful.widget.layout.horizontal.leftright
-      },
-      mylayoutbox[s],
-      s == 1 and mynetwidget or nil,
-      mytextclock,
-      s == 1 and mysystray or nil,
-      mytasklist[s],
-      layout = awful.widget.layout.horizontal.rightleft
-   }
+   local left_layout = wibox.layout.fixed.horizontal()
+   left_layout:add(myktwidget)
+   left_layout:add(mylauncher)
+   if s == 1 then
+      left_layout:add(mycpuwidget)
+      left_layout:add(mymemwidget)
+   end
+   left_layout:add(mytaglist[s])
+   left_layout:add(mypromptbox[s])
+
+   local right_layout = wibox.layout.fixed.horizontal()
+   right_layout:add(mylayoutbox[s])
+   if (s == 1) then right_layout:add(mynetwidget) end
+   right_layout:add(mytextclock)
+   if (s == 1) then right_layout:add(mysystray) end
+
+   local layout = wibox.layout.align.horizontal()
+   layout:set_left(left_layout)
+   layout:set_middle(mytasklist[s])
+   layout:set_right(right_layout)
+   mywibox[s]:set_widget(layout)
 
    mywibox[s].screen = s
 end
@@ -401,24 +403,25 @@
             function () awful.tag.viewprev(); return true; end),
    my.make_key("Down", "View next", 
             function () awful.tag.viewnext(); return true; end),
-   my.make_key("Shift+Up", "Move tag right", 
-            function()
-               local t = awful.tag.selected()
-               local s = awful.util.cycle(screen.count(), t.screen + 1)
-               awful.tag.history.restore()
-               t = shifty.tagtoscr(s, t)
-               awful.tag.viewonly(t)
-               return true
-   end),
-   my.make_key("Shift+Down", "Move tag left", 
-            function()
-               local t = awful.tag.selected()
-               local s = awful.util.cycle(screen.count(), t.screen - 1)
-               awful.tag.history.restore()
-               t = shifty.tagtoscr(s, t)
-               awful.tag.viewonly(t)
-               return true
-   end),
+   -- my.make_key("Shift+Up", "Move tag right", 
+   --          function()
+   --             local t = awful.tag.selected()
+   --             local s = awful.util.cycle(screen.count(), t.screen + 1)
+   --             awful.tag.history.restore()
+   --             t = shifty.tagtoscr(s, t)
+   --             awful.tag.viewonly(t)
+   --             return true
+   -- end),
+   -- my.make_key("Shift+Down", "Move tag left", 
+   --          function()
+   --             local t = awful.tag.selected()
+   --             local s = screen.count() + t.screen - 1
+   --             s = awful.util.cycle(screen.count(), s)
+   --             awful.tag.history.restore()
+   --             t = shifty.tagtoscr(s, t)
+   --             awful.tag.viewonly(t)
+   --             return true
+   -- end),
 }
 
 local awesome_keys = {
@@ -641,7 +644,7 @@
 -- keychains.start(5)
 
 -- Hook function to execute when focusing a client.
-client.add_signal("focus", 
+client.connect_signal("focus", 
                   function(c)
                      -- my.notify_error("Client focus:\n" .. debug.traceback())
                      if not awful.client.ismarked(c) then
@@ -651,7 +654,7 @@
 end)
 
 -- Hook function to execute when unfocusing a client.
-client.add_signal("unfocus", function(c)
+client.connect_signal("unfocus", function(c)
                      if not awful.client.ismarked(c) then
                         c.border_color = beautiful.border_normal
                         c.opacity = 0.8