1
0
Fork 0
mirror of https://github.com/lcpz/awesome-copycats.git synced 2024-10-22 20:41:22 +00:00

binding key to tags: switched back to 3.5-2 config

This commit is contained in:
luke bonham 2013-04-25 13:41:47 +02:00
parent cd562892ab
commit f892687ce5

View file

@ -85,8 +85,6 @@ editor_cmd = terminal .. " -e " .. editor
gui_editor = "gvim" gui_editor = "gvim"
browser = "dwb" browser = "dwb"
mail = terminal .. " -e mutt " mail = terminal .. " -e mutt "
chat = terminal .. " -e irssi "
tasks = terminal .. " -e htop "
wifi = terminal .. " -e sudo wifi-menu " wifi = terminal .. " -e sudo wifi-menu "
musicplr = terminal .. " -g 130x34-320+16 -e ncmpcpp " musicplr = terminal .. " -g 130x34-320+16 -e ncmpcpp "
@ -126,18 +124,13 @@ myaccessories = {
{ "archives", "7zFM" }, { "archives", "7zFM" },
{ "charmap", "gucharmap" }, { "charmap", "gucharmap" },
{ "gbdfed", "gbdfed" }, { "gbdfed", "gbdfed" },
{ "editor", gui_editor }, { "gimp", "gimp" },
{ "text editor", gui_editor },
} }
myinternet = { myinternet = {
{ "browser", browser },
{ "irc client" , chat },
{ "torrent" , "rtorrent" }, { "torrent" , "rtorrent" },
{ "torrent search" , "torrent-search" } { "torrent search" , "torrent-search" }
} }
mygraphics = {
{ "gimp" , "gimp" },
{ "dia", "dia" },
}
myoffice = { myoffice = {
{ "writer" , "lowriter" }, { "writer" , "lowriter" },
{ "impress" , "loimpress" }, { "impress" , "loimpress" },
@ -146,11 +139,9 @@ mysystem = {
{ "appearance" , "lxappearance" }, { "appearance" , "lxappearance" },
{ "cleaning" , "bleachbit" }, { "cleaning" , "bleachbit" },
{ "powertop" , terminal .. " -e sudo powertop " }, { "powertop" , terminal .. " -e sudo powertop " },
{ "task manager" , tasks }
} }
mymainmenu = awful.menu({ items = { mymainmenu = awful.menu({ items = {
{ "accessories" , myaccessories }, { "accessories" , myaccessories },
{ "graphics" , mygraphics },
{ "internet" , myinternet }, { "internet" , myinternet },
{ "office" , myoffice }, { "office" , myoffice },
{ "system" , mysystem }, { "system" , mysystem },
@ -814,39 +805,43 @@ clientkeys = awful.util.table.join(
c.maximized_vertical = not c.maximized_vertical c.maximized_vertical = not c.maximized_vertical
end) 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. -- Bind all key numbers to tags.
-- Be careful: we use keycodes to make it works on any keyboard layout. -- 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. -- This should map on the top row of your keyboard, usually 1 to 9.
for i = 1, 9 do for i = 1, keynumber do
globalkeys = awful.util.table.join(globalkeys, globalkeys = awful.util.table.join(globalkeys,
awful.key({ modkey }, "#" .. i + 9, awful.key({ modkey }, "#" .. i + 9,
function () function ()
local screen = mouse.screen screen = mouse.screen
local tag = awful.tag.gettags(screen)[i] if tags[screen][i] then
if tags then awful.tag.viewonly(tags[screen][i])
awful.tag.viewonly(tags)
end end
end), end),
awful.key({ modkey, "Control" }, "#" .. i + 9, awful.key({ modkey, "Control" }, "#" .. i + 9,
function () function ()
local screen = mouse.screen screen = mouse.screen
local tag = awful.tag.gettags(screen)[i] if tags[screen][i] then
if tags then awful.tag.viewtoggle(tags[screen][i])
awful.tag.viewtoggle(tags) end
end
end), end),
awful.key({ modkey, "Shift" }, "#" .. i + 9, awful.key({ modkey, "Shift" }, "#" .. i + 9,
function () function ()
local tag = awful.tag.gettags(client.focus.screen)[i] if client.focus and tags[client.focus.screen][i] then
if client.focus and tag then awful.client.movetotag(tags[client.focus.screen][i])
awful.client.movetotag(tag)
end end
end), end),
awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9, awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9,
function () function ()
local tag = awful.tag.gettags(client.focus.screen)[i] if client.focus and tags[client.focus.screen][i] then
if client.focus and tag then awful.client.toggletag(tags[client.focus.screen][i])
awful.client.movetotag(tag)
end end
end)) end))
end end