You are not logged in.

#1 2010-10-17 06:40:14

m0nhawk
Member
Registered: 2010-01-15
Posts: 25

Awesome + Shifty errors

I've updated awesome-git and installed shifty-git (from AUR).

And try to make shifty works. But it just "crashes":

/usr/share/awesome/lib/shifty.lua:795: attempt to call field 'remove_signal' (a nil value)

My rc.lua.

require("awful")
require("awful.autofocus")
require("awful.rules")
require("beautiful")
require("naughty")
require("shifty")

if true then return end

-- {{{ Variable definitions
-- Themes define colours, icons, and wallpapers
beautiful.init(awful.util.getdir("config") .. "/themes/default/theme.lua")

-- This is used later as the default terminal and editor to run.
home        = os.getenv("HOME")
exec        = awful.util.spawn

terminal    = "gnome-terminal"
editor        = "scribes"
browser        = "google-chrome"

-- Default modkey.
-- Usually, Mod4 is the key with a logo between Control and Alt.
-- If you do not like this or do not have such a key,
-- I suggest you to remap Mod4 to another key using xmodmap or other tools.
-- However, you can use another modifier like Mod1, but it may interact with others.
modkey = "Mod4"

-- Table of layouts to cover with awful.layout.inc, order matters.
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
}
-- }}}

-- {{{ Autorun
local r = require("runonce")

apps = {
    "sbxkb"
}

r.run(apps[1])
-- }}}

shifty.config.tags = {
["1:sys"] = { init = true, position = 1, screen = 1, mwfact = 0.60                 },
["3:www"] = { exclusive = true, max_clients = 1, position = 3, spawn = "firefox"   },
["2:term"] = { persist = true, position = 2,                                        },
["ardour"] = { nopopup = true, leave_kills = true,                                  },
    ["p2p"] = { icon = "/usr/share/pixmaps/p2p.png", icon_only = true,               },
    ["gimp"] = { layout = "tile", mwfact = 0.18, icon="/usr/share/pixmaps/gimp.png",  },
    ["fs"] = { rel_index = 1,                                                       },
}

shifty.config.apps = {
        { match = { "Google-chrome"       }, tag = "1:www",        screen = 1,     },
        { match = { "" }, buttons = {
                            button({ }, 1, function (c) client.focus = c; c:raise() end),
                            button({ modkey }, 1, function (c) awful.mouse.client.move() end),
                            button({ modkey }, 3, awful.mouse.client.resize ), }, },
}

shifty.config.defaults = {
layout = "max", 
run = function(tag) naughty.notify({ text = tag.name }) end,
}

shifty.init()

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

myappsmenu = {
    { "texworks", "texworks" },
    { "scribes", "scribes" }
}

mymainmenu = awful.menu({ items = { { "apps", myappsmenu },
                                    { "terminal", terminal },
                                    { "browser", browser },
                                    { "im-client", "pidgin" },
                                    { "awesome", myawesomemenu }
                                }
                        })
-- }}}

-- {{{ Wibox
-- Create a textclock widget
mytextclock = awful.widget.textclock()

-- 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, awful.tag.viewtoggle),
                    awful.button({ modkey }, 3, awful.client.toggletag)
                    )
shifty.taglist = mytaglist
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))

for s = 1, screen.count() do
    -- Create a promptbox for each screen
    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)
    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(s, awful.widget.taglist.filter.all, mytaglist.buttons)

    -- Create a tasklist widget
    mytasklist[s] = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, mytasklist.buttons)

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

    -- Widgets that are aligned to the left
    local left_layout = wibox.layout.fixed.horizontal()
    left_layout:add(mytaglist[s])
    left_layout:add(mypromptbox[s])

    -- Widgets that are aligned to the right
    local right_layout = wibox.layout.fixed.horizontal()
    if s == 1 then right_layout:add(wibox.widget.systray()) end
    right_layout:add(mytextclock)
    right_layout:add(mylayoutbox[s])

    -- Now bring it all together (with the tasklist in the middle)
    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)
end
-- }}}

-- {{{ Key bindings
globalkeys = awful.util.table.join(
    awful.key({ modkey,           }, "p", awful.tag.viewprev            ),
    awful.key({ modkey,           }, "n", awful.tag.viewnext            ),
    awful.key({ modkey,           }, "Tab", awful.tag.history.restore),
    
    -- XF86AudioRaiseVolume
--    awful.key({                   }, "#123", function () exec(volume_manager .. " set Master 2dB+") end),
    -- XF86AudioLowerVolume
--    awful.key({                   }, "#122", function () exec(volume_manager .. " set Master 2dB-") end),

    -- XF86Play
    awful.key({                   }, "#174", function () end),

    -- XF86Stop
    awful.key({                   }, "#172", function () end),

    -- XF86AudioPrev
    awful.key({                   }, "#173", function () end),

    -- XF86AudioNext
    awful.key({                   }, "#171", function () end),

    -- XF86Sleep
    awful.key({                   }, "#150", function () exec("sudo pm-suspend") end),

    -- XF86PowerOff
--    awful.key({                   }, "#124", function () exec("") end),

    -- XF86Display
    awful.key({                   }, "#235", function () exec("sh " .. home .. "/bin/screen.sh") end),
    
    --Print
    awful.key({                   }, "#107", function () exec("scrot -e 'mv $f /data/screenshots/ 2>/dev/null'") end),

    awful.key({ modkey,           }, "b",
        function ()
            mywibox[mouse.screen].visible = not mywibox[mouse.screen].visible
        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({keygrabber=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,           }, "u", awful.client.urgent.jumpto),

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

    awful.key({ modkey,           }, "l",     function () awful.tag.incmwfact( 0.05)    end),
    awful.key({ modkey,           }, "h",     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),

    -- Prompt
    awful.key({ modkey,           }, "e",     function () mypromptbox[mouse.screen]:run() end),

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

clientkeys = awful.util.table.join(
    awful.key({ modkey,           }, "f",      function (c)
                                                    c.fullscreen = not c.fullscreen
                                                end),
    awful.key({ modkey,           }, "c",      function (c) c:kill()                         end),
    awful.key({ modkey,           }, "a",      awful.client.floating.toggle                     ),
    awful.key({ modkey,           }, "m",      function (c) c:swap(awful.client.getmaster()) end),
    awful.key({ modkey,           }, "o",      awful.client.movetoscreen                        ),
    awful.key({ modkey,           }, "t",      function (c) c.ontop = not c.ontop            end),
    awful.key({ modkey,           }, "i",
        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
for i=1,9 do
    globalkeys = awful.util.table.join(globalkeys, awful.key({ modkey }, i,
    function ()
        local t = awful.tag.viewonly(shifty.getpos(i))
    end))
    globalkeys = awful.util.table.join(globalkeys, awful.key({ modkey, "Control" }, i,
    function ()
        local t = shifty.getpos(i)
        t.selected = not t.selected
    end))
    globalkeys = awful.util.table.join(globalkeys, awful.key({ modkey, "Control", "Shift" }, i,
    function ()
        if client.focus then
            awful.client.toggletag(shifty.getpos(i))
        end
    end))
    -- move clients to other tags
    globalkeys = awful.util.table.join(globalkeys, awful.key({ modkey, "Shift" }, i,
        function ()
            if client.focus then
                local t = shifty.getpos(i)
                awful.client.movetotag(t)
                awful.tag.viewonly(t)
            end
        end))
end

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))

-- Set keys
root.keys(globalkeys)
shifty.config.globalkeys = globalkeys
shifty.config.clientkeys = clientkeys
-- }}}

-- {{{ Rules
awful.rules.rules = {
    { rule = { },
    properties = { border_width = beautiful.border_width,
                    border_color = beautiful.border_normal,
                    focus = true,
                    keys = clientkeys,
                    buttons = clientbuttons } },
    { rule = { class = "MPlayer" },
    properties = { floating = true } },
    { rule = { class = "Google-chrome" },
    properties = { tag = tags[1][1] } },
    { rule = { class = "Skype.bin" },
    properties = { tag = tags[1][2] } },
    { rule = { class = "Pidgin" },
    properties = { tag = tags[1][2] } }
}
-- }}}

-- {{{ Signals
-- Signal function to execute when a new client appears.
client.connect_signal("manage", function (c, startup)
    if not startup then
        -- Set the windows at the slave,
        -- i.e. put it at the end of others instead of setting it master.
        -- awful.client.setslave(c)

        -- Put windows in a smart way, only if they does not set an initial position.
        if not c.size_hints.user_position and not c.size_hints.program_position then
            awful.placement.no_overlap(c)
            awful.placement.no_offscreen(c)
        end
    end
end)

client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)
client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
-- }}}

I will be appreciate with any help...

Offline

#2 2010-10-17 14:05:07

ZekeSulastin
Member
Registered: 2010-09-20
Posts: 266

Re: Awesome + Shifty errors

Shifty hasn't been updated by its contributors since the end of 2009, whereas awesome-git is so different from the current stable version (3.48) that most config files for 3.48 won't work in -git without a bit of modification.

Last edited by ZekeSulastin (2010-10-17 14:07:02)

Offline

#3 2010-10-17 14:07:53

m0nhawk
Member
Registered: 2010-01-15
Posts: 25

Re: Awesome + Shifty errors

So it's not my fault? smile

Okk. So -- thanks. I will seek for some other dynamic tagging for awesome.

Offline

#4 2010-10-17 14:17:12

ZekeSulastin
Member
Registered: 2010-09-20
Posts: 266

Re: Awesome + Shifty errors

Have you considered using 3.48 instead of -git?  Shifty should work with it; here's an example rc.lua with a stated version of 3.46, and I'm fairly certain no major changes that would break shifty happened between .46 and .48 smile

http://github.com/JackH79/.dotfiles/blo … ome/rc.lua

Offline

#5 2010-10-17 14:48:37

lifeafter2am
Member
From: 127.0.0.1
Registered: 2009-06-10
Posts: 1,332

Re: Awesome + Shifty errors

I have shifty mostly working with my config.  I have a suspicion that renaming workspaces might be broken though, as this is the only thing that I can not get working.


#binarii @ irc.binarii.net
Matrix Server: https://matrix.binarii.net
-------------
Allan -> ArchBang is not supported because it is stupid.

Offline

#6 2010-10-18 11:39:04

paradoxxxzero
Member
Registered: 2010-10-18
Posts: 4

Re: Awesome + Shifty errors

Same problem here, trying all shifty fork versions that I could find online and no success

Last edited by paradoxxxzero (2010-10-18 11:39:21)

Offline

#7 2010-10-30 04:59:40

mochidino
Member
Registered: 2010-09-30
Posts: 4

Re: Awesome + Shifty errors

i have the same problem and finally found a solution

first you should NOT use the git version of awesome in order to use the shifty module, and then change the source code of shifty.lua(only one line involved) , and viola, it works.

for how to change the code: check this post

and thanks  kamil

Last edited by mochidino (2010-10-30 05:02:16)

Offline

Board footer

Powered by FluxBB