-- Standard awesome library require("awful") require("awful.autofocus") require("awful.rules") -- Theme handling library require("beautiful") -- Notification library --require("naughty") -- {{{ Variable definitions -- Themes define colours, icons, and wallpapers beautiful.init("/usr/local/share/awesome/themes/default/theme.lua") -- This is used later as the default terminal and editor to run. terminal = "konsole" editor = os.getenv("EDITOR") or "nano" editor_cmd = terminal .. " -e " .. editor -- 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 = "Mod1" -- Table of layouts to cover with awful.layout.inc, order matters. layouts = { awful.layout.suit.fair, awful.layout.suit.fair.horizontal, -- awful.layout.suit.floating, -- awful.layout.suit.tile, -- awful.layout.suit.tile.left, -- awful.layout.suit.tile.bottom, -- awful.layout.suit.tile.top, awful.layout.suit.spiral, -- awful.layout.suit.spiral.dwindle, -- awful.layout.suit.max, awful.layout.suit.max.fullscreen, -- awful.layout.suit.magnifier } -- }}} -- {{{ Tags -- Define a tag table which hold all screen tags. tags = {} -- Primary screen has 9 tables if (screen.count() == 1) then tags[1] = awful.tag({ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 }, 1, layouts[1]) end -- secondary has 9 --if (screen.count() == 2) then -- tags[1] = awful.tag({ 1, 2, 3, 4, 5, 6, 7, 8, 9 }, 1, layouts[1]) -- tags[2] = awful.tag({4}, 2, layouts[1]) --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, "Shift", }, "^", awful.tag.viewprev ), awful.key({ modkey, }, "^", awful.tag.viewnext ), awful.key({ modkey, }, "Escape", awful.tag.history.restore), awful.key({ modkey, "Shift", }, "Tab", function () awful.client.focus.byidx( 1) if client.focus then client.focus:raise() end end), awful.key({ modkey, }, "Tab", 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, "Control" }, "j", function () awful.screen.focus_relative( 1) end), awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end), awful.key({ modkey, }, "u", awful.client.urgent.jumpto), -- 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, }, "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, "Control" }, "space", function () awful.layout.inc(layouts, 1) end) -- awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(layouts, -1) end), ) clientkeys = awful.util.table.join( awful.key({ modkey, "Control" }, "f", function (c) c.fullscreen = not c.fullscreen end), awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end), awful.key({ modkey, "Shift" }, "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", function (c) c.ontop = not c.ontop end), awful.key({ modkey, }, "n", function (c) c.minimized = not c.minimized end), 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 -- Bind all key numbers to tags. -- Be careful: we use keycodes to make it works on any keyboard layout. -- This should map on the top row of your keyboard, usually 1 to 9. for i = 1, 12 do globalkeys = awful.util.table.join(globalkeys, awful.key({ modkey }, "F" .. i, function () local screen = mouse.screen if tags[screen][i] then awful.tag.viewonly(tags[screen][i]) end end), -- awful.key({ modkey, "Control" }, "F" .. i + 9, -- function () -- local screen = mouse.screen -- if tags[screen][i] then -- awful.tag.viewtoggle(tags[screen][i]) -- end -- end), awful.key({ modkey, "Shift" }, "F" .. 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" }, "F" .. i, function () if client.focus and tags[client.focus.screen][i] then awful.client.toggletag(tags[client.focus.screen][i]) 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) -- }}} -- {{{ Rules awful.rules.rules = { -- All clients will match this rule. { rule = { }, properties = { border_width = beautiful.border_width, border_color = beautiful.border_normal, focus = true, keys = clientkeys, buttons = clientbuttons }, callback = awful.client.setslave -- callback = function (c) if awful.tag.selected(mouse.screen) == 1 awful.client.movetotag(tags[1][5],c) end }, }, -- floats { rule = { class = "MPlayer" }, properties = { floating = true } }, { rule = { name = "glxgears" }, properties = { floating = true } }, { rule = { class = "Plasma-desktop", instance = "plasma-desktop", name = "plasma-desktop" }, properties = { floating = true } }, -- { rule = { class = "Plasma" }, -- properties = { floating = false } }, { rule = { class = "pinentry" }, properties = { floating = true } }, { rule = { class = "gimp" }, properties = { floating = true } }, { rule = { class = "Kruler" }, properties = { floating = true } }, { rule = { class = "Yakuake" }, properties = { floating = true } }, { rule = { class = "Stjerm" }, properties = { floating = true } }, { rule = { class = "Wrapper" }, properties = { floating = true } }, -- tag 1 { rule = { class = "Firefox" }, properties = { tag = tags[1][1] } }, { rule = { class = "Rekonq" }, properties = { tag = tags[1][1] } }, { rule = { class = "Chrome" }, properties = { tag = tags[1][1] } }, { rule = { class = "Chromium" }, properties = { tag = tags[1][1] } }, -- tag 2 { rule = { class = "Kopete" }, properties = { tag = tags[1][2] } }, { rule = { class = "Telepathy-kde-contactlist" }, properties = { tag = tags[1][2] } }, { rule = { class = "Mumble" }, properties = { tag = tags[1][2] } }, { rule = { class = "Pidgin" }, properties = { tag = tags[1][2] } }, -- tag 3 { rule = { class = "Thunderbird" }, properties = { tag = tags[1][3] } }, { rule = { class = "Kmail" }, properties = { tag = tags[1][3] } }, { rule = { class = "Kontact" }, properties = { tag = tags[1][3] } } } -- }}} -- {{{ Signals -- Signal function to execute when a new client appears. client.add_signal("manage", function (c, startup) -- Add a titlebar -- awful.titlebar.add(c, { modkey = modkey }) -- 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) 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.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) -- }}} function run_once(prg,arg_string,pname,screen) if not prg then do return nil end end if not pname then pname = prg end if not arg_string then awful.util.spawn_with_shell("sh -c 'pgrep -u $USER -x '" .. pname .. "' || (" .. prg .. ")'",screen) else awful.util.spawn_with_shell("sh -c 'pgrep -u $USER -x '" .. pname .. "' || (" .. prg .. " " .. arg_string .. ")'",screen) end end -- Autostart run_once("cairo-compmgr") --run_once("plasma-desktop") --run_once("kdeinit4") --run_once("xfdesktop") run_once("xfce4-panel") run_once("launchy") --run_once("gpg-agent", "--daemon --enable-ssh-support --write-env-file ~/.gpg-agent-info") globalkeys = awful.util.table.join(globalkeys, awful.key({"Control"}, "y", function() awful.util.spawn_with_shell("yakuake") end)) root.keys(globalkeys) awful.util.spawn_with_shell("sleep 3 && awsetbg /home/hannes/FOTOS/hintergrund2.png") --awful.util.spawn_with_shell("xmodmap -e 'pointer = 1 8 3 4 5 6 7 2'") awful.util.spawn_with_shell("sleep 10 && akonadictl stop")