Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --require("eminent")
- -- Standard awesome library
- require("awful")
- require("awful.autofocus")
- require("awful.rules")
- -- Theme handling library
- require("beautiful")
- -- Notification library
- require("naughty")
- require("vicious")
- require("wicked")
- require("revelation")
- --require("shifty")
- require("obvious.battery")
- -- {{{ Variable definitions
- -- Themes define colours, icons, and wallpapers
- wallpaper_cmd = { "awsetbg -f /home/p1mps/Pictures/wallpaper/Mario_by_Noodlez222.png"}
- beautiful.init("/usr/share/awesome/themes/default/theme.lua")
- -- This is used later as the default terminal and editor to run.
- terminal = "urxvt"
- editor = "emacs"
- 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 = "Mod4"
- -- Table of layouts to cover with awful.layout.inc, order matters.
- layouts =
- {
- 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.fair,
- awful.layout.suit.fair.horizontal,
- 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 = {}
- for s = 1, screen.count() do
- -- Each screen has its own tag table.
- tags[s] = awful.tag({ "screen","work", "www", "dev", "im","mail", "media","pdf"}, s, layouts[2])
- end
- -- }}}
- -- client settings
- -- order here matters, early rules will be applied first
- --{{{ SHIFTY: configured tags
- --shifty.config.tags = {
- --["screen"] = { layout = awful.layout.suit.tile.bottom, mwfact=0.65, persistent= true,exclusive = true , solitary = true , position = 1, spawn = terminal } ,
- --["mail"] = { layout = awful.layout.suit.tile.bottom, mwfact=0.65, persistent= true,exclusive = true , solitary = true , position = 5 ,spawn = mail } ,
- --["im"] = { layout = awful.layout.suit.tile.bottom, mwfact=0.65, persistent= true,exclusive = false , solitary = true , position = 4 ,spawn = terminal } ,
- --["www"] = { layout = awful.layout.suit.tile.bottom, mwfact=0.65, persistent= true,exclusive = false , solitary = false , position = 3, spawn = browser } ,
- --["work"] = { layout = awful.layout.suit.tile.bottom, mwfact=0.65, persistent= true,exclusive = true , solitary = true , position = 2 ,spawn = terminal} ,
- --["dev"] = { layout = awful.layout.suit.tile.bottom, mwfact=0.65, persistent= true,exclusive = true , solitary = true , position = 6, spawn = terminal } ,
- --["media"] = { layout = awful.layout.suit.tile.bottom, mwfact=0.65, persistent= true,exclusive = true , solitary = true , position = 7, spawn = terminal } ,
- --}
- --}}}
- --{{{ SHIFTY: application matching rules
- -- order here matters, early rules will be applied first
- --shifty.config.apps = {
- -- { match = { "Pidgin" } , tag = "im" } ,
- -- { match = { "Navigator","*Namoroka" } , tag = "www",slave= true},
- -- { match = { "Shredder*", "Thunderbird3" , "urxvt -e mutt"} , tag = "mail" } ,
- -- { match = { "thunar" } , tag="media" } ,
- -- { match = { "OpenOffice.*", "eclipse","Pydev*" } , tag = "work" } ,
- --{ match = { terminal } , honorsizehints = false, slave = false } ,
- --{ match = { "Mplayer" } , tag ="media"},
- --{ match = { "mutt" } , tag ="mail"},
- --{ match = { "Google*" } , tag ="www" ,slave=true, float=true},
- --{ match = { "emacs*" } , tag ="dev" ,slave=true},
- --{ 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: default tag creation rules
- -- parameter description
- -- * floatBars : if floating clients should always have a titlebar
- -- * guess_name : wether shifty should try and guess tag names when creating new (unconfigured) tags
- -- * guess_position: as above, but for position parameter
- -- * run : function to exec when shifty creates a new tag
- -- * remember_index: ?
- -- * all other parameters (e.g. layout, mwfact) follow awesome's tag API
- --shifty.config.defaults={
- -- layout = awful.layout.suit.tile.bottom,
- -- ncol = 1,
- -- mwfa-ct = 0.60,
- -- floatBars=true,
- -- guess_name=true,
- -- guess_position=true,
- --}
- --shifty.init()
- ---}}}
- --TODO LIST
- function get_agenda()
- local filedescriptor = io.open("/home/p1mps/lavoro/TODO","r")
- local todo = filedescriptor:read("*a")
- --print (todo)
- filedescriptor:close()
- return todo
- end
- --TODO LIST
- function get_note()
- local filedescriptor = io.open("/home/p1mps/lavoro/note","r")
- local todo = filedescriptor:read("*a")
- --print (todo)
- filedescriptor:close()
- return todo
- end
- 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 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
- 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 },
- { "open terminal", terminal }
- }
- })
- mylauncher = awful.widget.launcher({ image = image(beautiful.awesome_icon),
- menu = mymainmenu })
- -- }}}
- -- {{{ Wibox
- -- Create a textclock widget
- mytextclock = awful.widget.textclock({ align = "right" })
- --calendar
- local calendar = nil
- local offset = 0
- function remove_calendar()
- if calendar ~= nil then
- naughty.destroy(calendar)
- calendar = nil
- offset = 0
- end
- end
- function add_calendar(inc_offset)
- local save_offset = offset
- remove_calendar()
- offset = save_offset + inc_offset
- local datespec = os.date("*t")
- datespec = datespec.year * 12 + datespec.month - 1 + offset
- datespec = (datespec % 12 + 1) .. " " .. math.floor(datespec / 12)
- local cal = awful.util.pread("cal -m " .. datespec)
- cal = string.gsub(cal, "^%s*(.-)%s*$", "%1")
- calendar = naughty.notify({
- text = string.format('<span font_desc="%s">%s</span>', "terminus", cal),
- timeout = 0, hover_timeout = 0.5,
- width = 160,
- })
- end
- -- change clockbox for your clock widget (e.g. mytextclock)
- mytextclock:add_signal("mouse::enter", function()
- add_calendar(0)
- end)
- mytextclock:add_signal("mouse::leave", remove_calendar)
- mytextclock:buttons({
- button({ }, 4, function()
- add_calendar(-1)
- end),
- button({ }, 5, function()
- add_calendar(1)
- end),
- })
- myorgwidget = widget({type = "textbox"})
- mynote = widget({type = "textbox"})
- --todo
- local todo = nil
- local offset = 0
- function remove_todo()
- if todo ~= nil then
- naughty.destroy(todo)
- calendar = nil
- offset = 0
- end
- end
- function add_todo(inc_offset)
- local save_offset = offset
- remove_todo()
- offset = save_offset + inc_offset
- local cal = get_agenda()
- todo = naughty.notify({
- text = string.format('<span font_desc="%s">%s</span>', "terminus", cal),
- timeout = 0, hover_timeout = 0.5,
- width = 160,
- })
- end
- --todo
- local todo = nil
- local offset = 0
- function remove_note()
- if todo ~= nil then
- naughty.destroy(todo)
- calendar = nil
- offset = 0
- end
- end
- function add_note(inc_offset)
- local save_offset = offset
- remove_todo()
- offset = save_offset + inc_offset
- local cal = get_note()
- todo = naughty.notify({
- text = string.format('<span font_desc="%s">%s</span>', "terminus", cal),
- timeout = 0, hover_timeout = 0.5,
- width = 200,
- })
- end
- -- change clockbox for your clock widget (e.g. mytextclock)
- myorgwidget:add_signal("mouse::enter", function()
- add_todo(0)
- end)
- myorgwidget:add_signal("mouse::leave", remove_todo)
- myorgwidget:buttons({
- button({ }, 4, function()
- add_todo(-1)
- end),
- button({ }, 5, function()
- add_todo(1)
- end),
- })
- -- change clockbox for your clock widget (e.g. mytextclock)
- mynote:add_signal("mouse::enter", function()
- add_note(0)
- end)
- mynote:add_signal("mouse::leave", remove_note)
- mynote:buttons({
- button({ }, 4, function()
- add_note(-1)
- end),
- button({ }, 5, function()
- add_note(1)
- end),
- })
- myorgwidget.text = "<span color='cyan'>TODO </span>"
- mynote.text = "<span color='violet'>note </span>"
- awful.hooks.timer.register(3, function()
- batteryInfo("BAT0")
- end)
- fsicon = widget({type ="imagebox"})
- fsicon.image = image("/home/p1mps/.config/awesome/icons/disk.png")
- fswidget = widget({type="textbox"})
- vicious.register(fswidget,vicious.widgets.fs,"<span color='white'> root: ${/ used_p}% </span> ")
- fs2widget = widget({type="textbox"})
- vicious.register(fs2widget,vicious.widgets.fs,"<span color='white'> dati: ${/media/dati used_p}% </span> ")
- --wifi
- wificon = widget({type ="imagebox"})
- wificon.image = image("/home/p1mps/.config/awesome/icons/wifi.png")
- wifiwidget = widget({type="textbox"})
- vicious.register(wifiwidget,vicious.widgets.net,"<span color='white'> down ${wlan0 down_kb} up ${wlan0 up_kb} </span> ")
- --memory
- -- Initialize widget
- memicon = widget({type ="imagebox"})
- memicon.image = image("/home/p1mps/.config/awesome/icons/mem.png")
- memwidget = widget({ type = "textbox" })
- -- Register widget
- vicious.register(memwidget, vicious.widgets.mem, "<span color='white'> $1% ($2MB/$3MB) </span>", 13)
- --cpu
- -- Initialize widget
- cpuwidget = awful.widget.graph()
- -- Graph properties
- cpuwidget:set_width(50)
- cpuwidget:set_background_color("#494B4F")
- cpuwidget:set_color("#FF5656")
- cpuwidget:set_gradient_colors({ "#FF5656", "#88A175", "#AECF96" })
- -- Register widget
- vicious.register(cpuwidget, vicious.widgets.cpu, "$1")
- --MPD
- mpdwidget = widget({type="textbox"})
- vicious.register(mpdwidget,vicious.widgets.mpd,"Playing: <span color='red'> $1 </span> ")
- -- battery
- baticon = widget({type ="imagebox"})
- baticon.image = image("/home/p1mps/.config/awesome/icons/bat.png")
- batterywidget = widget({type="textbox"})
- vicious.register(batterywidget,vicious.widgets.bat,"$1$2%",31,"BAT0")
- --mail
- -- {{{ GMail widget
- -- Initialize widget
- gmailicon = widget({ type = "imagebox" })
- gmailicon.image = image("/home/p1mps/.config/awesome/icons/mail.png")
- gmailwidget = widget({ type = "textbox" })
- --Register widget
- vicious.register(gmailwidget, vicious.widgets.gmail, "<span color='white'> Mail: ${count} | ${subject} </span>", 20)
- mailicon = widget({ type = "imagebox" })
- mailicon.image = image("/home/p1mps/.config/awesome/icons/mail.png")
- -- Initialize widget
- mailwidget = widget({ type = "textbox" })
- -- Register widget
- --vicious.register(mailwidget, vicious.widgets.mbox, "$1", 181, {"/home/p1mps/Mail", 15})
- -- Register buttons
- mailwidget:buttons(awful.util.table.join(
- awful.button({ }, 1, function () exec("thunderbird") end)
- ))
- -- Create a systray
- mysystray = widget({ type = "systray" })
- -- Create a wibox for each screen and add it
- mywibox = {}
- mywibox_down = {}
- 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),
- 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] = awful.widget.prompt({ layout = awful.widget.layout.horizontal.leftright })
- -- 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.label.all, mytaglist.buttons)
- -- Create a tasklist widget
- mytasklist[s] = awful.widget.tasklist(function(c)
- return awful.widget.tasklist.label.currenttags(c, s)
- end, mytasklist.buttons)
- -- Create the wibox
- mywibox[s] = awful.wibox({ position = "top", screen = s })
- mywibox_down[s] = awful.wibox({ position = "bottom", screen = s })
- -- Add widgets to the wibox - order matters
- mywibox[s].widgets = {
- {
- mylauncher,
- mytaglist[s],
- mypromptbox[s],
- layout = awful.widget.layout.horizontal.leftright
- },
- mylayoutbox[s],
- -- myorgwidget,
- mytextclock,
- --wifiwidget,
- mpdwidget,
- --myorgwidget,
- mynote,
- myorgwidget,
- s == 1 and mysystray or nil,
- mytasklist[s],
- layout = awful.widget.layout.horizontal.rightleft
- }
- mywibox_down[s].widgets = {
- {
- layout = awful.widget.layout.horizontal.leftright
- },
- -- myorgwidget,
- cpuwidget,
- gmailwidget,
- gmailicon,
- spacer,
- memwidget,
- memicon,
- layout = awful.widget.layout.horizontal.rightleft,
- wifiwidget,
- spacer,
- wificon,
- separator,
- fswidget,
- spacer,
- fs2widget,
- spacer,
- fsicon,
- separator,
- baticon,
- spacer,
- batterywidget,
- 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)
- ))
- -- }}}
- -- {{{ Key bindings
- globalkeys = awful.util.table.join(
- awful.key({ modkey, }, "Left", awful.tag.viewprev ),
- awful.key({ modkey, }, "Right", awful.tag.viewnext ),
- awful.key({ modkey, }, "Escape", awful.tag.history.restore),
- awful.key({ modkey }, "e", revelation.revelation),
- 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, "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),
- 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, }, "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),
- 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({ modkey}, "t", function () awful.util.spawn("thunar") end),
- awful.key({ modkey}, "g", function () awful.util.spawn("google-chrome") end),
- awful.key({ modkey}, "s", function () awful.util.spawn("emacs") end),
- awful.key({ modkey}, "p", function () awful.util.spawn("pidgin") end),
- -- Prompt
- awful.key({ modkey }, "r", 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)
- )
- -- C
- 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", 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)
- )
- 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.
- -- 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, keynumber do
- globalkeys = awful.util.table.join(globalkeys,
- awful.key({ modkey }, "#" .. i + 9,
- function ()
- local screen = mouse.screen
- if tags[screen][i] then
- awful.tag.viewonly(tags[screen][i])
- end
- end),
- awful.key({ modkey, "Control" }, "#" .. i + 9,
- function ()
- local screen = mouse.screen
- if tags[screen][i] then
- awful.tag.viewtoggle(tags[screen][i])
- end
- end),
- awful.key({ modkey, "Shift" }, "#" .. i + 9,
- 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 + 9,
- function ()
- if client.focus and tags[client.focus.screen][i] then
- awful.client.toggletag(tags[client.focus.screen][i])
- end
- end))
- end
- --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
- --for i = 1, keynumber do
- -- globalkeys = awful.util.table.join(globalkeys,
- -- awful.key({ modkey }, "#" .. i + 9,
- -- function ()
- -- local screen = mouse.screen
- -- if tags[screen][i] then
- -- awful.tag.viewonly(tags[screen][i])
- -- end
- -- end),
- -- awful.key({ modkey, "Control" }, "#" .. i + 9,
- -- function ()
- -- local screen = mouse.screen
- -- if tags[screen][i] then
- -- awful.tag.viewtoggle(tags[screen][i])
- -- end
- -- end),
- -- awful.key({ modkey, "Shift" }, "#" .. i + 9,
- -- 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 + 9,
- -- 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)
- -- Set keys
- --shifty.config.globalkeys = globalkeys
- --shifty.config.clientkeys = clientkeys
- -- }}}
- -- {{{ 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 } },
- { rule = { class = "MPlayer" },
- properties = { floating = true } },
- { rule = { class = "pinentry" },
- properties = { floating = true } },
- { rule = { class = "gimp" },
- properties = { floating = true } },
- { rule = { class = "Pidgin" },
- properties = { floating = true } },
- -- Set Firefox to always map on tags number 2 of screen 1.
- -- { rule = { class = "Firefox" },
- -- properties = { tag = tags[1][2] } },
- }
- -- }}}
- -- {{{ 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
- -- Search for this line:
- -- Then add the following below it:
- -- 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)
- -- }}}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement