From 5a862dc4833fee9676263244a029f29cd9a78d8d Mon Sep 17 00:00:00 2001 From: Pierre Habouzit Date: Mon, 1 Jun 2009 15:00:02 +0200 Subject: [PATCH] Migrate awesome to the new stuff. Signed-off-by: Pierre Habouzit --- config/awesome/rc.lua | 146 ++++++++++++++++++++-------------------- config/awesome/theme | 150 +++++++++++++++++++++++++----------------- 2 files changed, 159 insertions(+), 137 deletions(-) diff --git a/config/awesome/rc.lua b/config/awesome/rc.lua index 7f42ed3..9e622cb 100644 --- a/config/awesome/rc.lua +++ b/config/awesome/rc.lua @@ -6,12 +6,6 @@ require("eminent") require("wicked") require("beautiful") -function table.append(t, ...) - for _, v in ipairs({...}) do - table.insert(t, v) - end -end - terminal = "x-terminal-emulator" lock = 'xscreensaver-command -lock' beautiful.init(awful.util.getdir("config").."/theme") @@ -78,10 +72,10 @@ end -- {{{ Taglist maintaglist = {} -maintaglist.buttons = { - button(k_n, 1, awful.tag.viewonly), - button(k_s, 1, awful.client.toggletag) -} +maintaglist.buttons = awful.util.table.join( + awful.button(k_n, 1, awful.tag.viewonly), + awful.button(k_s, 1, awful.client.toggletag) +) -- }}} -- {{{ Widgets @@ -265,30 +259,30 @@ end ---- {{{ Global keys local hist = os.getenv("HOME") .. "/.cache/awesome/history" -globalkeys = { +globalkeys = awful.util.table.join( -- Mod+{A/S}: Switch to prev/next tag - key(k_m, "Left", eminent.tag.prev), - key(k_m, "Right", eminent.tag.next), + awful.key(k_m, "Left", eminent.tag.prev), + awful.key(k_m, "Right", eminent.tag.next), -- Mod+Shift+{A/S}: Move window to Prev/Next tag - key(k_ms, "Left", function() + awful.key(k_ms, "Left", function() awful.client.movetotag(eminent.tag.getprev()) eminent.tag.prev() end), - key(k_ms, "Right", function() + awful.key(k_ms, "Right", function() awful.client.movetotag(eminent.tag.getnext()) eminent.tag.next() end), -- Mod+Shift_{E/D}: move window to next/prev screen - key(k_mc, "Right", function() + awful.key(k_mc, "Right", function() local s = getscreen() + 1 while s > screen.count() do s = s-screen.count() end client_movetoscreen(s) end), - key(k_mc, "Left", function() + awful.key(k_mc, "Left", function() local s = getscreen() - 1 while s < 1 do s = s+screen.count() @@ -298,42 +292,42 @@ globalkeys = { -- Focus Prev/Next window - key(k_m, "j", + awful.key(k_m, "j", function () awful.client.focus.byidx(1) if client.focus then client.focus:raise() end end), - key(k_m, "k", + awful.key(k_m, "k", function () awful.client.focus.byidx(-1) if client.focus then client.focus:raise() end end), -- Swap window with the Prev/Next one - key(k_ms, "j", function () awful.client.swap.byidx(1) end), - key(k_ms, "k", function () awful.client.swap.byidx(-1) end), + awful.key(k_ms, "j", function () awful.client.swap.byidx(1) end), + awful.key(k_ms, "k", function () awful.client.swap.byidx(-1) end), -- Mod+{E/D}: Switch to next/previous screen - key(k_m, "Tab", function () awful.screen.focus(1) end), - key(k_ms, "Tab", function () awful.screen.focus(-1) end), + awful.key(k_m, "Tab", function () awful.screen.focus(1) end), + awful.key(k_ms, "Tab", function () awful.screen.focus(-1) end), -- Mod+Enter: Launch a new terminal - key(k_m, "e", function() awful.util.spawn("firefox") end), - key(k_m, "Return", function() awful.util.spawn(terminal) end), - key(k_ac, "r", awesome.restart), - key(k_m, "F12", function() awful.util.spawn(lock) end), - key({}, "#148", function() awful.util.spawn("kcalc") end), + awful.key(k_m, "e", function() awful.util.spawn("firefox") end), + awful.key(k_m, "Return", function() awful.util.spawn(terminal) end), + awful.key(k_ac, "r", awesome.restart), + awful.key(k_m, "F12", function() awful.util.spawn(lock) end), + awful.key({}, "#148", function() awful.util.spawn("kcalc") end), -- Layout manipulation - key(k_m, "l", function () awful.tag.incmwfact(0.05) end), - key(k_m, "h", function () awful.tag.incmwfact(-0.05) end), - key(k_ms, "h", function () awful.tag.incnmaster(1) end), - key(k_ms, "l", function () awful.tag.incnmaster(-1) end), - key(k_mc, "h", function () awful.tag.incncol(1) end), - key(k_mc, "l", function () awful.tag.incncol(-1) end), + awful.key(k_m, "l", function () awful.tag.incmwfact(0.05) end), + awful.key(k_m, "h", function () awful.tag.incmwfact(-0.05) end), + awful.key(k_ms, "h", function () awful.tag.incnmaster(1) end), + awful.key(k_ms, "l", function () awful.tag.incnmaster(-1) end), + awful.key(k_mc, "h", function () awful.tag.incncol(1) end), + awful.key(k_mc, "l", function () awful.tag.incncol(-1) end), -- Menu - key(k_m, "r", + awful.key(k_m, "r", function () awful.prompt.run({ prompt = "Run: " }, mymenubox, @@ -341,7 +335,7 @@ globalkeys = { awful.completion.bash, awful.util.getdir("cache").."/commands") end), - key(k_m, "F4", + awful.key(k_m, "F4", function () awful.prompt.run({ prompt = "Run Lua code: " }, mymenubox, @@ -350,12 +344,12 @@ globalkeys = { awful.util.getdir("cache").."/lua_commands") end), - key({}, "#192", function() eminent.tag.goto(1, nil, true) end), - key({}, "#193", function() eminent.tag.goto(2, nil, true) end), - key({}, "#194", function() eminent.tag.goto(3, nil, true) end), - key({}, "#195", function() eminent.tag.goto(4, nil, true) end), - key({}, "#196", function() eminent.tag.goto(5, nil, true) end), -} + awful.key({}, "#192", function() eminent.tag.goto(1, nil, true) end), + awful.key({}, "#193", function() eminent.tag.goto(2, nil, true) end), + awful.key({}, "#194", function() eminent.tag.goto(3, nil, true) end), + awful.key({}, "#195", function() eminent.tag.goto(4, nil, true) end), + awful.key({}, "#196", function() eminent.tag.goto(5, nil, true) end) +) -- Mod+#: Switch to tag -- Mod+Shift+#: Toggle tag display @@ -363,30 +357,31 @@ globalkeys = { -- Mod+Alt+#: Toggle client on tag for i = 1, 10 do - table.append(globalkeys, - key(k_m, i % 10, - function() - eminent.tag.goto(i, nil, true) - end), - - key(k_ms, i % 10, - function () - local t = eminent.tag.getn(i, nil, true) - if t ~= nil then t.selected = not t.selected end - end), - key(k_mc, i % 10, - function () - local t = eminent.tag.getn(i, nil, true) - if t ~= nil then awful.client.movetotag(t) end - end) - ) + globalkeys = awful.util.table.join( + globalkeys, + awful.key(k_m, i % 10, + function() + eminent.tag.goto(i, nil, true) + end), + + awful.key(k_ms, i % 10, + function () + local t = eminent.tag.getn(i, nil, true) + if t ~= nil then t.selected = not t.selected end + end), + awful.key(k_mc, i % 10, + function () + local t = eminent.tag.getn(i, nil, true) + if t ~= nil then awful.client.movetotag(t) end + end) + ) end ---- }}} ---- {{{ Client hotkeys -clientkeys = { - key(k_m, "i", function (c) +clientkeys = awful.util.table.join( + awful.key(k_m, "i", function (c) if mymenubox.text then mymenubox.text = "" else @@ -395,11 +390,11 @@ clientkeys = { end), -- Client manipulation - key(k_m, "c", function (c) c:kill() end), - key(k_m, "o", awful.client.floating.toggle), - key(k_m, "t", awful.client.togglemarked), - key(k_m, "F11", function (c) c.fullscreen = not c.fullscreen end) -} + awful.key(k_m, "c", function (c) c:kill() end), + awful.key(k_m, "o", awful.client.floating.toggle), + awful.key(k_m, "t", awful.client.togglemarked), + awful.key(k_m, "F11", function (c) c.fullscreen = not c.fullscreen end) +) ---- }}} @@ -439,20 +434,21 @@ awful.hooks.manage.register(function (c, startup) end -- Add mouse bindings - c:buttons{ - button({ }, 1, function (c) client.focus = c; c:raise() end), - button(k_a, 1, awful.mouse.client.move), - button(k_a, 3, awful.mouse.client.resize) - } + c:buttons(awful.util.table.join( + awful.button({ }, 1, function (c) client.focus = c; c:raise() end), + awful.button(k_a, 1, awful.mouse.client.move), + awful.button(k_a, 3, awful.mouse.client.resize) + )) -- Create border c.border_width = beautiful.border_width c.border_color = beautiful.border_normal -- Make certain windows floating - local name = c.name:lower() - if name:find('pinentry') - or name:find('kcalc') + local class = c.class:lower() + if class:find('pinentry') + or class:find('kcalc') + or class:find('gajim') then c.floating = true end @@ -484,4 +480,4 @@ end) -- }}} -awful.util.spawn("xkbcomp -w 0 -R/usr/share/X11/xkb ~/.Xkeyboard :0") +awful.util.spawn("xkbcomp -w 0 -R/usr/share/X11/xkb /home/madcoder/.Xkeyboard :0") diff --git a/config/awesome/theme b/config/awesome/theme index 239c192..78c6b80 100644 --- a/config/awesome/theme +++ b/config/awesome/theme @@ -2,65 +2,91 @@ -- Default awesome theme -- --------------------------- -font = Terminus 8 - -bg_normal = #222222 -bg_focus = #285577 -bg_urgent = #a10000 -bg_minimize = #444444 - -fg_normal = #888888 -fg_focus = #ffffff -fg_urgent = #ffffff -fg_minimize = #ffffff - -border_width = 1 -border_normal = #333333 -border_focus = #4c7899 -border_marked = #91231c - -# There are another variables sets -# overriding the default one when -# defined, the sets are: -# [taglist|tasklist]_[bg|fg]_[focus|urgent] -# titlebar_[bg|fg]_[normal|focus] -# Example: -#taglist_bg_focus = #ff0000 - -# Display the taglist squares -taglist_squares_sel = /usr/share/awesome/themes/default/taglist/squarefw.png -taglist_squares_unsel = /usr/share/awesome/themes/default/taglist/squarew.png - -tasklist_floating_icon = /usr/share/awesome/themes/default/tasklist/floatingw.png - -# Variables set for theming menu -# menu_[bg|fg]_[normal|focus] -# menu_[border_color|border_width] -menu_submenu_icon = /usr/share/awesome/themes/default/submenu.png -menu_height = 15 -menu_width = 100 - -# You can add as many variables as -# you wish and access them by using -# beautiful.variable in your rc.lua -#bg_widget = #cc0000 - -# Define the image to load -titlebar_close_button_normal = /usr/share/awesome/themes/default/titlebar/close.png -titlebar_close_button_focus = /usr/share/awesome/themes/default/titlebar/closer.png - -# You can use your own command to set your wallpaper -wallpaper_cmd = awsetbg /usr/share/awesome/themes/default/background.png - -# You can use your own layout icons like this: -layout_fairh = /usr/share/awesome/themes/default/layouts/fairhw.png -layout_fairv = /usr/share/awesome/themes/default/layouts/fairvw.png -layout_floating = /usr/share/awesome/themes/default/layouts/floatingw.png -layout_magnifier = /usr/share/awesome/themes/default/layouts/magnifierw.png -layout_max = /usr/share/awesome/themes/default/layouts/maxw.png -layout_tilebottom = /usr/share/awesome/themes/default/layouts/tilebottomw.png -layout_tileleft = /usr/share/awesome/themes/default/layouts/tileleftw.png -layout_tile = /usr/share/awesome/themes/default/layouts/tilew.png -layout_tiletop = /usr/share/awesome/themes/default/layouts/tiletopw.png - -awesome_icon = /usr/share/awesome/icons/awesome16.png +theme = {} + +theme.font = "Terminus 8" + +theme.bg_normal = "#222222" +theme.bg_focus = "#285577" +theme.bg_urgent = "#a10000" +theme.bg_minimize = "#444444" + +theme.fg_normal = "#888888" +theme.fg_focus = "#ffffff" +theme.fg_urgent = "#ffffff" +theme.fg_minimize = "#ffffff" + +theme.border_width = 1 +theme.border_normal = "#333333" +theme.border_focus = "#4c7899" +theme.border_marked = "#91231c" + +-- There are another variables sets +-- overriding the default one when +-- defined, the sets are: +-- [taglist|tasklist]_[bg|fg]_[focus|urgent] +-- titlebar_[bg|fg]_[normal|focus] +-- Example: +--taglist_bg_focus = #ff0000 + +-- Display the taglist squares +theme.taglist_squares_sel = "/usr/share/awesome/themes/default/taglist/squarefw.png" +theme.taglist_squares_unsel = "/usr/share/awesome/themes/default/taglist/squarew.png" + +theme.tasklist_floating_icon = "/usr/share/awesome/themes/default/tasklist/floatingw.png" + +-- Variables set for theming menu +-- menu_[bg|fg]_[normal|focus] +-- menu_[border_color|border_width] +theme.menu_submenu_icon = "/usr/share/awesome/themes/default/submenu.png" +theme.menu_height = "15" +theme.menu_width = "100" + +-- You can add as many variables as +-- you wish and access them by using +-- beautiful.variable in your rc.lua +--bg_widget = #cc0000 + +-- Define the image to load +theme.titlebar_close_button_normal = "/usr/share/awesome/themes/default/titlebar/close_normal.png" +theme.titlebar_close_button_focus = "/usr/share/awesome/themes/default/titlebar/close_focus.png" + +theme.titlebar_ontop_button_normal_inactive = "/usr/share/awesome/themes/default/titlebar/ontop_normal_inactive.png" +theme.titlebar_ontop_button_focus_inactive = "/usr/share/awesome/themes/default/titlebar/ontop_focus_inactive.png" +theme.titlebar_ontop_button_normal_active = "/usr/share/awesome/themes/default/titlebar/ontop_normal_active.png" +theme.titlebar_ontop_button_focus_active = "/usr/share/awesome/themes/default/titlebar/ontop_focus_active.png" + +theme.titlebar_sticky_button_normal_inactive = "/usr/share/awesome/themes/default/titlebar/sticky_normal_inactive.png" +theme.titlebar_sticky_button_focus_inactive = "/usr/share/awesome/themes/default/titlebar/sticky_focus_inactive.png" +theme.titlebar_sticky_button_normal_active = "/usr/share/awesome/themes/default/titlebar/sticky_normal_active.png" +theme.titlebar_sticky_button_focus_active = "/usr/share/awesome/themes/default/titlebar/sticky_focus_active.png" + +theme.titlebar_floating_button_normal_inactive = "/usr/share/awesome/themes/default/titlebar/floating_normal_inactive.png" +theme.titlebar_floating_button_focus_inactive = "/usr/share/awesome/themes/default/titlebar/floating_focus_inactive.png" +theme.titlebar_floating_button_normal_active = "/usr/share/awesome/themes/default/titlebar/floating_normal_active.png" +theme.titlebar_floating_button_focus_active = "/usr/share/awesome/themes/default/titlebar/floating_focus_active.png" + +theme.titlebar_maximized_button_normal_inactive = "/usr/share/awesome/themes/default/titlebar/maximized_normal_inactive.png" +theme.titlebar_maximized_button_focus_inactive = "/usr/share/awesome/themes/default/titlebar/maximized_focus_inactive.png" +theme.titlebar_maximized_button_normal_active = "/usr/share/awesome/themes/default/titlebar/maximized_normal_active.png" +theme.titlebar_maximized_button_focus_active = "/usr/share/awesome/themes/default/titlebar/maximized_focus_active.png" + +-- You can use your own command to set your wallpaper +theme.wallpaper_cmd = { "awsetbg /usr/share/awesome/themes/default/background.png" } + +-- You can use your own layout icons like this: +theme.layout_fairh = "/usr/share/awesome/themes/default/layouts/fairhw.png" +theme.layout_fairv = "/usr/share/awesome/themes/default/layouts/fairvw.png" +theme.layout_floating = "/usr/share/awesome/themes/default/layouts/floatingw.png" +theme.layout_magnifier = "/usr/share/awesome/themes/default/layouts/magnifierw.png" +theme.layout_max = "/usr/share/awesome/themes/default/layouts/maxw.png" +theme.layout_fullscreen = "/usr/share/awesome/themes/default/layouts/fullscreenw.png" +theme.layout_tilebottom = "/usr/share/awesome/themes/default/layouts/tilebottomw.png" +theme.layout_tileleft = "/usr/share/awesome/themes/default/layouts/tileleftw.png" +theme.layout_tile = "/usr/share/awesome/themes/default/layouts/tilew.png" +theme.layout_tiletop = "/usr/share/awesome/themes/default/layouts/tiletopw.png" + +theme.awesome_icon = "/usr/share/awesome/icons/awesome16.png" + +return theme +-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80 -- 2.20.1