You are not logged in.

#1 2009-10-23 15:00:40

tyr0
Member
Registered: 2007-06-02
Posts: 152

Once again: rc.lua changes in awesome 3.4

Awesome syntax changed heavily in the new awesome release and my old rc.lua isn´t working at all. Maybe some helpful awesome-users would be so kind as to have a look on my config.

require("awful")
require("beautiful")
require("naughty")
require("wicked")
require('invaders')
-- require("obvious.battery")

-- {{{ Variable definitions
theme_path = "/home/thomas/.config/awesome/themes/arch.lua"
beautiful.init(theme_path)

terminal = "urxvt"
editor = os.getenv("EDITOR") or "nano"
editor_cmd = terminal .. " -e " .. editor

modkey = "Mod1"

layouts =
{
    awful.layout.suit.tile,         -- 1
    awful.layout.suit.tile.left,     -- 2
    awful.layout.suit.tile.bottom,     -- 3
    awful.layout.suit.tile.top,        -- 4
    awful.layout.suit.fair,        -- 5
    awful.layout.suit.fair.horizontal,    -- 6 
    awful.layout.suit.max,        -- 7
    awful.layout.suit.max.fullscreen,    -- 8
    awful.layout.suit.magnifier,    -- 9
    awful.layout.suit.floating         -- 10
}

floatapps =
{
    -- by class
    ["MPlayer"] = true,
    ["feh"] = true,
    ["Heroes3.exe"] = true,
    ["Wine"] = true,
    -- by instance
    ["feh"] = true,
    ["mocp"] = true,
    ["H5_Game.exe"] = true
}

apptags =
{
--    ["Gran Paradiso"] = { screen = 1, tag = 2 },
--    ["Thunderbird-bin"] = { screen = 1, tag = 4 },
--    ["Mplayer"] = { screen = 1, tag = 3 },
--        ["soffice"] = { screen = 1, tag = 5 }
        -- ["Heroes3.exe"] = { screen = 1, tag = 3 },
}

use_titlebar = false
-- }}}

-- {{{ Tags
-- Define tags table.
tags = {}
tags.settings = {
    { name = "urxvt",   layout = layouts[1],  },
    { name = "www",     layout = layouts[1],  },
    { name = "mail",    layout = layouts[7],  },
    { name = "media",   layout = layouts[10]  },
    { name = "misc",   layout = layouts[10], setslave = true },
}

-- Initialize tags
 for s = 1, screen.count() do
 tags[s] = {}
 for i, v in ipairs(tags.settings) do
 tags[s][i] = tag(v.name)
 tags[s][i].screen = s
 awful.tag.setproperty(tags[s][i], "layout",   v.layout)
 awful.tag.setproperty(tags[s][i], "setslave", v.setslave)
 awful.tag.setproperty(tags[s][i], "mwfact",   v.mwfact)
end
 tags[s][1].selected = true
end
-- }}}

-- {{{ Wibox
-- Create a textbox widget
mytextbox = widget({ type = "textbox", align = "right" })
-- Set the default text in textbox
mytextbox.text = "<b><small> " .. awesome.release .. " </small></b> "

-- Create a laucher widget and a main menu
myawesomemenu = {
   { "manual", terminal .. " -e man awesome" },
   { "edit config", editor_cmd .. " " .. awful.util.getdir("config") .. "/rc.lua" },
   { "restart", awesome.restart },
   { "quit", awesome.quit },
}

mymainmenu = awful.menu.new({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon },
                                        { "urxvt", terminal },
                    { "shutdown", terminal .. " -e poweroff" },
                    { "reboot", terminal .. " -e reboot" }
                                      }
})

mylauncher = awful.widget.launcher({ image = image(beautiful.awesome_icon),
                                     menu = mymainmenu })

-- Create a systray
mysystray = widget({ type = "systray", align = "right" })

-- Create a wibox for each screen and add it
mywibox = {}
mypromptbox = {}
mylayoutbox = {}
mytaglist = {}
mytaglist.buttons = awful.util.table.join(
                    awful.button({ }, 1, awful.tag.viewonly),
                    awful.button({ modkey }, 1, awful.client.movetotag),
                    awful.button({ }, 3, function (tag) tag.selected = not tag.selected end),
                    awful.button({ modkey }, 3, awful.client.toggletag),
                    awful.button({ }, 4, awful.tag.viewnext),
                    awful.button({ }, 5, awful.tag.viewprev)
                    )
mytasklist = {}
mytasklist.buttons = awful.util.table.join(
                     awful.button({ }, 1, function (c)
                                              if not c:isvisible() then
                                                  awful.tag.viewonly(c:tags()[1])
                                              end
                                              client.focus = c
                                              c:raise()
                                          end),
                     awful.button({ }, 3, function ()
                                              if instance then
                                                  instance:hide()
                                                  instance = nil
                                              else
                                                  instance = awful.menu.clients({ width=250 })
                                              end
                                          end),
                     awful.button({ }, 4, function ()
                                              awful.client.focus.byidx(1)
                                              if client.focus then client.focus:raise() end
                                          end),
                     awful.button({ }, 5, function ()
                                              awful.client.focus.byidx(-1)
                                              if client.focus then client.focus:raise() end
                                          end))

for s = 1, screen.count() do
    -- Create a promptbox for each screen
    mypromptbox[s] = widget({ type = "textbox", align = "left" })
    -- Create an imagebox widget which will contains an icon indicating which layout we're using.
    -- We need one layoutbox per screen.
    mylayoutbox[s] = widget({ type = "imagebox", align = "right" })
    mylayoutbox[s]:buttons(awful.util.table.join(
                           awful.button({ }, 1, function () awful.layout.inc(layouts, 1) end),
                           awful.button({ }, 3, function () awful.layout.inc(layouts, -1) end),
                           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)
 
--    -- Gigamo battery widget
--        batterywidget = widget({type = "textbox", name = "batterywidget", align = "right" })
--
-- function batteryInfo(adapter)
--     spacer = " "
--            local fcur = io.open("/sys/class/power_supply/"..adapter.."/charge_now")    
--            local fcap = io.open("/sys/class/power_supply/"..adapter.."/charge_full")
--            local fsta = io.open("/sys/class/power_supply/"..adapter.."/status")
--            local cur = fcur:read()
--            local cap = fcap:read()
--            local sta = fsta:read()
--            local battery = math.floor(cur * 100 / cap)
--    if sta:match("Charging") then
--            dir = "^"
--            battery = "A/C ("..battery..")"
--    elseif sta:match("Discharging") then
--            dir = "v"
--    if tonumber(battery) > 25 and tonumber(battery) < 75 then
--            battery = battery
--    elseif tonumber(battery) < 25 then
--    if tonumber(battery) < 10 then
--            naughty.notify({ title      = "Battery Warning"
--            , text       = "Battery low!"..spacer..battery.."%"..spacer.."left!"
--            , timeout    = 5
--            , position   = "top_right"
--            , fg         = beautiful.fg_focus
--            , bg         = beautiful.bg_focus
--})
--end
--            battery = battery
--     else
--            battery = battery
--end
--   else
--      dir = "="
--      battery = "A/C"
--end
--      batterywidget.text = spacer.."Bat:"..spacer..dir..battery..dir..spacer
--      fcur:close()
--      fcap:close()
--      fsta:close()
--end
        
        -- Create a date widget
        mydatewidget = widget({
        type = "textbox",
        name = "mydatewidget",
        align = "right" })
        wicked.register(mydatewidget, wicked.widgets.date, " ::: %b %e, %R ", 1)

--    mytextbox.text = " " .. execute_command("perl /home/thomas/.scripts/conky-updates.pl") .. " 


      -- MPD
      
    mpdwidget = widget({
    type = 'textbox',
    name = 'mpdwidget',
    align = 'right',
    })
    wicked.register(mpdwidget, wicked.widgets.mpd, 
    function (widget, args)
           if args[1]:find("volume:") == nil then
              return ' <span color="#e2baf1">Now Playing:</span> '..args[1]
           else
                      return ''
                   end
        end)
        
    netwidget = widget({
    type = 'textbox',
    name = 'netwidget',
    align = 'right',
    })
    wicked.register(netwidget, wicked.widgets.net, 
        ' <span color="#e2baf1">Net:</span> ${wlan0 down} / ${wlan0 up}',
    nil, nil, 3)
    
    cpugraphwidget = widget({
        type = 'graph',
        name = 'cpugraphwidget',
        align = 'right',
    })

    cpugraphwidget.height = 0.85
    cpugraphwidget.width = 45
    cpugraphwidget.bg = '#333333'
    cpugraphwidget.border_color = '#0a0a0a'
    cpugraphwidget.grow = 'left'

    cpugraphwidget:plot_properties_set('cpu', {
        fg = '#AEC6D8',
    fg_center = '#285577',
    fg_end = '#e2baf1',
    vertical_gradient = false
    })    

    wicked.register(cpugraphwidget, wicked.widgets.cpu, '$1', 1, 'cpu')

--Mail
mailwidget = widget({
    type = 'textbox',
    name = 'mailwidget',
    align = 'right',
})
 
function run_script()
    local filedescriptor = io.popen('perl /home/thomas/.scripts/checkMail.pl')
    local value = filedescriptor:read()
    filedescriptor:close()

    return {value}
end
 
-- Runs 'my_nifty_script.py' every 90 seconds and puts its output into the widget
wicked.register(mailwidget, run_script, '<span color="#e2baf1"> Mail:</span> $1', 120)

--Arch
archwidget = widget({
    type = 'textbox',
    name = 'archwidget',
    align = 'right'
})
 
function run_script()
    local filedescriptor = io.popen('perl /home/thomas/.scripts/conky-updates.pl')
    local value = filedescriptor:read()
    filedescriptor:close()

    return {value}
end
 
wicked.register(archwidget, run_script, '<span color="#e2baf1"> arch:</span> $1', 1000)
    
cpuwidget = widget({
    type = 'textbox',
    name = 'cpuwidget',
    align = 'right'
})

wicked.register(cpuwidget, wicked.widgets.cpu,
    ' <span color="#e2baf1">CPU:</span> $1%')



    -- Mousebindings for MPD
    mpdwidget:buttons(awful.util.table.join(
    awful.button({ }, 1, function () awful.util.spawn("mpc toggle")  end),
    awful.button({ }, 4, function () awful.util.spawn("aumix -v +3") end),
    awful.button({ }, 5, function () awful.util.spawn("aumix -v -3") end),
    awful.button({ }, 8, function () awful.util.spawn("mpc prev") end),
    awful.button({ }, 9, function () awful.util.spawn("mpc next") end)))
    

    -- Create a tasklist widget
    mytasklist[s] = awful.widget.tasklist.new(function(c)
                                                  return awful.widget.tasklist.label.currenttags(c, s)
                                              end, mytasklist.buttons)

    -- Create the wibox
    mywibox[s] = wibox({ position = "top", fg = beautiful.fg_normal, bg = beautiful.bg_normal })
    -- Add widgets to the wibox - order matters
    mywibox[s].widgets = { mylauncher,
                           mytaglist[s],
                                                    -- mytasklist[s],
                                                 cpuwidget,
                                                 cpugraphwidget,
                                                 mailwidget,
                                                 archwidget,
                                                    netwidget,
                                                     mypromptbox[s],
                                                     -- obvious.battery(),
                           -- mytextbox,
                                                     mpdwidget,
                                                     mydatewidget,
                                                     mylayoutbox[s],
                           s == 1 and mysystray or nil }
    mywibox[s].screen = s
end
-- }}}

-- {{{ Mouse bindings
root.buttons(awful.util.table.join(
    awful.button({ }, 3, function () mymainmenu:toggle() end),
    awful.button({ }, 4, awful.tag.viewnext),
    awful.button({ }, 5, awful.tag.viewprev)
))
-- }}}

-- {{{ Key bindings
globalkeys = awful.util.table.join(
    awful.key({ modkey,           }, "h",   awful.tag.viewprev       ),
    awful.key({ modkey,           }, "l",  awful.tag.viewnext       ),
    awful.key({ modkey,           }, "Escape", awful.tag.history.restore),
    awful.key({ }, "Print", function () awful.util.spawn("scrot -e 'mv $f ~/Bilder/Sonstiges/ 2>/dev/null'") end),

    awful.key({ modkey,           }, "j",
        function ()
            awful.client.focus.byidx( 1)
            if client.focus then client.focus:raise() end
        end),
    awful.key({ modkey,           }, "k",
        function ()
            awful.client.focus.byidx(-1)
            if client.focus then client.focus:raise() end
        end),
    awful.key({ modkey,           }, "w", function () mymainmenu:show(true)        end),

    -- Layout manipulation
    awful.key({ modkey, "Shift"   }, "j", function () awful.client.swap.byidx(  1) end),
    awful.key({ modkey, "Shift"   }, "k", function () awful.client.swap.byidx( -1) end),
    awful.key({ modkey, "Control" }, "j", function () awful.screen.focus( 1)       end),
    awful.key({ modkey, "Control" }, "k", function () awful.screen.focus(-1)       end),
    awful.key({ modkey,           }, "u", awful.client.urgent.jumpto),
    awful.key({ modkey,           }, "Tab",
        function ()
            awful.client.focus.history.previous()
            if client.focus then
                client.focus:raise()
            end
        end),

    -- Standard program
    awful.key({ modkey,           }, "Return", function () awful.util.spawn(terminal) end),
    awful.key({ modkey, "Control" }, "r", awesome.restart),
    awful.key({ modkey, "Shift"   }, "q", awesome.quit),

    awful.key({ modkey,           }, "Right", function () awful.tag.incmwfact( 0.05)    end),
    awful.key({ modkey,           }, "Left",  function () awful.tag.incmwfact(-0.05)    end),
    awful.key({ modkey, "Shift"   }, "h",     function () awful.tag.incnmaster( 1)      end),
    awful.key({ modkey, "Shift"   }, "l",     function () awful.tag.incnmaster(-1)      end),
    awful.key({ modkey, "Control" }, "h",     function () awful.tag.incncol( 1)         end),
    awful.key({ modkey, "Control" }, "l",     function () awful.tag.incncol(-1)         end),
    awful.key({ modkey,           }, "space", function () awful.layout.inc(layouts,  1) end),
    awful.key({ modkey, "Shift"   }, "space", function () awful.layout.inc(layouts, -1) end),

    -- Mina
    awful.key({ }, "XF86AudioPlay",            function () awful.util.spawn("mpc toggle")  end),
    awful.key({ }, "XF86AudioStop",            function () awful.util.spawn("mpc stop")    end),
    awful.key({ }, "XF86AudioNext",            function () awful.util.spawn("mpc next")  end),
    awful.key({ }, "XF86AudioPrev",            function () awful.util.spawn("mpc prev")  end),
    awful.key({ }, "XF86AudioLowerVolume",     function () awful.util.spawn("aumix -v -3")  end),
    awful.key({ }, "XF86AudioRaiseVolume",     function () awful.util.spawn("aumix -v +3")  end),
    awful.key({ }, "XF86AudioMute",            function () awful.util.spawn("aumix -v mute")  end),
    awful.key({ }, "XF86HomePage",             function () awful.util.spawn("firefox")  end),
    awful.key({ }, "XF86Mail",                 function () awful.util.spawn("thunderbird3")  end),
    

    -- Prompt
    awful.key({ modkey }, "F2",
              function ()
                  awful.prompt.run({ prompt = " Run: " },
                  mypromptbox[mouse.screen],
                  awful.util.spawn, awful.completion.shell,
                  awful.util.getdir("cache") .. "/history")
              end),

    awful.key({ modkey }, "x",
              function ()
                  awful.prompt.run({ prompt = "Run Lua code: " },
                  mypromptbox[mouse.screen],
                  awful.util.eval, nil,
                  awful.util.getdir("cache") .. "/history_eval")
              end)
)

-- Client awful tagging: this is useful to tag some clients and then do stuff like move to tag on them
clientkeys = awful.util.table.join(
    awful.key({ modkey,           }, "f",      function (c) c.fullscreen = not c.fullscreen  end),
    awful.key({ modkey, "Shift"   }, "c",      function (c) c:kill()                         end),
    awful.key({ modkey, "Control" }, "space",  awful.client.floating.toggle                     ),
    awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end),
    awful.key({ modkey,           }, "o",      awful.client.movetoscreen                        ),
    awful.key({ modkey, "Shift"   }, "r",      function (c) c:redraw()                       end),
    awful.key({ modkey }, "t", awful.client.togglemarked),
    awful.key({ modkey,}, "m",
        function (c)
            c.maximized_horizontal = not c.maximized_horizontal
            c.maximized_vertical   = not c.maximized_vertical
        end)
)

-- Compute the maximum number of digit we need, limited to 9
keynumber = 0
for s = 1, screen.count() do
   keynumber = math.min(9, math.max(#tags[s], keynumber));
end

for i = 1, keynumber do
    table.foreach(awful.key({ modkey }, i,
                  function ()
                        local screen = mouse.screen
                        if tags[screen][i] then
                            awful.tag.viewonly(tags[screen][i])
                        end
                  end), function(_, k) table.insert(globalkeys, k) end)
    table.foreach(awful.key({ modkey, "Control" }, i,
                  function ()
                      local screen = mouse.screen
                      if tags[screen][i] then
                          tags[screen][i].selected = not tags[screen][i].selected
                      end
                  end), function(_, k) table.insert(globalkeys, k) end)
    table.foreach(awful.key({ modkey, "Shift" }, i,
                  function ()
                      if client.focus and tags[client.focus.screen][i] then
                          awful.client.movetotag(tags[client.focus.screen][i])
                      end
                  end), function(_, k) table.insert(globalkeys, k) end)
    table.foreach(awful.key({ modkey, "Control", "Shift" }, i,
                  function ()
                      if client.focus and tags[client.focus.screen][i] then
                          awful.client.toggletag(tags[client.focus.screen][i])
                      end
                  end), function(_, k) table.insert(globalkeys, k) end)
    table.foreach(awful.key({ modkey, "Shift" }, "F" .. i,
                  function ()
                      local screen = mouse.screen
                      if tags[screen][i] then
                          for k, c in pairs(awful.client.getmarked()) do
                              awful.client.movetotag(tags[screen][i], c)
                          end
                      end
                   end), function(_, k) table.insert(globalkeys, k) end)
end

-- Set keys
root.keys(globalkeys)
-- }}}

-- {{{ Hooks
-- Hook function to execute when focusing a client.
awful.hooks.focus.register(function (c)
    if not awful.client.ismarked(c) then
        c.border_color = beautiful.border_focus
    end
end)

-- Hook function to execute when unfocusing a client.
awful.hooks.unfocus.register(function (c)
    if not awful.client.ismarked(c) then
        c.border_color = beautiful.border_normal
    end
end)

-- Hook function to execute when marking a client
awful.hooks.marked.register(function (c)
    c.border_color = beautiful.border_marked
end)

-- Hook function to execute when unmarking a client.
awful.hooks.unmarked.register(function (c)
    c.border_color = beautiful.border_focus
end)

-- Hook function to execute when a new client appears.
awful.hooks.manage.register(function (c, startup)
    -- If we are not managing this application at startup,
    -- move it to the screen where the mouse is.
    -- We only do it for filtered windows (i.e. no dock, etc).
    if not startup and awful.client.focus.filter(c) then
        c.screen = mouse.screen
    end

    if use_titlebar then
        -- Add a titlebar
        awful.titlebar.add(c, { modkey = modkey })
    end
    -- Add mouse bindings
    c:buttons(awful.util.table.join(
        awful.button({ }, 1, function (c) client.focus = c; c:raise() end),
        awful.button({ modkey }, 1, awful.mouse.client.move),
        awful.button({ modkey }, 3, awful.mouse.client.resize)
    ))
    -- New client may not receive focus
    -- if they're not focusable, so set border anyway.
    c.border_width = beautiful.border_width
    c.border_color = beautiful.border_normal

    -- Check if the application should be floating.
    local cls = c.class
    local inst = c.instance
    if floatapps[cls] then
        awful.client.floating.set(c, floatapps[cls])
        elseif floatapps[inst] then
        awful.client.floating.set(c, floatapps[inst])
    end

    -- Check application->screen/tag mappings.
    local target
    if apptags[cls] then
        target = apptags[cls]
    elseif apptags[inst] then
        target = apptags[inst]
    end
    if target then
        c.screen = target.screen
        awful.client.movetotag(tags[target.screen][target.tag], c)
    end

    -- Do this after tag mapping, so you don't see it on the wrong tag for a split second.
    client.focus = c

    -- Set key bindings
    c:keys(clientkeys)

    -- Set the windows at the slave,
    -- i.e. put it at the end of others instead of setting it master.
    -- awful.client.setslave(c)

    -- Honor size hints: if you want to drop the gaps between windows, set this to false.
     c.size_hints_honor = false

    awful.placement.centered(c)

end)

-- Hook function to execute when arranging the screen.
-- (tag switch, new client, etc)
awful.hooks.arrange.register(function (screen)
    local layout = awful.layout.getname(awful.layout.get(screen))
    if layout and beautiful["layout_" ..layout] then
        mylayoutbox[screen].image = image(beautiful["layout_" .. layout])
    else
        mylayoutbox[screen].image = nil
    end

    -- Give focus to the latest client in history if no window has focus
    -- or if the current window is a desktop or a dock one.
    if not client.focus then
        local c = awful.client.focus.history.get(screen, 0)
        if c then client.focus = c end
    end
end)

awful.hooks.timer.register(3, function()
      batteryInfo("BAT0")
             end)

-- Hook called every minute
awful.hooks.timer.register(60, function ()
    mytextbox.text = os.date(" %a %b %d, %H:%M ")
end)
-- }}}


-- {{ Quick'n'Dirty Autostart
-- awful.util.spawn("xset r rate 200 30")
-- awful.util.spawn("numlockx")
-- awful.util.spawn("setxkbmap se")
-- awful.util.spawn("xrandr --output LVDS --off")
-- awful.util.spawn("xrandr --output VGA-0 --mode 1680x1050")
-- awful.util.spawn("mount /media/usb")
-- awful.util.spawn("gsynaptics-init")
awful.util.spawn("keytouchd")
awful.util.spawn("xscreensaver -no-splash")
awful.util.spawn("urxvtd -q -f -o")
-- awful.util.spawn("ck-launch-session")
awful.util.spawn("nm-applet")
awful.util.spawn("xcompmgr -c -t-5 -l-5 -r4.2 -o.80")
-- awful.util.spawn("bmpanel eight")
awful.util.spawn("xrdb -merge ~/.Xdefaults")
-- }}

errors:

╭─[thomas::Heraklit]
╰─[16:53]> debug-awesome3.sh                                                                          ~
(EE) AIGLX error: dlopen of /usr/lib/xorg/modules/dri/swrast_dri.so failed (/usr/lib/xorg/modules/dri/swrast_dri.so: cannot open shared object file: No such file or directory)
(EE) GLX: could not load software renderer
unrecognised device identifier!
(EE) config/hal: NewInputDeviceRequest failed (2)
unrecognised device identifier!
(EE) config/hal: NewInputDeviceRequest failed (2)
unrecognised device identifier!
(EE) config/hal: NewInputDeviceRequest failed (2)
unrecognised device identifier!
(EE) config/hal: NewInputDeviceRequest failed (2)
unrecognised device identifier!
(EE) config/hal: NewInputDeviceRequest failed (2)
unrecognised device identifier!
(EE) config/hal: NewInputDeviceRequest failed (2)
/home/thomas/.config/awesome/rc_test.lua:72: W: luaA_tag_new: This function is deprecated and will be removed, see new syntax
/home/thomas/.config/awesome/rc_test.lua:72: W: luaA_tag_new: This function is deprecated and will be removed, see new syntax
/home/thomas/.config/awesome/rc_test.lua:72: W: luaA_tag_new: This function is deprecated and will be removed, see new syntax
/home/thomas/.config/awesome/rc_test.lua:72: W: luaA_tag_new: This function is deprecated and will be removed, see new syntax
/home/thomas/.config/awesome/rc_test.lua:72: W: luaA_tag_new: This function is deprecated and will be removed, see new syntax
W: awful: function is deprecated, see timer object
stack traceback:
    /usr/share/awesome/lib/awful/util.lua:39: in function 'deprecate'
    /usr/share/awesome/lib/awful/hooks.lua:59: in function 'register'
    /usr/share/awesome/lib/wicked.lua:718: in function 'regregister'
    /usr/share/awesome/lib/wicked.lua:679: in function 'register'
    /home/thomas/.config/awesome/rc_test.lua:210: in main chunkW: awful: function is deprecated, see timer object
stack traceback:
    /usr/share/awesome/lib/awful/util.lua:39: in function 'deprecate'
    /usr/share/awesome/lib/awful/hooks.lua:59: in function 'register'
    /usr/share/awesome/lib/wicked.lua:718: in function 'regregister'
    /usr/share/awesome/lib/wicked.lua:679: in function 'register'
    /home/thomas/.config/awesome/rc_test.lua:222: in main chunkW: awful: function is deprecated, see timer object
stack traceback:
    /usr/share/awesome/lib/awful/util.lua:39: in function 'deprecate'
    /usr/share/awesome/lib/awful/hooks.lua:59: in function 'register'
    /usr/share/awesome/lib/wicked.lua:718: in function 'regregister'
    /usr/share/awesome/lib/wicked.lua:679: in function 'register'
    /home/thomas/.config/awesome/rc_test.lua:236: in main chunk/home/thomas/.config/awesome/rc_test.lua:240: W: widget_graph: This function is deprecated and will be removed, see awful.widget.graph
W: awful: function is deprecated, see timer object
stack traceback:
    /usr/share/awesome/lib/awful/util.lua:39: in function 'deprecate'
    /usr/share/awesome/lib/awful/hooks.lua:59: in function 'register'
    /usr/share/awesome/lib/wicked.lua:718: in function 'regregister'
    /usr/share/awesome/lib/wicked.lua:679: in function 'register'
    /home/thomas/.config/awesome/rc_test.lua:259: in main chunkW: awful: function is deprecated, see timer object
stack traceback:
    /usr/share/awesome/lib/awful/util.lua:39: in function 'deprecate'
    /usr/share/awesome/lib/awful/hooks.lua:59: in function 'register'
    /usr/share/awesome/lib/wicked.lua:718: in function 'regregister'
    /usr/share/awesome/lib/wicked.lua:679: in function 'register'
    /home/thomas/.config/awesome/rc_test.lua:277: in main chunkXIO:  fatal IO error 11 (Resource temporarily unavailable) on X server ":0.0"
      after 59 requests (59 known processed) with 0 events remaining.

(nitrogen:17137): Gtk-WARNING **: cannot open display: :1.0
W: awful: function is deprecated, see timer object
stack traceback:
    /usr/share/awesome/lib/awful/util.lua:39: in function 'deprecate'
    /usr/share/awesome/lib/awful/hooks.lua:59: in function 'register'
    /usr/share/awesome/lib/wicked.lua:718: in function 'regregister'
    /usr/share/awesome/lib/wicked.lua:679: in function 'register'
    /home/thomas/.config/awesome/rc_test.lua:294: in main chunkW: awful: function is deprecated, see timer object
stack traceback:
    /usr/share/awesome/lib/awful/util.lua:39: in function 'deprecate'
    /usr/share/awesome/lib/awful/hooks.lua:59: in function 'register'
    /usr/share/awesome/lib/wicked.lua:718: in function 'regregister'
    /usr/share/awesome/lib/wicked.lua:679: in function 'register'
    /home/thomas/.config/awesome/rc_test.lua:302: in main chunkW: awesome: xcolor_init_reply:264: awesome: error, cannot allocate color '#000000'
E: awesome: xutil_screen_get:77: X connection invalid

Some things I´ve already noticed:
-widget layout has changed (http://awesome.naquadah.org/wiki/Awesome_3.3_to_3.4)
-the invaders library has been removed

Any ideas are welcome. Thank you!

Last edited by tyr0 (2009-10-23 15:02:10)

Offline

#2 2009-10-23 21:10:15

anrxc
Member
From: Croatia
Registered: 2008-03-22
Posts: 835
Website

Re: Once again: rc.lua changes in awesome 3.4

1. You have to disable Wicked widgets, they won't work with 3.4. Also get rid of your battery and date timers, you have to port them to the new timer objects. As a replacement for Wicked check Vicious. Alternatives to that are Obvious and Bashets.

2. You are still using hooks. They were replaced by signals. Open default rc.lua and replace your hooks with signals.


You need to install an RTFM interface.

Offline

#3 2009-10-24 11:09:43

tyr0
Member
Registered: 2007-06-02
Posts: 152

Re: Once again: rc.lua changes in awesome 3.4

Thank you for your help. I´ve tried to clean up my rc.lua, however, my lua skills are really small. So I tried your awesome 3.4 configs, I hope you don´t mind this. It´s a beatiful setup and I´ll try to start my new config on the basis of yours. I don´t get important errors, but awesome from community repo does not start on my box with your config... Thank you again!

╭─[thomas::Heraklit]
╰─[13:09]> Xephyr -ac -br -noreset -screen 1152x720 :1 & sleep 1 && DISPLAY=:1.0 awesome -c /home/thomas/.config/awesome/rc_test.lua
[1] 12180
(EE) AIGLX error: dlopen of /usr/lib/xorg/modules/dri/swrast_dri.so failed (/usr/lib/xorg/modules/dri/swrast_dri.so: cannot open shared object file: No such file or directory)
(EE) GLX: could not load software renderer
unrecognised device identifier!
(EE) config/hal: NewInputDeviceRequest failed (2)
unrecognised device identifier!
(EE) config/hal: NewInputDeviceRequest failed (2)
unrecognised device identifier!
(EE) config/hal: NewInputDeviceRequest failed (2)
unrecognised device identifier!
(EE) config/hal: NewInputDeviceRequest failed (2)
unrecognised device identifier!
(EE) config/hal: NewInputDeviceRequest failed (2)
unrecognised device identifier!
(EE) config/hal: NewInputDeviceRequest failed (2)
/home/thomas/.config/awesome/vicious/init.lua:262: attempt to perform arithmetic on a nil value
ERROR: Could not load file in bg set: Failed to open file '/home/thomas/Bilder/Wallpaper/Widescreen/Sunflower_petals_1600 x 1200.jpg': Datei oder Verzeichnis nicht gefunde

EDIT: Without vicious it just works fine... Loading the library causes the error mentioned above.

Last edited by tyr0 (2009-10-24 13:57:19)

Offline

#4 2009-10-24 17:35:08

anrxc
Member
From: Croatia
Registered: 2008-03-22
Posts: 835
Website

Re: Once again: rc.lua changes in awesome 3.4

It causes an error because all the widgets I use are setup for my system. For example File System widget requests the size of my partitions from vicious, and your partitions are different. My advice to you is to delete widgets you don't want from rc.lua, comment out the rest, then adjust one by one to your own system.

Vicious by design is just a framework, and it doesn't compensate for (l)user errors, that is made very clear. You make a mistake, your configuration can break.

Last edited by anrxc (2009-10-24 17:36:46)


You need to install an RTFM interface.

Offline

#5 2009-10-25 12:44:56

tyr0
Member
Registered: 2007-06-02
Posts: 152

Re: Once again: rc.lua changes in awesome 3.4

Hmm, thank you, I am more familiar now to vicious and i like it. Your setup is looking really nice, thank you for sharing.
2009-10-25-134314_1680x1050_scrot646.jpg.xs.jpg

Just one question: I´m trying hard to get the cpugraph.widget. I just get a blank bar without graph. Is there an error in the config?

-- {{{ License
--
-- Awesome configuration, using awesome 3.4 on Arch GNU/Linux
--   * Adrian C. <anrxc.sysphere.org>

-- Screenshot: http://sysphere.org/gallery/snapshots

-- This work is licensed under the Creative Commons Attribution Share
-- Alike License: http://creativecommons.org/licenses/by-sa/3.0/
-- }}}


-- {{{ Libraries
require("awful")
require("awful.rules")
require("awful.autofocus")
-- User libraries
require("vicious")
require("teardrop")
require("scratchpad")
-- }}}


-- {{{ Variable definitions
--
-- Beautiful theme
beautiful.init(awful.util.getdir("config") .. "/zenburn.lua")

-- Modifier keys
local altkey = "Mod4" -- Alt_L
local modkey = "Mod1" -- Super_L

-- This is used later as the default terminal and editor to run.
terminal = "urxvt"
editor = os.getenv("EDITOR") or "nano"
editor_cmd = terminal .. " -e " .. editor

use_titlebar = false

-- Function aliases
local exec  = awful.util.spawn
local sexec = awful.util.spawn_with_shell

-- Window management layouts
local layouts = {
    awful.layout.suit.tile,        -- 1
    awful.layout.suit.tile.left,   -- 2
    awful.layout.suit.tile.bottom, -- 3
    awful.layout.suit.tile.top,    -- 4
    awful.layout.suit.max,         -- 5
    awful.layout.suit.magnifier,   -- 6
    awful.layout.suit.floating     -- 7
}
-- }}}


-- {{{ Tags
local tags = {}
tags.setup = {
    { name = "urxvt",  layout = layouts[1]  },
--    { name = "emacs", layout = layouts[1]  },
    { name = "web",   layout = layouts[1]  },
    { name = "mail",  layout = layouts[5]  },
--    { name = "im",    layout = layouts[1], mwfact = 0.13 },
--    { name = "6",     layout = layouts[7], hide   = true },
--    { name = "7",     layout = layouts[7], hide   = true },
    { name = "media",   layout = layouts[7]  },
    { name = "misc", layout = layouts[7]  }
}

for s = 1, screen.count() do
    tags[s] = {}
    for i, t in ipairs(tags.setup) do
        tags[s][i] = tag({ name = t.name })
        tags[s][i].screen = s
        awful.tag.setproperty(tags[s][i], "layout", t.layout)
        awful.tag.setproperty(tags[s][i], "mwfact", t.mwfact)
        awful.tag.setproperty(tags[s][i], "hide",   t.hide)
    end
    tags[s][1].selected = true
end
-- }}}

-- {{{ Menu
-- Create a laucher widget and a main menu
myawesomemenu = {
   { "manual", terminal .. " -e man awesome" },
   { "edit config", editor_cmd .. " " .. awful.util.getdir("config") .. "/rc.lua" },
   { "restart", awesome.restart },
   { "quit", awesome.quit }
}

mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon },
                                    { "urxvt", terminal },
                    { "shutdown", terminal .. " -e poweroff" },
                    { "reboot", terminal .. " -e reboot" }
                                  }
                        })

mylauncher = awful.widget.launcher({ image = image(beautiful.awesome_icon),
                                     menu = mymainmenu })
-- }}}

-- Create a systray
mysystray = widget({ type = "systray" })

-- {{{ Wibox
--
-- {{{ Widgets configuration
--
-- {{{ Reusable separators
local spacer    = widget({ type = "textbox" })
local separator = widget({ type = "textbox" })
spacer.text     = " "
separator.text  = "|"
-- }}}

-- {{{ CPU usage and temperature
--local cpuicon = widget({ type = "imagebox" })
--cpuicon.image = image(beautiful.widget_cpu)
-- Initialize widget
--cpuwidget = widget({ type = "textbox" })
-- Register widget
--vicious.register(cpuwidget, vicious.widgets.cpu, "$1%")
-- }}}

-- {{{ CPU usage and temperature
local cpuicon = widget({ type = "imagebox" })
cpuicon.image = image(beautiful.widget_cpu)
-- Initialize widgets
local cpugraph  = awful.widget.graph()
-- Graph properties
cpugraph:set_width(50)
cpugraph:set_height(10)
cpugraph:set_max_value(100)
cpugraph:set_background_color(beautiful.fg_off_widget)
cpugraph:set_color(beautiful.fg_end_widget)
cpugraph:set_gradient_angle(0)
cpugraph:set_gradient_colors({ beautiful.fg_end_widget,
    beautiful.fg_center_widget, beautiful.fg_widget })
awful.widget.layout.margins[cpugraph.widget] = { top = 2, bottom = 2 }
-- Register widgets
vicious.register(cpugraph,  vicious.widgets.cpu,     "$1")
-- }}}


-- {{{ Battery state
--local baticon = widget({ type = "imagebox" })
--baticon.image = image(beautiful.widget_bat)
-- Initialize widget
--batwidget = widget({ type = "textbox" })
-- Register widget
--vicious.register(batwidget, vicious.widgets.bat, "$1$2%", 61, "BAT0")
-- }}}

-- {{{ Memory usage
local memicon = widget({ type = "imagebox" })
memicon.image = image(beautiful.widget_mem)
-- Initialize widget
local membar = awful.widget.progressbar()
-- Pogressbar properties
membar:set_width(8)
membar:set_height(10)
membar:set_vertical(true)
membar:set_background_color(beautiful.fg_off_widget)
membar:set_border_color(nil)
membar:set_color(beautiful.fg_widget)
membar:set_gradient_colors({ beautiful.fg_widget,
    beautiful.fg_center_widget, beautiful.fg_end_widget })
awful.widget.layout.margins[membar.widget] = { top = 2, bottom = 2 }
-- Register widget
vicious.register(membar, vicious.widgets.mem, "$1", 13)
-- }}}

-- {{{ File system usage
local fsicon = widget({ type = "imagebox" })
fsicon.image = image(beautiful.widget_fs)
-- Initialize widgets
local fs = {
  r = awful.widget.progressbar(),  h = awful.widget.progressbar(),
  s = awful.widget.progressbar(),  b = awful.widget.progressbar()
}
-- Progressbar properties
for _, w in pairs(fs) do
  w:set_width(5)
  w:set_height(12)
  w:set_vertical(true)
  w:set_background_color(beautiful.fg_off_widget)
  w:set_border_color(beautiful.border_widget)
  w:set_color(beautiful.fg_widget)
  w:set_gradient_colors({ beautiful.fg_widget,
    beautiful.fg_center_widget, beautiful.fg_end_widget })
  awful.widget.layout.margins[w.widget] = { top = 1, bottom = 1 }
  -- Register buttons
  w.widget:buttons(awful.util.table.join(
    awful.button({ }, 1, function () exec("rox", false) end)
  ))
end
-- Enable caching
vicious.enable_caching(vicious.widgets.fs)
-- Register widgets
vicious.register(fs.r, vicious.widgets.fs, "${/ usep}",            599)
vicious.register(fs.h, vicious.widgets.fs, "${/home usep}",        599)
vicious.register(fs.s, vicious.widgets.fs, "${/mnt/Daten usep}",   599)
--vicious.register(fs.b, vicious.widgets.fs, "${/mnt/extern usep}",  599)
-- }}}

-- {{{ Network usage
local dnicon = widget({ type = "imagebox" })
local upicon = widget({ type = "imagebox" })
dnicon.image = image(beautiful.widget_net)
upicon.image = image(beautiful.widget_netup)
-- Initialize widget
local netwidget = widget({ type = "textbox" })
-- Register widget
vicious.register(netwidget, vicious.widgets.net, '<span color="'
  .. beautiful.fg_netdn_widget ..'">${wlan0 down_kb}</span> <span color="'
  .. beautiful.fg_netup_widget ..'">${wlan0 up_kb}</span>', 3)
-- }}}

-- {{{ Mail subject
--local mailicon = widget({ type = "imagebox" })
--mailicon.image = image(beautiful.widget_mail)
-- Initialize widget
--local mailwidget = widget({ type = "textbox" })
-- Register widget
--vicious.register(mailwidget, vicious.widgets.mbox, "$1", 181, "/home/anrxc/mail/Inbox")
-- Register buttons
--mailwidget:buttons(awful.util.table.join(
--  awful.button({ }, 1, function () exec("urxvt -title Alpine -e alpine_exp") end)
--))
-- }}}
-- {{{ Mail subject
local mailicon = widget({ type = "imagebox" })
mailicon.image = image(beautiful.widget_mail)
-- Initialize widget
mailwidget = widget({ type = "textbox"})
function run_script()
    local filedescriptor = io.popen('perl /home/thomas/.scripts/checkMail.pl')
    local value = filedescriptor:read()
    filedescriptor:close()

    return {value}
end
vicious.register(mailwidget, run_script, '$1', 120)
--}}

-- {{{ Org-mode agenda
--local orgicon = widget({ type = "imagebox" })
--orgicon.image = image(beautiful.widget_org)
-- Initialize widget
--local orgwidget = widget({ type = "textbox" })
-- Configure widget
--local orgmode = {
--  files = {
--    "/home/anrxc/.org/work.org",     "/home/anrxc/.org/index.org",
--    "/home/anrxc/.org/personal.org", "/home/anrxc/.org/computers.org"
--  },
--  color = {
--    past   = '<span color="'..beautiful.fg_urgent..'">',
--    today  = '<span color="'..beautiful.fg_normal..'">',
--    soon   = '<span color="'..beautiful.fg_widget..'">',
--    future = '<span color="'..beautiful.fg_netup_widget..'">'
--}}
-- Register widget
--vicious.register(orgwidget, vicious.widgets.org,
--  orgmode.color.past .. '$1</span>|' .. orgmode.color.today  .. '$2</span>|' ..
--  orgmode.color.soon .. '$3</span>|' .. orgmode.color.future .. '$4</span>',
--  601, orgmode.files)
-- Register buttons
--orgwidget:buttons(awful.util.table.join(
--  awful.button({ }, 1, function () exec("emacsclient --eval '(org-agenda-list)'") end),
--  awful.button({ }, 3, function () exec("emacsclient --eval '(make-remember-frame)'") end)
--))
-- }}}

-- {{{ Volume level
--local volicon = widget({ type = "imagebox" })
--volicon.image = image(beautiful.widget_vol)
-- Initialize widgets
--local volwidget = widget({ type = "textbox" })
--local volbar    = awful.widget.progressbar()
-- Progressbar properties
--volbar:set_width(8)
--volbar:set_height(10)
--volbar:set_vertical(true)
--volbar:set_background_color(beautiful.fg_off_widget)
--volbar:set_border_color(nil)
--volbar:set_color(beautiful.fg_widget)
--volbar:set_gradient_colors({ beautiful.fg_widget,
--    beautiful.fg_center_widget, beautiful.fg_end_widget })
--awful.widget.layout.margins[volbar.widget] = { top = 2, bottom = 2 }
-- Enable caching
--vicious.enable_caching(vicious.widgets.volume)
-- Register widgets
--vicious.register(volwidget, vicious.widgets.volume, "$1%", 2, "PCM")
--vicious.register(volbar,    vicious.widgets.volume, "$1",  2, "PCM")
-- Register buttons
--volbar.widget:buttons(awful.util.table.join(
--   awful.button({ }, 1, function () exec("kmix") end),
--   awful.button({ }, 2, function () exec("amixer -q sset Master toggle") end),
--   awful.button({ }, 4, function () exec("amixer -q sset PCM 2dB+") end),
--   awful.button({ }, 5, function () exec("amixer -q sset PCM 2dB-") end)
--)) volwidget:buttons( volbar.widget:buttons() )
-- }}}

-- {{{ mpd widget
local mpdicon = widget({ type = "imagebox" })
mpdicon.image = image(beautiful.widget_phones)
-- Initialize widgets
mpdwidget = widget({ type = "textbox"})
-- Register widget
vicious.register(mpdwidget, vicious.widgets.mpd, "$1")
--}}

-- {{{ pacman widget
local pacicon = widget({ type = "imagebox" })
pacicon.image = image(beautiful.widget_pacman)
-- Initialize widgets
pacmanwidget = widget({ type = "textbox"})
-- Register widget
vicious.register(pacmanwidget, vicious.widgets.pacman, "$1", 250)
--}}

-- {{{ Date and time
local dateicon = widget({ type = "imagebox" })
dateicon.image = image(beautiful.widget_date)
-- Initialize widget
datewidget = widget({ type = "textbox" })
-- Register widget
vicious.register(datewidget, vicious.widgets.date, "%b %e, %R", 61)
-- Register buttons
datewidget:buttons(awful.util.table.join(
  awful.button({ }, 1, function () exec("pylendar.py") end)
))
-- }}}

-- {{{ System tray
local systray = widget({ type = "systray" })
-- }}}
-- }}}

-- {{{ Wibox initialisation
local wibox     = {}
local taglist   = {}
local layoutbox = {}
local promptbox = {}
taglist.buttons = awful.util.table.join(
    awful.button({ }, 1, awful.tag.viewonly),
    awful.button({ modkey }, 1, awful.client.movetotag),
    awful.button({ }, 3, awful.tag.viewtoggle),
    awful.button({ modkey }, 3, awful.client.toggletag),
    awful.button({ }, 4, awful.tag.viewnext),
    awful.button({ }, 5, awful.tag.viewprev
))

for s = 1, screen.count() do
    -- Create a promptbox
    promptbox[s] = awful.widget.prompt({ layout = awful.widget.layout.horizontal.leftright })
    -- Create a layoutbox
    layoutbox[s] = awful.widget.layoutbox(s)
    layoutbox[s]:buttons(awful.util.table.join(
        awful.button({ }, 1, function () awful.layout.inc(layouts, 1) end),
        awful.button({ }, 3, function () awful.layout.inc(layouts, -1) end),
        awful.button({ }, 4, function () awful.layout.inc(layouts, 1) end),
        awful.button({ }, 5, function () awful.layout.inc(layouts, -1) end)
    ))

    -- Create the taglist
    taglist[s] = awful.widget.taglist(s, awful.widget.taglist.label.all, taglist.buttons)
    -- Create the wibox
    wibox[s] = awful.wibox({      screen = s,
        fg = beautiful.fg_normal, height = 14,
        bg = beautiful.bg_normal, position = "top"
    })
    -- Add widgets to the wibox
    wibox[s].widgets = {
        {   taglist[s],
            layoutbox[s],
            promptbox[s],
            layout = awful.widget.layout.horizontal.leftright
        },
        s == screen.count() and systray or nil,
        separator, datewidget, dateicon,
--        separator, volwidget, spacer, volbar.widget, volicon,
        separator, mpdwidget, mpdicon,
--        separator, spacer, orgwidget, orgicon,
        separator, pacmanwidget, pacicon,
        separator, mailwidget, mailicon,
        separator, upicon, netwidget, dnicon,
        separator, fs.s.widget, fs.h.widget, fs.r.widget, fsicon,
        separator, spacer, membar.widget, spacer, memicon,
--        separator, spacer, batwidget, baticon,
        separator, cpugraph.widget, cpuicon,
    layout = awful.widget.layout.horizontal.rightleft
    }
end
-- }}}
-- }}}

-- {{{ Mouse bindings
root.buttons(awful.util.table.join(
    awful.button({ }, 3, function () mymainmenu:toggle() end),
    awful.button({ }, 4, awful.tag.viewnext),
    awful.button({ }, 5, awful.tag.viewprev)
))
-- }}

-- Client bindings
local clientbuttons = awful.util.table.join(
    awful.button({ }, 1, function (c) client.focus = c; c:raise() end),
    awful.button({ modkey }, 1, awful.mouse.client.move),
    awful.button({ modkey }, 3, awful.mouse.client.resize)
)
-- }}}


-- {{{ Key bindings
--
-- {{{ Global keys
local globalkeys = awful.util.table.join(
    -- {{{ Applications
    awful.key({ modkey }, "e", function () exec("emacsclient -n -c") end),
    awful.key({ modkey }, "r", function () exec("rox", false) end),
    awful.key({ modkey }, "w", function () exec("firefox") end),
    awful.key({ modkey }, "Return",  function () exec("urxvt") end),
    awful.key({ altkey }, "Return",  function () exec("thunar") end),
    awful.key({ altkey }, "#49", function () teardrop("urxvt", "bottom") end),
    awful.key({ altkey }, "m", function () exec("urxvt -e ncmpcpp") end),
    awful.key({ modkey }, "g", function () sexec("GTK2_RC_FILES=~/.gtkrc-gajim gajim") end),
    awful.key({ modkey }, "q", function () exec("emacsclient --eval '(make-remember-frame)'") end),
    -- }}}

    -- {{{ Multimedia keys
--    awful.key({}, "#160", function () exec("kscreenlocker --forcelock") end),
--    awful.key({}, "#121", function () exec("pvol.py -m") end),
--    awful.key({}, "#122", function () exec("pvol.py -p -c -2") end),
--    awful.key({}, "#123", function () exec("pvol.py -p -c 2") end),
--    awful.key({}, "#232", function () exec("plight.py -s -a") end),
--    awful.key({}, "#233", function () exec("plight.py -s -a") end),
--    awful.key({}, "#244", function () exec("sudo /usr/sbin/pm-hibernate") end),
--    awful.key({}, "#150", function () exec("sudo /usr/sbin/pm-suspend") end),
--    awful.key({}, "#225", function () exec("pypres.py") end),
            -- Mina
    awful.key({ }, "XF86AudioPlay",            function () awful.util.spawn("mpc toggle")  end),
    awful.key({ }, "XF86AudioStop",            function () awful.util.spawn("mpc stop")    end),
    awful.key({ }, "XF86AudioNext",            function () awful.util.spawn("mpc next")  end),
    awful.key({ }, "XF86AudioPrev",            function () awful.util.spawn("mpc prev")  end),
    awful.key({ }, "XF86AudioLowerVolume",     function () awful.util.spawn("aumix -v -3")  end),
    awful.key({ }, "XF86AudioRaiseVolume",     function () awful.util.spawn("aumix -v +3")  end),
    awful.key({ }, "XF86AudioMute",            function () awful.util.spawn("aumix -v 1")  end),
    awful.key({ }, "XF86HomePage",             function () awful.util.spawn("firefox")  end),
    awful.key({ }, "XF86Mail",                 function () awful.util.spawn("thunderbird3")  end),
    -- }}}

    -- {{{ Prompt menus
    awful.key({ modkey }, "F2", function ()
        awful.prompt.run({ prompt = "Run: " }, promptbox[mouse.screen].widget,
            function (...) promptbox[mouse.screen].text = exec(unpack(arg), false) end,
            awful.completion.shell, awful.util.getdir("cache") .. "/history")
    end),
    awful.key({ modkey }, "F3", function ()
        awful.prompt.run({ prompt = "Dictionary: " }, promptbox[mouse.screen].widget,
            function (words)
                sexec("crodict "..words.." | ".."xmessage -timeout 10 -file -")
            end)
    end),
    awful.key({ modkey }, "F4", function ()
        awful.prompt.run({ prompt = "Run Lua code: " }, promptbox[mouse.screen].widget,
        awful.util.eval, nil, awful.util.getdir("cache") .. "/history_eval")
    end),
    -- }}}

    -- {{{ Awesome controls
    awful.key({ modkey, "Shift" }, "q", awesome.quit),
    awful.key({ modkey, "Shift" }, "r", function ()
        promptbox[mouse.screen].text = awful.util.escape(awful.util.restart())
    end),
    -- }}}

    -- {{{ Tag browsing
    awful.key({ modkey }, "l",   awful.tag.viewnext),
    awful.key({ modkey }, "h",   awful.tag.viewprev),
    awful.key({ altkey }, "Tab", awful.tag.history.restore),
    awful.key({ }, "Print", function () awful.util.spawn("scrot -e 'mv $f ~/Bilder/Sonstiges/ 2>/dev/null'") end),
    -- }}}

    -- {{{ Layout manipulation
    awful.key({ modkey,     }, "Right", function () awful.tag.incmwfact( 0.05)    end),
    awful.key({ modkey,     }, "Left",  function () awful.tag.incmwfact(-0.05)    end),
    awful.key({ modkey },          "space", function () awful.layout.inc(layouts, 1) end),
    awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(layouts, -1) end),
    -- }}}

    -- {{{ Focus controls
    awful.key({ modkey }, "p", function () awful.screen.focus_relative(1) end),
    awful.key({ modkey }, "s", function () scratchpad.toggle() end),
    awful.key({ modkey,}, "m",
        function (c)
            c.maximized_horizontal = not c.maximized_horizontal
            c.maximized_vertical   = not c.maximized_vertical
        end),
    awful.key({ modkey }, "u", awful.client.urgent.jumpto),
    awful.key({ modkey }, "j", function ()
        awful.client.focus.byidx(1)
        if client.focus then client.focus:raise() end
    end),
    awful.key({ modkey }, "k", function ()
        awful.client.focus.byidx(-1)
        if client.focus then client.focus:raise() end
    end),
    awful.key({ modkey }, "Tab", function ()
        awful.client.focus.history.previous()
        if client.focus then client.focus:raise() end
    end),
    awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx(1) end),
    awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx(-1) end)
    -- }}}
)
-- }}}

-- {{{ Client manipulation
local clientkeys = awful.util.table.join(
    awful.key({ modkey }, "b", function ()
        wibox[mouse.screen].visible = not wibox[mouse.screen].visible
    end),
    awful.key({ modkey, "Shift"   }, "c",      function (c) c:kill()                         end),
    awful.key({ modkey }, "d", function (c) scratchpad.set(c, 0.60, 0.60, true) end),
    awful.key({ modkey }, "f", function (c) awful.titlebar.remove(c)
        c.fullscreen = not c.fullscreen; c.above = not c.fullscreen
    end),
    awful.key({ modkey }, "m", function (c)
        c.maximized_horizontal = not c.maximized_horizontal
        c.maximized_vertical   = not c.maximized_vertical
    end),
    awful.key({ modkey }, "o",     awful.client.movetoscreen),
    awful.key({ modkey }, "Next",  function () awful.client.moveresize(20, 20, -20, -20) end),
    awful.key({ modkey }, "Prior", function () awful.client.moveresize(-20, -20, 20, 20) end),
    awful.key({ modkey }, "Down",  function () awful.client.moveresize(0, 20, 0, 0) end),
    awful.key({ modkey }, "Up",    function () awful.client.moveresize(0, -20, 0, 0) end),
    awful.key({ modkey }, "Left",  function () awful.client.moveresize(-20, 0, 0, 0) end),
    awful.key({ modkey }, "Right", function () awful.client.moveresize(20, 0, 0, 0) end),
    awful.key({ modkey, "Shift" }, "m", function (c) c:swap(awful.client.getmaster()) end),
    awful.key({ modkey, "Shift" }, "c", function (c) exec("kill -CONT " .. c.pid) end),
    awful.key({ modkey, "Shift" }, "s", function (c) exec("kill -STOP " .. c.pid) end),
    awful.key({ modkey, "Shift" }, "t", function (c)
        if   c.titlebar then awful.titlebar.remove(c)
        else awful.titlebar.add(c, { modkey = modkey }) end
    end),
    awful.key({ modkey, "Shift" }, "f", function (c) awful.client.floating.toggle(c)
        if   awful.client.floating.get(c)
        then c.above = true; awful.titlebar.add(c); awful.placement.no_offscreen(c)
        else c.above = false; awful.titlebar.remove(c) end
    end)
)
-- }}}
use_titlebar = false
-- {{{ Keyboard digits
local keynumber = 0
for s = 1, screen.count() do
   keynumber = math.min(9, math.max(#tags[s], keynumber));
end
-- }}}

-- {{{ Tag controls
for i = 1, keynumber do
    globalkeys = awful.util.table.join( globalkeys,
        awful.key({ modkey }, i, function ()
            local screen = mouse.screen
            if tags[screen][i] then
                awful.tag.viewonly(tags[screen][i])
            end
        end),
        awful.key({ modkey, "Control" }, i, function ()
            local screen = mouse.screen
            if tags[screen][i] then
                awful.tag.viewtoggle(tags[screen][i])
            end
        end),
        awful.key({ modkey, "Shift" }, i, function ()
            if client.focus and tags[client.focus.screen][i] then
                awful.client.movetotag(tags[client.focus.screen][i])
            end
        end),
        awful.key({ modkey, "Control", "Shift" }, i, function ()
            if client.focus and tags[client.focus.screen][i] then
                awful.client.toggletag(tags[client.focus.screen][i])
            end
        end))
end
-- }}}

-- Set keys
root.keys(globalkeys)
-- }}}

-- {{{ Rules
awful.rules.rules = {
    { rule = { },
      properties = {
          border_width = beautiful.border_width,
          border_color = beautiful.border_normal,
          focus = true,
          keys = clientkeys,
          buttons = clientbuttons
    }},
    { rule = { name = "Alpine" },
      properties = { tag = tags[1][4] } },
    { rule = { class = "Gajim.py" },
      properties = { tag = tags[1][5] } },
    { rule = { class = "Akregator" },
      properties = { tag = tags[1][8] } },
    { rule = { class = "Firefox", instance = "Navigator" },
      properties = { tag = tags[screen.count()][2] } },
    { rule = { class = "Emacs", instance = "emacs" },
      properties = { tag = tags[screen.count()][2] } },
    { rule = { class = "Emacs", instance = "_Remember_" },
      properties = { floating = true } },
    { rule = { class = "Xmessage", instance = "xmessage" },
      properties = { floating = true } },
    { rule = { class = "ROX-Filer" },
      properties = { floating = true } },
    { rule = { class = "Ark" },
      properties = { floating = true } },
    { rule = { class = "Geeqie" },
      properties = { floating = true } },
    { rule = { class = "Pinentry-gtk-2" },
      properties = { floating = true } },
    { rule = { instance = "firefox-bin" },
      properties = { floating = true } },
}
-- }}}



-- {{{ Signals
--
-- {{{ Signal function to execute when a new client appears
client.add_signal("manage", function (c, startup)
    -- Add a titlebar to each floating client
--    if awful.client.floating.get(c)
--    or awful.layout.get(c.screen) == awful.layout.suit.floating then
--        if not c.titlebar and c.class ~= "Xmessage" then
--            awful.titlebar.add(c, { modkey = modkey })
--        end
--        -- Floating clients are always on top
--        c.above = true
--    end

    -- Enable sloppy focus
    c:add_signal("mouse::enter", function (c)
        if  awful.layout.get(c.screen) ~= awful.layout.suit.magnifier
        and awful.client.focus.filter(c) then
            client.focus = c
        end
    end)

    -- Client placement
    if not startup then
        awful.client.setslave(c)


        if  not c.size_hints.user_position
        and not c.size_hints.program_position then
            awful.placement.centered(c)
            awful.placement.no_offscreen(c)
        end
    end

    -- Honor size hints
    c.size_hints_honor = false
end)
-- }}}

-- {{{ Focus signal functions
client.add_signal("focus",   function (c) c.border_color = beautiful.border_focus end)
client.add_signal("unfocus", function (c) c.border_color = beautiful.border_normal end)
-- }}}
-- }}}

awful.util.spawn("keytouchd")
awful.util.spawn("xscreensaver -no-splash")
awful.util.spawn("urxvtd -q -f -o")
awful.util.spawn("nm-applet")
awful.util.spawn("xcompmgr -c -t-5 -l-5 -r4.2 -o.80")
awful.util.spawn("xrdb -merge ~/.Xdefaults")

Offline

#6 2009-10-25 13:18:20

anrxc
Member
From: Croatia
Registered: 2008-03-22
Posts: 835
Website

Re: Once again: rc.lua changes in awesome 3.4

I presume you are using latest git snapshot of vicious, and not last release? Remove this line:

cpugraph:set_max_value(100)

By default graphs now work with max value of 1.


You need to install an RTFM interface.

Offline

#7 2009-10-25 13:24:34

tyr0
Member
Registered: 2007-06-02
Posts: 152

Re: Once again: rc.lua changes in awesome 3.4

Thank you for your quick answer. This did the trick! smile

Offline

#8 2009-12-06 05:29:49

nephish99
Member
Registered: 2007-09-01
Posts: 85

Re: Once again: rc.lua changes in awesome 3.4

Jeez, this is insane.
My computer at home is Arch with awesome 3.4
my computer at work is Ubuntu with awesome 3.3.4
i can't even share a config file between them.

What improvement has been made in awesome that justifies having to reconfigure everything.... again?

Offline

Board footer

Powered by FluxBB