From fb5bfecc9a6d8aad859598a8f8a6cbe504e07e7d Mon Sep 17 00:00:00 2001 From: crater2150 Date: Fri, 25 Dec 2009 19:18:10 +0100 Subject: [PATCH 01/36] mpdprompt removed --- rc.lua | 2 -- 1 file changed, 2 deletions(-) diff --git a/rc.lua b/rc.lua index 860ccff..7363513 100644 --- a/rc.lua +++ b/rc.lua @@ -7,7 +7,6 @@ require("beautiful") -- Notification library require("naughty") require("teardrop") -require("mpdprompt") require("obvious.battery") require("obvious.popup_run_prompt") require("vicious") @@ -226,7 +225,6 @@ globalkeys = awful.util.table.join( -- Audio control awful.key({ modkey }, "F9", function () teardrop("sakura -e alsamixer","top","center", 0.99, 0.4)end ), - awful.key({ modkey }, "F1", function () mpdprompt("top","center")end ), awful.key({ }, "XF86AudioLowerVolume", function () awful.util.spawn("amixer set Front 2dB-")end ), awful.key({ }, "XF86AudioRaiseVolume", function () awful.util.spawn("amixer set Front 2dB+")end ), awful.key({ }, "XF86AudioMute", function () awful.util.spawn("amixer set Front toggle") end), From ac274fdcebb0001bf32455d99699d30ec77c4266 Mon Sep 17 00:00:00 2001 From: crater2150 Date: Wed, 30 Dec 2009 13:16:21 +0100 Subject: [PATCH 02/36] theme colors changed --- wallpaper | 2 +- zenburn/theme.lua | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/wallpaper b/wallpaper index ecc768a..37ccf68 120000 --- a/wallpaper +++ b/wallpaper @@ -1 +1 @@ -/home/crater2150/gfx/wall/dragon.jpg \ No newline at end of file +/home/crater2150/gfx/wall/Julia-Quaternion-points-large.jpg \ No newline at end of file diff --git a/zenburn/theme.lua b/zenburn/theme.lua index 6c8e33a..756d611 100644 --- a/zenburn/theme.lua +++ b/zenburn/theme.lua @@ -15,18 +15,18 @@ theme.wallpaper_cmd = { "awsetbg -a /home/crater2150/.config/awesome/wallpaper" theme.font = "sans 8" -- {{{ Colors -theme.fg_normal = "#DCDCCC" -theme.fg_focus = "#F0DFAF" -theme.fg_urgent = "#CC9393" -theme.bg_normal = "#3F3F3F" -theme.bg_focus = "#1E2320" -theme.bg_urgent = "#3F3F3F" +theme.fg_normal = "#8888FF" +theme.fg_focus = "#000000" +theme.fg_urgent = "#FF0000" +theme.bg_normal = "#000000" +theme.bg_focus = "#8888FF" +theme.bg_urgent = "#880000" -- }}} -- {{{ Borders theme.border_width = "2" -theme.border_normal = "#3F3F3F" -theme.border_focus = "#6F6F6F" +theme.border_normal = "#DDDDFF" +theme.border_focus = "#8888FF" theme.border_marked = "#CC9393" -- }}} @@ -83,12 +83,12 @@ theme.tasklist_floating_icon = "/usr/share/awesome/themes/default/tasklist/float -- }}} -- {{{ Layout -theme.layout_tile = "/usr/share/awesome/themes/zenburn/layouts/tile.png" -theme.layout_tileleft = "/usr/share/awesome/themes/zenburn/layouts/tileleft.png" -theme.layout_tilebottom = "/usr/share/awesome/themes/zenburn/layouts/tilebottom.png" -theme.layout_tiletop = "/usr/share/awesome/themes/zenburn/layouts/tiletop.png" -theme.layout_fairv = "/usr/share/awesome/themes/zenburn/layouts/fairv.png" -theme.layout_fairh = "/usr/share/awesome/themes/zenburn/layouts/fairh.png" +theme.layout_tile = "/usr/share/awesome/themes/zenburn/layouts/tilebottom.png" +theme.layout_tileleft = "/usr/share/awesome/themes/zenburn/layouts/tiletop.png" +theme.layout_tilebottom = "/usr/share/awesome/themes/zenburn/layouts/tileleft.png" +theme.layout_tiletop = "/usr/share/awesome/themes/zenburn/layouts/tile.png" +theme.layout_fairv = "/usr/share/awesome/themes/zenburn/layouts/fairh.png" +theme.layout_fairh = "/usr/share/awesome/themes/zenburn/layouts/fairv.png" theme.layout_spiral = "/usr/share/awesome/themes/zenburn/layouts/spiral.png" theme.layout_dwindle = "/usr/share/awesome/themes/zenburn/layouts/dwindle.png" theme.layout_max = "/usr/share/awesome/themes/zenburn/layouts/max.png" From fca83981efb3ba52b06796c2080febf77d67fc9f Mon Sep 17 00:00:00 2001 From: crater2150 Date: Tue, 5 Jan 2010 15:55:08 +0100 Subject: [PATCH 03/36] added rule for gmpc --- rc.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rc.lua b/rc.lua index 7363513..3e9adfd 100644 --- a/rc.lua +++ b/rc.lua @@ -343,6 +343,8 @@ awful.rules.rules = { properties = { tag = tags[1][4] } }, { rule = { class = "Sunbird-bin" }, properties = { tag = tags[1][5] } }, + { rule = { class = "Gmpc" }, + properties = { tag = tags[1][6] } }, } -- }}} From 663252ead63f08ed5f7697e0256e767ef0bb7e66 Mon Sep 17 00:00:00 2001 From: crater2150 Date: Tue, 5 Jan 2010 16:50:52 +0100 Subject: [PATCH 04/36] now even more awesome with 22 tags --- rc.lua | 46 +++++++++++++++++++++++++++++++++------------- 1 file changed, 33 insertions(+), 13 deletions(-) diff --git a/rc.lua b/rc.lua index 3e9adfd..ae7ac68 100644 --- a/rc.lua +++ b/rc.lua @@ -50,9 +50,22 @@ tags.setup = { { name = "4:✉", layout = layouts[7] }, { name = "5:☑", layout = layouts[7] }, { name = "6:♫", layout = layouts[1] }, - { name = "7:☣", layout = layouts[1] }, - { name = "8:☕", layout = layouts[1] }, - { name = "9:⚂", layout = layouts[1] } + { name = "7:☣", layout = layouts[1] }, + { name = "8:☕", layout = layouts[1] }, + { name = "9:⚂", layout = layouts[1] }, + { name = "0:☠", layout = layouts[1] }, + { name = "F1:☭", layout = layouts[1] }, + { name = "F2:♚", layout = layouts[1] }, + { name = "F3:♛", layout = layouts[1] }, + { name = "F4:♜", layout = layouts[1] }, + { name = "F5:♝", layout = layouts[1] }, + { name = "F6:♞", layout = layouts[1] }, + { name = "F7:♟", layout = layouts[1] }, + { name = "F8:⚖", layout = layouts[1] }, + { name = "F9:⚛", layout = layouts[1] }, + { name = "F10:⚡", layout = layouts[1] }, + { name = "F11:⚰", layout = layouts[1] }, + { name = "F12:⚙", layout = layouts[1] } } for s = 1, screen.count() do @@ -140,14 +153,13 @@ for s = 1, screen.count() do leftwibox[s].widgets = { mytaglist[s], mylayoutbox[s], - clock, - separator, spacer, batwidget, spacer, layout = awful.widget.layout.horizontal.rightleft } rightwibox[s].widgets = { { - memwidget, + clock, + separator, spacer, memwidget, separator, spacer, batwidget, separator, spacer, wlanwidget, separator, spacer, cpulabel, cpuwidget, @@ -224,7 +236,7 @@ globalkeys = awful.util.table.join( awful.key({ modkey, "Shift" }, "q", awesome.quit), -- Audio control - awful.key({ modkey }, "F9", function () teardrop("sakura -e alsamixer","top","center", 0.99, 0.4)end ), + awful.key({ }, "Print", function () teardrop("sakura -e alsamixer","top","center", 0.99, 0.4)end ), awful.key({ }, "XF86AudioLowerVolume", function () awful.util.spawn("amixer set Front 2dB-")end ), awful.key({ }, "XF86AudioRaiseVolume", function () awful.util.spawn("amixer set Front 2dB+")end ), awful.key({ }, "XF86AudioMute", function () awful.util.spawn("amixer set Front toggle") end), @@ -258,7 +270,7 @@ globalkeys = awful.util.table.join( ) clientkeys = awful.util.table.join( - awful.key({ modkey, }, "F11", function (c) c.fullscreen = not c.fullscreen end), + awful.key({ modkey, "Shift" }, "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), @@ -270,35 +282,43 @@ clientkeys = awful.util.table.join( -- 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)); + keynumber = math.min(22, 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. +-- FKeys: 67-78 for i = 1, keynumber do + if i < 10 then + k = "#" .. i + 9 + elseif i == 10 then + k = "#19" + elseif i > 10 then + k = "F" .. i - 10 + end globalkeys = awful.util.table.join(globalkeys, - awful.key({ modkey }, "#" .. i + 9, + awful.key({ modkey }, k, function () local screen = mouse.screen if tags[screen][i] then awful.tag.viewonly(tags[screen][i]) end end), - awful.key({ modkey, "Control" }, "#" .. i + 9, + awful.key({ modkey, "Control" }, k, function () local screen = mouse.screen if tags[screen][i] then awful.tag.viewtoggle(tags[screen][i]) end end), - awful.key({ modkey, "Shift" }, "#" .. i + 9, + awful.key({ modkey, "Shift" }, k, 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, + awful.key({ modkey, "Control", "Shift" }, k, function () if client.focus and tags[client.focus.screen][i] then awful.client.toggletag(tags[client.focus.screen][i]) From 3dfc4517ffb4926827ed74955d5f870f2baa8ad9 Mon Sep 17 00:00:00 2001 From: crater2150 Date: Sat, 9 Jan 2010 01:39:41 +0100 Subject: [PATCH 05/36] no more wallpaper tracking --- wallpaper | 1 - 1 file changed, 1 deletion(-) delete mode 120000 wallpaper diff --git a/wallpaper b/wallpaper deleted file mode 120000 index 37ccf68..0000000 --- a/wallpaper +++ /dev/null @@ -1 +0,0 @@ -/home/crater2150/gfx/wall/Julia-Quaternion-points-large.jpg \ No newline at end of file From 0b8719c6bdad9f26df07461bba8dcd42ca2a62f8 Mon Sep 17 00:00:00 2001 From: crater2150 Date: Sat, 9 Jan 2010 01:51:12 +0100 Subject: [PATCH 06/36] deluge tagged, Mod+A makes window sticky --- rc.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rc.lua b/rc.lua index ae7ac68..58f2268 100644 --- a/rc.lua +++ b/rc.lua @@ -46,7 +46,7 @@ local tags = {} tags.setup = { { name = "1:⚙", layout = layouts[1] }, { name = "2:⌘", layout = layouts[7] }, - { name = "3:☻", layout = layouts[2], mwfact = 0.20 }, + { name = "3:☻", layout = layouts[2], mwfact = 0.80 }, { name = "4:✉", layout = layouts[7] }, { name = "5:☑", layout = layouts[7] }, { name = "6:♫", layout = layouts[1] }, @@ -275,6 +275,7 @@ clientkeys = awful.util.table.join( 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", function (c) c.ontop = not c.ontop end), + awful.key({ modkey, }, "a", function (c) c.sticky = not c.sticky end), awful.key({ modkey, "Shift" }, "r", function (c) c:redraw() end), awful.key({ modkey, }, "n", function (c) c.minimized = not c.minimized end) ) @@ -365,6 +366,10 @@ awful.rules.rules = { properties = { tag = tags[1][5] } }, { rule = { class = "Gmpc" }, properties = { tag = tags[1][6] } }, + { rule = { class = "Deluge" }, + properties = { tag = tags[1][7] } }, + { rule = { class = "Xhtop" }, + properties = { tag = tags[1][22] } }, } -- }}} From 3a29d096f2b808d7715d4e20ad2defd7d6bfb6e2 Mon Sep 17 00:00:00 2001 From: crater2150 Date: Thu, 21 Jan 2010 16:22:51 +0100 Subject: [PATCH 07/36] update --- rc.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rc.lua b/rc.lua index 58f2268..022e898 100644 --- a/rc.lua +++ b/rc.lua @@ -349,6 +349,9 @@ awful.rules.rules = { { rule = { class = "MPlayer" }, properties = { floating = true, size_hints_honor = true } }, + { rule = { class = "DockApp" }, + properties = { floating = true, + size_hints_honor = true } }, { rule = { class = "pinentry" }, properties = { floating = true } }, { rule = { class = "gimp" }, From 177ebbd9a1f36d0ca9e7aaed5bd1a9cdc2fbb7e2 Mon Sep 17 00:00:00 2001 From: crater2150 Date: Thu, 21 Jan 2010 17:12:04 +0100 Subject: [PATCH 08/36] passprompt rule --- rc.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rc.lua b/rc.lua index 022e898..6090171 100644 --- a/rc.lua +++ b/rc.lua @@ -349,6 +349,10 @@ awful.rules.rules = { { rule = { class = "MPlayer" }, properties = { floating = true, size_hints_honor = true } }, + { rule = { class = "Passprompt" }, + properties = { floating = true, + ontop = true, + focus = true } }, { rule = { class = "DockApp" }, properties = { floating = true, size_hints_honor = true } }, From 201c71e0042aa336d59d251e58879fb7602f83c6 Mon Sep 17 00:00:00 2001 From: crater2150 Date: Thu, 4 Feb 2010 14:59:20 +0100 Subject: [PATCH 09/36] switched from slock to urslock --- rc.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc.lua b/rc.lua index 6090171..38fd346 100644 --- a/rc.lua +++ b/rc.lua @@ -231,7 +231,7 @@ globalkeys = awful.util.table.join( awful.key({ modkey, }, "s", function () awful.util.spawn("sunbird") end), awful.key({ modkey, }, "g", function () awful.util.spawn("gmpc") end), awful.key({ }, "XF86Mail", function () awful.util.spawn("xset dpms force off") end), - awful.key({ modkey }, "XF86Mail", function () awful.util.spawn("slock") end), + awful.key({ modkey }, "XF86Mail", function () awful.util.spawn("urslock") end), awful.key({ modkey, "Control" }, "r", awesome.restart), awful.key({ modkey, "Shift" }, "q", awesome.quit), From 028d866eb5ed9e732eb40044527fa92c8063363a Mon Sep 17 00:00:00 2001 From: crater2150 Date: Sun, 7 Mar 2010 02:19:25 +0100 Subject: [PATCH 10/36] cleanup --- back.rc.lua | 469 --------------------------- gitrc.lua | 437 ------------------------- json.lua | 515 ------------------------------ rc.lua | 70 +++- scratchpad.lua | 136 -------- theme.lua | 142 --------- wicked.lua | 848 ------------------------------------------------- 7 files changed, 63 insertions(+), 2554 deletions(-) delete mode 100644 back.rc.lua delete mode 100644 gitrc.lua delete mode 100644 json.lua delete mode 100644 scratchpad.lua delete mode 100644 theme.lua delete mode 100644 wicked.lua diff --git a/back.rc.lua b/back.rc.lua deleted file mode 100644 index 04074d2..0000000 --- a/back.rc.lua +++ /dev/null @@ -1,469 +0,0 @@ --- Standard awesome library -require("awful") --- Theme handling library -require("beautiful") --- Notification library -require("naughty") - --- Load Debian menu entries -require("debian.menu") - --- {{{ Variable definitions --- Themes define colours, icons, and wallpapers --- The default is a dark theme -theme_path = "/home/jack/.config/awesome/theme.lua" --- Uncommment this for a lighter theme --- theme_path = "/usr/share/awesome/themes/sky/theme.lua" - --- Actually load theme -beautiful.init(theme_path) - --- This is used later as the default terminal and editor to run. -terminal = "x-terminal-emulator" -editor = os.getenv("EDITOR") or "editor" -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.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.max, - awful.layout.suit.max.fullscreen, - awful.layout.suit.magnifier, - awful.layout.suit.floating -} - --- Table of clients that should be set floating. The index may be either --- the application class or instance. The instance is useful when running --- a console app in a terminal like (Music on Console) --- x-terminal-emulator -name mocp -e mocp -floatapps = -{ - -- by class - ["MPlayer"] = true, - ["pinentry"] = true, - ["gimp"] = true, - -- by instance - ["mocp"] = true -} - --- Applications to be moved to a pre-defined tag by class or instance. --- Use the screen and tags indices. -apptags = -{ - -- ["Firefox"] = { screen = 1, tag = 2 }, - -- ["mocp"] = { screen = 2, tag = 4 }, -} - --- Define if we want to use titlebar on all applications. -use_titlebar = false --- }}} - --- {{{ Tags --- Define tags table. -tags = {} -tags.setup = { - { name = "terms" }, - { name = "web" }, - { name = "music" }, - { name = "dls" }, - { name = "files" }, - { name = "images" }, - { name = "videos" }, - { name = "exps" }, - { name = "other" }, - { name = "nil" } -} -for s = 1, screen.count() do - tags[s] = {} - for i, t in ipairs(tags.setup) do - tags[s][i] = tag({ name = t.name }) - tags[s][i].screen = s - awful.layout.set(layouts[1], tags[s][i]) - end - tags[s][1].selected = true -end ---local tags = {} --- tags.setup = { --- { name = "term", layout = layouts[3] }, - -- { name = "emacs", layout = layouts[1] }, - -- { name = "web", layout = layouts[1] }, - --{ name = "mail", layout = layouts[5] }, - --{ name = "im", layout = layouts[1], mwfact = 0.13 }, - -- { name = "6", layout = layouts[7], hide = true }, - -- { name = "7", layout = layouts[7], hide = true }, - -- { name = "rss", layout = layouts[6] }, - -- { name = "media", layout = layouts[7] } --- } - --- for s = 1, screen.count() do --- tags[s] = {} - -- for i, t in ipairs(tags.setup) do - -- tags[s][i] = tag({ name = t.name }) --- tags[s][i].screen = s --- awful.tag.setproperty(tags[s][i], "layout", t.layout) - -- awful.tag.setproperty(tags[s][i], "mwfact", t.mwfact) - -- awful.tag.setproperty(tags[s][i], "hide", t.hide) - -- end - -- tags[s][1].selected = true --- end - --- }}} - --- {{{ Wibox --- Create a textbox widget -mytextbox = widget({ type = "textbox", align = "right" }) --- Set the default text in textbox -mytextbox.text = " loading... " - --- 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.new({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon }, - { "open terminal", terminal }, - { "Debian", debian.menu.Debian_menu.Debian } - } - }) - -mylauncher = awful.widget.launcher({ image = image(beautiful.awesome_icon), - menu = mymainmenu }) - --- Create a systray -mysystray = widget({ type = "systray", align = "right" }) - --- 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, function (tag) tag.selected = not tag.selected end), - 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({ align = "left" }) - -- Create an imagebox widget which will contains an icon indicating which layout we're using. - -- We need one layoutbox per screen. - mylayoutbox[s] = widget({ type = "imagebox", align = "right" }) - 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] = wibox({ position = "top", fg = beautiful.fg_normal, bg = beautiful.bg_normal }) - -- Add widgets to the wibox - order matters - mywibox[s].widgets = { mylauncher, - mytaglist[s], - --mylayoutbox[s], - --mytasklist[s], - mypromptbox[s], - mytextbox, - s == 1 and mysystray or nil } - mywibox[s].screen = s -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, }, "comma", awful.tag.viewprev ), - awful.key({ modkey, }, "period", awful.tag.viewnext ), - awful.key({ modkey, }, "Escape", awful.tag.history.restore), - - awful.key({ modkey, }, "t", - function () - awful.client.focus.byidx( 1) - if client.focus then client.focus:raise() end - end), - awful.key({ modkey, }, "n", - function () - awful.client.focus.byidx(-1) - if client.focus then client.focus:raise() end - end), - awful.key({ modkey, }, "w", function () mymainmenu:show(true) end), - - -- Layout manipulation - awful.key({ modkey, "Shift" }, "t", function () awful.client.swap.byidx( 1) end), - awful.key({ modkey, "Shift" }, "n", function () awful.client.swap.byidx( -1) end), - awful.key({ modkey, "Control" }, "t", function () awful.screen.focus( 1) end), - awful.key({ modkey, "Control" }, "n", function () awful.screen.focus(-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, }, "s", 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" }, "s", function () awful.tag.incnmaster(-1) end), - awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1) end), - awful.key({ modkey, "Control" }, "s", 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 }, "apostrophe", 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) -) - --- Client awful tagging: this is useful to tag some clients and then do stuff like move to tag on them -clientkeys = awful.util.table.join( - awful.key({ modkey, }, "f", function (c) c.fullscreen = not c.fullscreen end), - awful.key({ modkey, }, "semicolon", 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 }, "w", awful.client.togglemarked), - 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 - -for i = 1, keynumber do - globalkeys = awful.util.table.join(globalkeys, - awful.key({ modkey }, i, - function () - local screen = mouse.screen - if tags[screen][i] then - awful.tag.viewonly(tags[screen][i]) - end - end), - awful.key({ modkey, "Control" }, i, - function () - local screen = mouse.screen - if tags[screen][i] then - tags[screen][i].selected = not tags[screen][i].selected - end - end), - awful.key({ modkey, "Shift" }, 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" }, i, - function () - if client.focus and tags[client.focus.screen][i] then - awful.client.toggletag(tags[client.focus.screen][i]) - end - end), - awful.key({ modkey, "Shift" }, "F" .. i, - function () - local screen = mouse.screen - if tags[screen][i] then - for k, c in pairs(awful.client.getmarked()) do - awful.client.movetotag(tags[screen][i], c) - end - end - end)) -end - --- Set keys -root.keys(globalkeys) --- }}} - --- {{{ Hooks --- Hook function to execute when focusing a client. -awful.hooks.focus.register(function (c) - if not awful.client.ismarked(c) then - c.border_color = beautiful.border_focus - end -end) - --- Hook function to execute when unfocusing a client. -awful.hooks.unfocus.register(function (c) - if not awful.client.ismarked(c) then - c.border_color = beautiful.border_normal - end -end) - --- Hook function to execute when marking a client -awful.hooks.marked.register(function (c) - c.border_color = beautiful.border_marked -end) - --- Hook function to execute when unmarking a client. -awful.hooks.unmarked.register(function (c) - c.border_color = beautiful.border_focus -end) - --- Hook function to execute when the mouse enters a client. -awful.hooks.mouse_enter.register(function (c) - -- Sloppy focus, but disabled for magnifier layout - if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier - and awful.client.focus.filter(c) then - client.focus = c - end -end) - --- Hook function to execute when a new client appears. -awful.hooks.manage.register(function (c, startup) - -- If we are not managing this application at startup, - -- move it to the screen where the mouse is. - -- We only do it for filtered windows (i.e. no dock, etc). - if not startup and awful.client.focus.filter(c) then - c.screen = mouse.screen - end - - if use_titlebar then - -- Add a titlebar - awful.titlebar.add(c, { modkey = modkey }) - end - -- Add mouse bindings - c:buttons(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) - )) - -- New client may not receive focus - -- if they're not focusable, so set border anyway. - c.border_width = beautiful.border_width - c.border_color = beautiful.border_normal - - -- Check if the application should be floating. - local cls = c.class - local inst = c.instance - if floatapps[cls] ~= nil then - awful.client.floating.set(c, floatapps[cls]) - elseif floatapps[inst] ~= nil then - awful.client.floating.set(c, floatapps[inst]) - end - - -- Check application->screen/tag mappings. - local target - if apptags[cls] then - target = apptags[cls] - elseif apptags[inst] then - target = apptags[inst] - end - if target then - c.screen = target.screen - awful.client.movetotag(tags[target.screen][target.tag], c) - end - c.size_hints_honor = false - -- Do this after tag mapping, so you don't see it on the wrong tag for a split second. - client.focus = c - - -- Set key bindings - c:keys(clientkeys) - - -- Set the windows at the slave, - -- i.e. put it at the end of others instead of setting it master. - -- awful.client.setslave(c) - - -- Honor size hints: if you want to drop the gaps between windows, set this to false. - -- c.size_hints_honor = false -end) - --- Hook function to execute when arranging the screen. --- (tag switch, new client, etc) -awful.hooks.arrange.register(function (screen) - local layout = awful.layout.getname(awful.layout.get(screen)) - if layout and beautiful["layout_" ..layout] then - mylayoutbox[screen].image = image(beautiful["layout_" .. layout]) - else - mylayoutbox[screen].image = nil - end - - -- Give focus to the latest client in history if no window has focus - -- or if the current window is a desktop or a dock one. - if not client.focus then - local c = awful.client.focus.history.get(screen, 0) - if c then client.focus = c end - end -end) - --- Hook called every minute -awful.hooks.timer.register(10, function () - awful.util.spawn("awst") -end) --- }}} diff --git a/gitrc.lua b/gitrc.lua deleted file mode 100644 index a699196..0000000 --- a/gitrc.lua +++ /dev/null @@ -1,437 +0,0 @@ ---### --- Standard awesome library -require("awful") --- Theme handling library -require("beautiful") --- Notification library -require("naughty") --- Dynamic tagging with shifty -require("lib/shifty") - --- Wicked -require("wicked") - --- {{{ Variable definitions --- Themes define colours, icons, and wallpapers --- Just link your theme to ~/.awesome_theme -theme_path = os.getenv("HOME") .. "/.config/awesome/theme.lua" - --- Actually load theme -beautiful.init(theme_path) - --- Default applications -terminal = "terminal" --- Editor to use -editor = "terminal -e vim" --- this is the default level when adding a todo note -todo_level = "high" --- Default modkey. l --- 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.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.max, - awful.layout.suit.max.fullscreen, - awful.layout.suit.floating -} - --- Table of clients that should be set floating. The index may be either --- the application class or instance. The instance is useful when running --- a console app in a terminal like (Music on Console) --- xterm -name mocp -e mocp -floatapps = -{ - -- by class - ["MPlayer"] = true, - ["Xmessage"] = true, - ["Wireshark"] = true, - ["XBoard"] = true, - ["feh"] = true, - ["nitrogen"] = true, - ["Wicd-client.py"] = true, - ["gimp"] = true, - ["XCalc"] = true, - ["display"] = true, - ["Preferences"] = true, - ["XClipboard"] = true, - ["Imagemagick"] = true, - ["Snes9X"] = true, - ["Add-ons"] = true, - ["Wine desktop"] = true -} - --- Define if we want to use titlebar on all applications. -use_titlebar = false --- }}} - ---{{{ Shifty - -shifty.config.defaults = { - layout = "tilebottom", -} -shifty.config.tags = { - ["1:terms"] = { init = true, }, - ["2:web"] = { init = true, nopopup = true }, - ["3:music"] = { init =false, nopopup = true, position = 3, spawn = "ario" }, - ["4:dls"] = { init =false, nopopup =false, position = 4, spawn = "dtella && linuxdcpp" }, - ["5:files"] = { init =false, nopopup =false, position = 5 }, - ["6:images"] = { init =false, nopopup =false, position = 6, layout = "float" }, - ["7:videos"] = { init =false, nopopup =false, position = 7, layout = "float" }, - ["8:exps"] = { init =false, nopopup =false, position = 8, layout = "float" }, - ["9:work"] = { init =false, nopopup =false, position = 9 }, -} - -shifty.config.apps = { - { match = { "VLC.*" }, float = true }, - { match = { "" }, honorsizehints= false, - 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 ), }, }, - } - --- tag defaults -shifty.config.defaults = { - layout = "tilebottom", - ncol = 1, - floatBars = true, -} -shifty.config.layouts = layouts -shifty.config.guess_position = true -shifty.config.remember_index = true -shifty.init() --- }}} - --- {{{ Widgets --- Create a systray -mysystray = widget({ type = "systray", align = "right" }) - --- Create a wibox for each screen and add it -mywibox = {} -mypromptbox = {} -mylayoutbox = {} -mytaglist = {} -mytaglist.buttons = { button({ }, 1, awful.tag.viewonly), - button({ modkey }, 1, awful.client.movetotag), - button({ }, 3, function (tag) tag.selected = not tag.selected end), - button({ modkey }, 3, awful.client.toggletag), - button({ }, 4, awful.tag.viewnext), - button({ }, 5, awful.tag.viewprev) } - shifty.taglist = mytaglist -mytasklist = {} -mytasklist.buttons = { button({ }, 1, function (c) client.focus = c; c:raise() end), - button({ }, 3, function () awful.menu.clients({ width=250 }) end), - button({ }, 4, function () awful.client.focus.byidx(1) end), - button({ }, 5, function () awful.client.focus.byidx(-1) end) } - -for s = 1, screen.count() do - -- Create a promptbox for each screen - mypromptbox[s] = widget({ type = "textbox" }) - --- Create a datebox widget -datebox = widget({ type = "textbox", align = "right" }) - -- Create an imagebox widget which will contains an icon indicating which layout we're using. - -- We need one layoutbox per screen. - mylayoutbox[s] = widget({ type = "imagebox" }) - mylayoutbox[s]:buttons({ button({ }, 1, function () awful.layout.inc(layouts, 1) end), - button({ }, 3, function () awful.layout.inc(layouts, -1) end), - button({ }, 4, function () awful.layout.inc(layouts, 1) end), - button({ }, 5, function () awful.layout.inc(layouts, -1) end) }) - -- Create a taglist widget - mytaglist[s] = awful.widget.taglist.new(s, awful.widget.taglist.label.all, mytaglist.buttons) - -- Create a tasklist widget - mytasklist[s] = awful.widget.tasklist.new(function(c) - return awful.widget.tasklist.label.currenttags(c, s) - end, mytasklist.buttons) ---}}} - ---{{{ Wibox - mywibox[s] = wibox({ position = "top", fg = beautiful.fg_normal, bg = beautiful.bg_normal }) - -- Add widgets to the wibox - order matters - mywibox[s].widgets = { - mylayoutbox[s], - mytaglist[s], - mypromptbox[s], - mysystray, - datebox, - } - mywibox[s].screen = s -end ---}}} - ---{{{ Functions - ---{{{ Add a todo note - - function addtodo (todo) - infobox.text = "| todo: " .. "" .. awful.util.spawn("todo --add --priority high " .. "'" .. todo .. "'") .. "" - end ---}}} - ---{{{ Show todos - function show_todo() - local todo = awful.util.pread("todo --mono") - todo = naughty.notify({ - text = string.format(os.date("%a, %d %B %Y") .. "\n" .. todo), - timeout = 6, - width = 300, - }) - end ---}}} - - - ---}}} - ---{{{ Keybindings --- {{{ Mouse bindings -root.buttons(awful.util.table.join( - awful.button({ }, 4, awful.tag.viewnext), - awful.button({ }, 5, awful.tag.viewprev) -)) --- }}} - --- {{{ Key bindings -globalkeys = awful.util.table.join( - -- Bindings for shifty - awful.key({ modkey, }, "comma", awful.tag.viewprev ), - awful.key({ modkey, "Shift" }, "comma", shifty.shift_prev ), - awful.key({ modkey, "Shift" }, "period", shifty.shift_next ), - awful.key({ modkey, }, "period", awful.tag.viewnext ), - awful.key({ modkey, }, "Escape", awful.tag.history.restore), - awful.key({ modkey }, "t", function() shifty.add({ rel_index = 1 }) end), - awful.key({ modkey, "Control" }, "t", function() shifty.add({ rel_index = 1, nopopup = true }) end), - awful.key({ modkey }, "r", shifty.rename), - awful.key({ modkey }, "w", shifty.delete), - awful.key({ modkey, "Shift" }, "o", function() shifty.set(awful.tag.selected(mouse.screen), { screen = awful.util.cycle(screen.count() , mouse.screen + 1) }) end), - awful.key({ modkey, }, "y", function() list = naughty.notify({ - text = get_albumart(), - width = 400 }) 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), - - -- 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( 1) end), - awful.key({ modkey, "Control" }, "k", function () awful.screen.focus(-1) end), - awful.key({ modkey, "Shift" }, "u", awful.client.urgent.jumpto), - awful.key({ modkey, }, "Tab", - function () - awful.client.focus.byidx( 1) - if client.focus then client.focus:raise() end - end), - awful.key({ modkey, "Shift" }, "Tab", - function () - awful.client.focus.byidx(-1) - if client.focus then client.focus:raise() end - end), - - - -- Standard program - awful.key({ modkey, }, "Return", function () awful.util.spawn(terminal) end), - awful.key({ modkey, "Shift" }, "Return", function () awful.util.spawn(editor) end), - awful.key({ modkey, "Control" }, "r", awesome.restart), - awful.key({ modkey, "Shift" }, "q", awesome.quit), - - -- display playlist - awful.key({ modkey, }, "p", function() list = naughty.notify({ - text = get_playlist(), - width = 400 }) end), - - -- Display the todo list - awful.key({ modkey, }, "d", function () show_todo() end), - - -- Paste content of the xbuffer - awful.key({ modkey, "Control" }, "p", function () - awful.prompt.run({ prompt = "Paste to: "}, - mypromptbox[mouse.screen], - function (s) paste(s) end, - awful.completion.shell) end), - -- Lock the screen - - awful.key({ modkey }, "t", function() shifty.add({ rel_index = 1 }) end), - awful.key({ modkey, "Control" }, "t", function() shifty.add({ rel_index = 1, nopopup = true }) end), - awful.key({ modkey }, "r", shifty.rename), - awful.key({ modkey }, "w", shifty.del), - awful.key({ modkey, "Control" }, "o", function () shifty.set(awful.tag.selected(mouse.screen), { screen = awful.util.cycle(mouse.screen + 1, screen.count()) }) end), - 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 - -- add a todo - awful.key({ modkey, "Shift" }, "d", - function () - awful.prompt.run({ prompt = " Add Todo Note: " }, - mypromptbox[mouse.screen], - addtodo(t), t, - awful.util.getdir("cache") .. "/todos") - end), - awful.key({ modkey }, "F2", - function () - awful.prompt.run({ fg_cursor = 'orange', bg_cursor = beautiful.bg_normal, - ul_cursor = "single", prompt = " Run: " }, - mypromptbox[mouse.screen], - awful.util.spawn, awful.completion.shell, - awful.util.getdir("cache") .. "/history") - end), - awful.key({ modkey }, "F4", - function () - awful.prompt.run({ prompt = " Run Lua code: " }, - mypromptbox[mouse.screen], - awful.util.eval, nil, - awful.util.getdir("cache") .. "/history_eval") - end) -) - --- Client awful tagging: this is useful to tag some clients and then do stuff like move to tag on them -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, }, "semicolon", 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", awful.client.togglemarked), - awful.key({ modkey,}, "m", - function (c) - c.maximized_horizontal = not c.maximized_horizontal - c.maximized_vertical = not c.maximized_vertical - 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 --- Set keys -root.keys(globalkeys) -shifty.config.globalkeys = globalkeys -shifty.config.clientkeys = clientkeys ---}}} ---}}} - --- {{{ Hooks --- Hook function to execute when focusing a client. -awful.hooks.focus.register(function (c) - if not awful.client.ismarked(c) then - c.border_color = beautiful.border_focus - end -end) - --- Hook function to execute when unfocusing a client. -awful.hooks.unfocus.register(function (c) - if not awful.client.ismarked(c) then - c.border_color = beautiful.border_normal - end -end) - --- Hook function to execute when marking a client -awful.hooks.marked.register(function (c) - c.border_color = beautiful.border_marked -end) - --- Hook function to execute when unmarking a client. -awful.hooks.unmarked.register(function (c) - c.border_color = beautiful.border_focus -end) - --- Hook function to execute when the mouse enters a client. -awful.hooks.mouse_enter.register(function (c) - -- Sloppy focus, but disabled for magnifier layout - if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier - and awful.client.focus.filter(c) then - client.focus = c - end -end) - --- Hook function to execute when arranging the screen. --- (tag switch, new client, etc) -awful.hooks.arrange.register(function (screen) - local layout = awful.layout.getname(awful.layout.get(screen)) - if layout and beautiful["layout_" ..layout] then - mylayoutbox[screen].image = image(beautiful["layout_" .. layout]) - else - mylayoutbox[screen].image = nil - end - - -- Give focus to the latest client in history if no window has focus - -- or if the current window is a desktop or a dock one. - if not client.focus then - local c = awful.client.focus.history.get(screen, 0) - if c then client.focus = c end - end -end) - --- Hook called every 15 seconds, displays info -function hook_date () - -- writes status to .status - os.execute("echo $(mpc | grep -) $(gmail.py) $(acpi -b | sed -e 's/%.*/%/;s/.*, //') $(date +'%a %d %b') $(date +'%I:%M') > ~/.status") - -- read .status - io.input("/home/jack/.status") - datebox.text = io.read("*line") -end - --- Set timers for the hooks -awful.hooks.timer.register(15, hook_date) - --- run the hook so we don't have to wait -hook_date() - ---}}} - --- startup commands -os.execute("xmodmap ~/.xmodmap &") -os.execute("xbindkeys &") -os.execute("nitrogen --restore &") -os.execute("xsetroot -cursor_name left_ptr &") - --- vim: foldmethod=marker:filetype=lua:expandtab:shiftwidth=2:tabstop=2:softtabstop=2:encoding=utf-8:textwidth=80 diff --git a/json.lua b/json.lua deleted file mode 100644 index 841b0cb..0000000 --- a/json.lua +++ /dev/null @@ -1,515 +0,0 @@ ---[[ - - JSON Encoder and Parser for Lua 5.1 - - Copyright 2007 Shaun Brown (http://www.chipmunkav.com). - All Rights Reserved. - - Permission is hereby granted, free of charge, to any person - obtaining a copy of this software to deal in the Software without - restriction, including without limitation the rights to use, - copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the - Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - If you find this software useful please give www.chipmunkav.com a mention. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - Usage: - - -- Lua script: - local t = { - ["name1"] = "value1", - ["name2"] = {1, false, true, 23.54, "a \021 string"}, - name3 = Json.Null() - } - - local json = Json.Encode (t) - print (json) - --> {"name1":"value1","name3":null,"name2":[1,false,true,23.54,"a \u0015 string"]} - - local t = Json.Decode(json) - print(t.name2[4]) - --> 23.54 - - Notes: - 1) Encodable Lua types: string, number, boolean, table, nil - 2) Use Json.Null() to insert a null value into a Json object - 3) All control chars are encoded to \uXXXX format eg "\021" encodes to "\u0015" - 4) All Json \uXXXX chars are decoded to chars (0-255 byte range only) - 5) Json single line // and /* */ block comments are discarded during decoding - 6) Numerically indexed Lua arrays are encoded to Json Lists eg [1,2,3] - 7) Lua dictionary tables are converted to Json objects eg {"one":1,"two":2} - 8) Json nulls are decoded to Lua nil and treated by Lua in the normal way - ---]] - -local string = string -local math = math -local table = table -local error = error -local tonumber = tonumber -local tostring = tostring -local type = type -local setmetatable = setmetatable -local pairs = pairs -local ipairs = ipairs -local assert = assert -local Chipmunk = Chipmunk - -module("Json") - -local StringBuilder = { - buffer = {} -} - -function StringBuilder:New() - local o = {} - setmetatable(o, self) - self.__index = self - o.buffer = {} - return o -end - -function StringBuilder:Append(s) - self.buffer[#self.buffer+1] = s -end - -function StringBuilder:ToString() - return table.concat(self.buffer) -end - -local JsonWriter = { - backslashes = { - ['\b'] = "\\b", - ['\t'] = "\\t", - ['\n'] = "\\n", - ['\f'] = "\\f", - ['\r'] = "\\r", - ['"'] = "\\\"", - ['\\'] = "\\\\", - ['/'] = "\\/" - } -} - -function JsonWriter:New() - local o = {} - o.writer = StringBuilder:New() - setmetatable(o, self) - self.__index = self - return o -end - -function JsonWriter:Append(s) - self.writer:Append(s) -end - -function JsonWriter:ToString() - return self.writer:ToString() -end - -function JsonWriter:Write(o) - local t = type(o) - if t == "nil" then - self:WriteNil() - elseif t == "boolean" then - self:WriteString(o) - elseif t == "number" then - self:WriteString(o) - elseif t == "string" then - self:ParseString(o) - elseif t == "table" then - self:WriteTable(o) - elseif t == "function" then - self:WriteFunction(o) - elseif t == "thread" then - self:WriteError(o) - elseif t == "userdata" then - self:WriteError(o) - end -end - -function JsonWriter:WriteNil() - self:Append("null") -end - -function JsonWriter:WriteString(o) - self:Append(tostring(o)) -end - -function JsonWriter:ParseString(s) - self:Append('"') - self:Append(string.gsub(s, "[%z%c\\\"/]", function(n) - local c = self.backslashes[n] - if c then return c end - return string.format("\\u%.4X", string.byte(n)) - end)) - self:Append('"') -end - -function JsonWriter:IsArray(t) - local count = 0 - local isindex = function(k) - if type(k) == "number" and k > 0 then - if math.floor(k) == k then - return true - end - end - return false - end - for k,v in pairs(t) do - if not isindex(k) then - return false, '{', '}' - else - count = math.max(count, k) - end - end - return true, '[', ']', count -end - -function JsonWriter:WriteTable(t) - local ba, st, et, n = self:IsArray(t) - self:Append(st) - if ba then - for i = 1, n do - self:Write(t[i]) - if i < n then - self:Append(',') - end - end - else - local first = true; - for k, v in pairs(t) do - if not first then - self:Append(',') - end - first = false; - self:ParseString(k) - self:Append(':') - self:Write(v) - end - end - self:Append(et) -end - -function JsonWriter:WriteError(o) - error(string.format( - "Encoding of %s unsupported", - tostring(o))) -end - -function JsonWriter:WriteFunction(o) - if o == Null then - self:WriteNil() - else - self:WriteError(o) - end -end - -local StringReader = { - s = "", - i = 0 -} - -function StringReader:New(s) - local o = {} - setmetatable(o, self) - self.__index = self - o.s = s or o.s - return o -end - -function StringReader:Peek() - local i = self.i + 1 - if i <= #self.s then - return string.sub(self.s, i, i) - end - return nil -end - -function StringReader:Next() - self.i = self.i+1 - if self.i <= #self.s then - return string.sub(self.s, self.i, self.i) - end - return nil -end - -function StringReader:All() - return self.s -end - -local JsonReader = { - escapes = { - ['t'] = '\t', - ['n'] = '\n', - ['f'] = '\f', - ['r'] = '\r', - ['b'] = '\b', - } -} - -function JsonReader:New(s) - local o = {} - o.reader = StringReader:New(s) - setmetatable(o, self) - self.__index = self - return o; -end - -function JsonReader:Read() - self:SkipWhiteSpace() - local peek = self:Peek() - if peek == nil then - error(string.format( - "Nil string: '%s'", - self:All())) - elseif peek == '{' then - return self:ReadObject() - elseif peek == '[' then - return self:ReadArray() - elseif peek == '"' then - return self:ReadString() - elseif string.find(peek, "[%+%-%d]") then - return self:ReadNumber() - elseif peek == 't' then - return self:ReadTrue() - elseif peek == 'f' then - return self:ReadFalse() - elseif peek == 'n' then - return self:ReadNull() - elseif peek == '/' then - self:ReadComment() - return self:Read() - else - error(string.format( - "Invalid input: '%s'", - self:All())) - end -end - -function JsonReader:ReadTrue() - self:TestReservedWord{'t','r','u','e'} - return true -end - -function JsonReader:ReadFalse() - self:TestReservedWord{'f','a','l','s','e'} - return false -end - -function JsonReader:ReadNull() - self:TestReservedWord{'n','u','l','l'} - return nil -end - -function JsonReader:TestReservedWord(t) - for i, v in ipairs(t) do - if self:Next() ~= v then - error(string.format( - "Error reading '%s': %s", - table.concat(t), - self:All())) - end - end -end - -function JsonReader:ReadNumber() - local result = self:Next() - local peek = self:Peek() - while peek ~= nil and string.find( - peek, - "[%+%-%d%.eE]") do - result = result .. self:Next() - peek = self:Peek() - end - result = tonumber(result) - if result == nil then - error(string.format( - "Invalid number: '%s'", - result)) - else - return result - end -end - -function JsonReader:ReadString() - local result = "" - assert(self:Next() == '"') - while self:Peek() ~= '"' do - local ch = self:Next() - if ch == '\\' then - ch = self:Next() - if self.escapes[ch] then - ch = self.escapes[ch] - end - end - result = result .. ch - end - assert(self:Next() == '"') - local fromunicode = function(m) - return string.char(tonumber(m, 16)) - end - return string.gsub( - result, - "u%x%x(%x%x)", - fromunicode) -end - -function JsonReader:ReadComment() - assert(self:Next() == '/') - local second = self:Next() - if second == '/' then - self:ReadSingleLineComment() - elseif second == '*' then - self:ReadBlockComment() - else - error(string.format( - "Invalid comment: %s", - self:All())) - end -end - -function JsonReader:ReadBlockComment() - local done = false - while not done do - local ch = self:Next() - if ch == '*' and self:Peek() == '/' then - done = true - end - if not done and - ch == '/' and - self:Peek() == "*" then - error(string.format( - "Invalid comment: %s, '/*' illegal.", - self:All())) - end - end - self:Next() -end - -function JsonReader:ReadSingleLineComment() - local ch = self:Next() - while ch ~= '\r' and ch ~= '\n' do - ch = self:Next() - end -end - -function JsonReader:ReadArray() - local result = {} - assert(self:Next() == '[') - local done = false - if self:Peek() == ']' then - done = true; - end - while not done do - local item = self:Read() - result[#result+1] = item - self:SkipWhiteSpace() - if self:Peek() == ']' then - done = true - end - if not done then - local ch = self:Next() - if ch ~= ',' then - error(string.format( - "Invalid array: '%s' due to: '%s'", - self:All(), ch)) - end - end - end - assert(']' == self:Next()) - return result -end - -function JsonReader:ReadObject() - local result = {} - assert(self:Next() == '{') - local done = false - if self:Peek() == '}' then - done = true - end - while not done do - local key = self:Read() - if type(key) ~= "string" then - error(string.format( - "Invalid non-string object key: %s", - key)) - end - self:SkipWhiteSpace() - local ch = self:Next() - if ch ~= ':' then - error(string.format( - "Invalid object: '%s' due to: '%s'", - self:All(), - ch)) - end - self:SkipWhiteSpace() - local val = self:Read() - result[key] = val - self:SkipWhiteSpace() - if self:Peek() == '}' then - done = true - end - if not done then - ch = self:Next() - if ch ~= ',' then - error(string.format( - "Invalid array: '%s' near: '%s'", - self:All(), - ch)) - end - end - end - assert(self:Next() == "}") - return result -end - -function JsonReader:SkipWhiteSpace() - local p = self:Peek() - while p ~= nil and string.find(p, "[%s/]") do - if p == '/' then - self:ReadComment() - else - self:Next() - end - p = self:Peek() - end -end - -function JsonReader:Peek() - return self.reader:Peek() -end - -function JsonReader:Next() - return self.reader:Next() -end - -function JsonReader:All() - return self.reader:All() -end - -function Encode(o) - local writer = JsonWriter:New() - writer:Write(o) - return writer:ToString() -end - -function Decode(s) - local reader = JsonReader:New(s) - return reader:Read() -end - -function Null() - return Null -end - diff --git a/rc.lua b/rc.lua index 38fd346..be54d68 100644 --- a/rc.lua +++ b/rc.lua @@ -2,14 +2,64 @@ require("awful") require("awful.autofocus") require("awful.rules") --- Theme handling library require("beautiful") --- Notification library require("naughty") require("teardrop") require("obvious.battery") require("obvious.popup_run_prompt") require("vicious") +--- Spawns cmd if no client can be found matching properties +-- If such a client can be found, pop to first tag where it is visible, and give it focus +-- @param cmd the command to execute +-- @param properties a table of properties to match against clients. Possible entries: any properties of the client object +function runraise(cmd, properties) + local clients = client.get() + local focused = awful.client.next(0) + local findex = 0 + local matched_clients = {} + local n = 0 + for i, c in pairs(clients) do + --make an array of matched clients + if match(properties, c) then + n = n + 1 + matched_clients[n] = c + if c == focused then + findex = n + end + end + end + if n > 0 then + local c = matched_clients[1] + -- if the focused window matched switch focus to next in list + if 0 < findex and findex < n then + c = matched_clients[findex+1] + end + local ctags = c:tags() + if table.getn(ctags) == 0 then + -- ctags is empty, show client on current tag + local curtag = awful.tag.selected() + awful.client.movetotag(curtag, c) + else + -- Otherwise, pop to first tag client is visible on + awful.tag.viewonly(ctags[1]) + end + -- And then focus the client + client.focus = c + c:raise() + return + end + awful.util.spawn(cmd) +end + +-- Returns true if all pairs in table1 are present in table2 +function match (table1, table2) + for k, v in pairs(table1) do + if table2[k] ~= v and not table2[k]:find(v) then + return false + end + end + return true +end -- {{{ Variable definitions -- Themes define colours, icons, and wallpapers @@ -225,11 +275,17 @@ globalkeys = awful.util.table.join( --}}} -- Standard program awful.key({ modkey, }, "Return", function () awful.util.spawn(terminal) end), - awful.key({ modkey, }, "f", function () awful.util.spawn("firefox") end), - awful.key({ modkey, }, "t", function () awful.util.spawn("thunderbird") end), - awful.key({ modkey, }, "p", function () awful.util.spawn("pidgin") end), - awful.key({ modkey, }, "s", function () awful.util.spawn("sunbird") end), - awful.key({ modkey, }, "g", function () awful.util.spawn("gmpc") end), +-- awful.key({ modkey, }, "f", function () awful.util.spawn("firefox") end), +-- awful.key({ modkey, }, "t", function () awful.util.spawn("thunderbird") end), +-- awful.key({ modkey, }, "p", function () awful.util.spawn("pidgin") end), +-- awful.key({ modkey, }, "s", function () awful.util.spawn("sunbird") end), +-- awful.key({ modkey, }, "g", function () awful.util.spawn("gmpc") end), + awful.key({ modkey, }, "f", function () runraise("firefox", { class = "Firefox" }) end), + awful.key({ modkey, }, "t", function () runraise("thunderbird", { class = "Thunderbird" }) end), + awful.key({ modkey, }, "p", function () runraise("pidgin", { class = "Pidgin" }) end), + awful.key({ modkey, }, "s", function () runraised("sunbird", { class = "Sunbirdi-bin" }) end), + awful.key({ modkey, }, "g", function () runraise("gmpc", { class = "Gmpc" }) end), + awful.key({ }, "XF86Mail", function () awful.util.spawn("xset dpms force off") end), awful.key({ }, "XF86Mail", function () awful.util.spawn("xset dpms force off") end), awful.key({ modkey }, "XF86Mail", function () awful.util.spawn("urslock") end), awful.key({ modkey, "Control" }, "r", awesome.restart), diff --git a/scratchpad.lua b/scratchpad.lua deleted file mode 100644 index c196fc3..0000000 --- a/scratchpad.lua +++ /dev/null @@ -1,136 +0,0 @@ ---------------------------------------------------------------- --- Basic scratchpad manager for the awesome window manager ---------------------------------------------------------------- --- Adrian C. --- Licensed under the WTFPL version 2 --- * http://sam.zoy.org/wtfpl/COPYING ---------------------------------------------------------------- --- To use this module add: --- require("scratchpad") --- to the top of your rc.lua, and call: --- scratchpad.set(c, width, height, sticky, screen) --- from a clientkeys binding, and: --- scratchpad.toggle(screen) --- from a globalkeys binding. --- --- Parameters: --- c - Client to scratch or un-scratch --- width - Width in absolute pixels, or width percentage --- when < 1 (0.50 (50% of the screen) by default) --- height - Height in absolute pixels, or height percentage --- when < 1 (0.50 (50% of the screen) by default) --- sticky - Visible on all tags, false by default --- screen - Screen (optional), mouse.screen by default ---------------------------------------------------------------- - --- Grab environment -local awful = require("awful") -local capi = { - mouse = mouse, - client = client, - screen = screen -} - --- Scratchpad: Basic scratchpad manager for the awesome window manager -module("scratchpad") - -local scratch = {} - --- Scratch the focused client, or un-scratch and tile it. If another --- client is already scratched, replace it with the focused client. -function set(c, width, height, sticky, screen) - local width = width or 0.50 - local height = height or 0.50 - local sticky = sticky or false - local screen = screen or capi.mouse.screen - - local function setscratch(c) - -- Scratchpad is floating - awful.client.floating.set(c, true) - - -- Scratchpad geometry and placement - local screengeom = capi.screen[screen].workarea - - if width < 1 then width = screengeom.width * width end - if height < 1 then height = screengeom.height * height end - - c:geometry({ -- Client is always centered on screen - x = screengeom.x + (screengeom.width - width) / 2, - y = screengeom.y + (screengeom.height - height) / 2, - width = width, height = height - }) - - -- Scratchpad properties - c.ontop = true - c.above = true - c.skip_taskbar = true - if sticky then c.sticky = true end - if c.titlebar then awful.titlebar.remove(c) end - - -- Scratchpad should not loose focus - c:raise() - capi.client.focus = c - end - - -- Prepare a table for storing clients, - if not scratch["pad"] then scratch["pad"] = {} - -- add unmanage signal for scratchpad clients - capi.client.add_signal("unmanage", function (c) - local oc = scratch["pad"][screen] - if oc == c then - scratch["pad"][screen] = nil - end - end) - end - - -- If the scratcphad is emtpy, store the client, - if not scratch["pad"][screen] then - scratch["pad"][screen] = c - -- then apply geometry and properties - setscratch(c) - else -- If a client is already scratched, - local oc = scratch["pad"][screen] - -- compare it with the focused client - if oc == c then - -- If it matches then unscratch and clear the table - awful.client.floating.toggle(oc); oc.sticky = false - oc.ontop = false; oc.above = false - scratch["pad"][screen] = nil - else -- If they don't match, unscratch and replace it - oc.hidden = false; oc.sticky = false - oc.ontop = false; oc.above = false - awful.client.floating.toggle(oc) - scratch["pad"][screen] = c - setscratch(c) - end - end -end - --- Move the scratchpad to the current workspace, focus and raise it --- when it's hidden, or hide it when it's visible. -function toggle(screen) - local screen = screen or capi.mouse.screen - - -- Check if we have a client on storage, - if scratch["pad"] and - scratch["pad"][screen] ~= nil - then -- and get it out, to play - local c = scratch["pad"][screen] - - -- If it's visible on another tag hide it, - if c:isvisible() == false then c.hidden = true; - -- and move it to the current worskpace - awful.client.movetotag(awful.tag.selected(screen), c) - end - - -- Focus and raise if it's hidden, - if c.hidden then - awful.placement.centered(c) - c.hidden = false - c:raise() - capi.client.focus = c - else -- hide it if it's not - c.hidden = true - end - end -end diff --git a/theme.lua b/theme.lua deleted file mode 100644 index df83de0..0000000 --- a/theme.lua +++ /dev/null @@ -1,142 +0,0 @@ -------------------------------- --- "Zenburn" awesome theme -- --- By Adrian C. (anrxc) -- -------------------------------- - - --- {{{ Main -theme = {} -confdir = awful.util.getdir("config") -theme.wallpaper_cmd = { "/usr/bin/nitrogen --restore" } ---theme.wallpaper_cmd = { "awsetbg /usr/share/awesome/themes/zenburn/zenburn-background.png" } --- }}} - - --- {{{ Styles -theme.font = "fixed 6" - --- {{{ Colors -theme.fg_normal = "#DCDCCC" -theme.fg_focus = "#F0DFAF" -theme.fg_urgent = "#CC9393" -theme.bg_normal = "#3F3F3F" -theme.bg_focus = "#1E2320" -theme.bg_urgent = "#3F3F3F" --- }}} - --- {{{ Borders -theme.border_width = "1" -theme.border_normal = "#3F3F3F" -theme.border_focus = "#6F6F6F" -theme.border_marked = "#CC9393" --- }}} - --- {{{ Titlebars -theme.titlebar_bg_focus = "#5F5F5F" -theme.titlebar_bg_normal = "#3F3F3F" --- theme.titlebar_[normal|focus] --- }}} - --- {{{ Widgets -theme.fg_widget = "#AECF96" -theme.fg_center_widget = "#88A175" -theme.fg_end_widget = "#FF5656" -theme.fg_off_widget = "#494B4F" -theme.fg_netup_widget = "#7F9F7F" -theme.fg_netdn_widget = "#CC9393" -theme.bg_widget = "#3F3F3F" -theme.border_widget = "#3F3F3F" --- }}} - --- {{{ Mouse finder -theme.mouse_finder_color = "#CC9393" --- theme.mouse_finder_[timeout|animate_timeout|radius|factor] --- }}} - --- {{{ Tooltips --- theme.tooltip_[font|opacity|fg_color|bg_color|border_width|border_color] --- }}} - --- {{{ Taglist and Tasklist --- theme.[taglist|tasklist]_[bg|fg]_[focus|urgent] --- }}} - --- {{{ Menu --- theme.menu_[height|width] --- theme.menu_[bg|fg]_[normal|focus] --- theme.menu_[border_color|border_width] --- }}} --- }}} - - --- {{{ Icons --- --- {{{ Taglist icons -theme.taglist_squares_sel = confdir .. "/icons/taglist/squarefw.png" -theme.taglist_squares_unsel = confdir .. "/icons/taglist/squarew.png" ---theme.taglist_squares_resize = "false" --- }}} - --- {{{ Misc icons ---theme.awesome_icon = confdir .. "/icons/awesome.png" ---theme.menu_submenu_icon = "/usr/share/awesome/themes/default/submenu.png" ---theme.tasklist_floating_icon = "/usr/share/awesome/themes/default/tasklist/floatingw.png" --- }}} - --- {{{ Layout icons -theme.layout_tile = confdir .. "/icons/layouts/tilew.png" -theme.layout_tileleft = confdir .. "/icons/layouts/tileleftw.png" -theme.layout_tilebottom = confdir .. "/icons/layouts/tilebottomw.png" -theme.layout_tiletop = confdir .. "/icons/layouts/tiletopw.png" -theme.layout_fairv = confdir .. "/icons/layouts/fairvw.png" -theme.layout_fairh = confdir .. "/icons/layouts/fairhw.png" -theme.layout_spiral = confdir .. "/icons/layouts/spiralw.png" -theme.layout_dwindle = confdir .. "/icons/layouts/dwindlew.png" -theme.layout_max = confdir .. "/icons/layouts/maxw.png" -theme.layout_fullscreen = confdir .. "/icons/layouts/fullscreenw.png" -theme.layout_magnifier = confdir .. "/icons/layouts/magnifierw.png" -theme.layout_floating = confdir .. "/icons/layouts/floatingw.png" --- }}} - --- {{{ Widget icons -theme.widget_cpu = confdir .. "/icons/cpu.png" -theme.widget_bat = confdir .. "/icons/bat.png" -theme.widget_mem = confdir .. "/icons/mem.png" -theme.widget_fs = confdir .. "/icons/disk.png" -theme.widget_net = confdir .. "/icons/down.png" -theme.widget_netup = confdir .. "/icons/up.png" -theme.widget_mail = confdir .. "/icons/mail.png" -theme.widget_vol = confdir .. "/icons/vol.png" -theme.widget_org = confdir .. "/icons/cal.png" -theme.widget_date = confdir .. "/icons/time.png" -theme.widget_crypto = confdir .. "/icons/crypto.png" --- }}} - --- {{{ Titlebar icons -theme.titlebar_close_button_focus = confdir .. "/icons/titlebar/close_focus.png" -theme.titlebar_close_button_normal = confdir .. "/icons/titlebar/close_normal.png" - -theme.titlebar_ontop_button_focus_active = confdir .. "/icons/titlebar/ontop_focus_active.png" -theme.titlebar_ontop_button_normal_active = confdir .. "/icons/titlebar/ontop_normal_active.png" -theme.titlebar_ontop_button_focus_inactive = confdir .. "/icons/titlebar/ontop_focus_inactive.png" -theme.titlebar_ontop_button_normal_inactive = confdir .. "/icons/titlebar/ontop_normal_inactive.png" - -theme.titlebar_sticky_button_focus_active = confdir .. "/icons/titlebar/sticky_focus_active.png" -theme.titlebar_sticky_button_normal_active = confdir .. "/icons/titlebar/sticky_normal_active.png" -theme.titlebar_sticky_button_focus_inactive = confdir .. "/icons/titlebar/sticky_focus_inactive.png" -theme.titlebar_sticky_button_normal_inactive = confdir .. "/icons/titlebar/sticky_normal_inactive.png" - -theme.titlebar_floating_button_focus_active = confdir .. "/icons/titlebar/floating_focus_active.png" -theme.titlebar_floating_button_normal_active = confdir .. "/icons/titlebar/floating_normal_active.png" -theme.titlebar_floating_button_focus_inactive = confdir .. "/icons/titlebar/floating_focus_inactive.png" -theme.titlebar_floating_button_normal_inactive = confdir .. "/icons/titlebar/floating_normal_inactive.png" - -theme.titlebar_maximized_button_focus_active = confdir .. "/icons/titlebar/maximized_focus_active.png" -theme.titlebar_maximized_button_normal_active = confdir .. "/icons/titlebar/maximized_normal_active.png" -theme.titlebar_maximized_button_focus_inactive = confdir .. "/icons/titlebar/maximized_focus_inactive.png" -theme.titlebar_maximized_button_normal_inactive = confdir .. "/icons/titlebar/maximized_normal_inactive.png" --- }}} --- }}} - - -return theme diff --git a/wicked.lua b/wicked.lua deleted file mode 100644 index 064d928..0000000 --- a/wicked.lua +++ /dev/null @@ -1,848 +0,0 @@ ---------------------------------------------------------------------------- --- Wicked widgets for the awesome window manager ---------------------------------------------------------------------------- --- Lucas de Vries --- Licensed under the WTFPL --- Version: v1.0pre-awe3.0rc4 ---------------------------------------------------------------------------- - --- Require libs -require("awful") - ----- {{{ Grab environment -local ipairs = ipairs -local pairs = pairs -local print = print -local type = type -local tonumber = tonumber -local tostring = tostring -local math = math -local table = table -local awful = awful -local os = os -local io = io -local string = string - --- Grab C API -local capi = -{ - awesome = awesome, - screen = screen, - client = client, - mouse = mouse, - button = button, - titlebar = titlebar, - widget = widget, - hooks = hooks, - keygrabber = keygrabber -} - --- }}} - --- Wicked: Widgets for the awesome window manager -module("wicked") - ----- {{{ Initialise variables -local registered = {} -local widget_cache = {} - --- Initialise function tables -widgets = {} -helper = {} - -local nets = {} -local cpu_total = {} -local cpu_active = {} -local cpu_usage = {} - --- }}} - ----- {{{ Helper functions - -----{{{ Max width -function helper.max_width(str, width) - l = str:len() - - if l > width then - r = math.floor(width/2) - a = str:sub(1,r) - b = str:sub(l-r, l) - str = a .. "..." .. b - end - - return str -end -----}}} - -----{{{ Force a fixed width on a string with spaces -function helper.fixed_width(str, width) - l = str:len() - n = width-l - if n >= 0 then - for i = 1, n do - str = str.." " - end - else - str = str:sub(0, l+n) - end - return str -end -----}}} - ----- {{{ Format a string with args -function helper.format(format, args) - -- TODO: Find a more efficient way to do this - - -- Format a string - for var,val in pairs(args) do - format = string.gsub(format, '$'..var, val) - end - - -- Return formatted string - return format -end --- }}} - ----- {{{ Padd a number to a minimum amount of digits -function helper.padd(number, padding) - s = tostring(number) - - if padding == nil then - return s - end - - for i=1,padding do - if math.floor(number/math.pow(10,(i-1))) == 0 then - s = "0"..s - end - end - - if number == 0 then - s = s:sub(2) - end - - return s -end --- }}} - ----- {{{ Convert amount of bytes to string -function helper.bytes_to_string(bytes, sec, padding) - if bytes == nil or tonumber(bytes) == nil then - return '' - end - - bytes = tonumber(bytes) - - signs = {} - signs[1] = ' b' - signs[2] = 'KiB' - signs[3] = 'MiB' - signs[4] = 'GiB' - signs[5] = 'TiB' - - sign = 1 - - while bytes/1024 > 1 and signs[sign+1] ~= nil do - bytes = bytes/1024 - sign = sign+1 - end - - bytes = bytes*10 - bytes = math.floor(bytes)/10 - - if padding then - bytes = helper.padd(bytes*10, padding+1) - bytes = bytes:sub(1, bytes:len()-1).."."..bytes:sub(bytes:len()) - end - - if sec then - return tostring(bytes)..signs[sign]..'ps' - else - return tostring(bytes)..signs[sign] - end -end --- }}} - ----- {{{ Split by whitespace -function helper.splitbywhitespace(str) - values = {} - start = 1 - splitstart, splitend = string.find(str, ' ', start) - - while splitstart do - m = string.sub(str, start, splitstart-1) - if m:gsub(' ','') ~= '' then - table.insert(values, m) - end - - start = splitend+1 - splitstart, splitend = string.find(str, ' ', start) - end - - m = string.sub(str, start) - if m:gsub(' ','') ~= '' then - table.insert(values, m) - end - - return values -end --- }}} - ---{{{ Escape a string -function helper.escape(text) - if text then - text = text:gsub("&", "&") - text = text:gsub("<", "<") - text = text:gsub(">", ">") - text = text:gsub("'", "'") - text = text:gsub("\"", """) - end - return text -end - --- }}} - --- }}} - ----- {{{ Widget types - ----- {{{ MPD widget type -function widgets.mpd() - ---- Get data from mpc - local nowplaying_file = io.popen('mpc') - local nowplaying = nowplaying_file:read() - - -- Close the command - nowplaying_file:close() - - -- Check that it's not nil - if nowplaying == nil then - return {''} - end - - -- Escape - nowplaying = helper.escape(nowplaying) - - -- Return it - return {nowplaying} -end - -widget_cache[widgets.mpd] = {} --- }}} - ----- {{{ MOCP widget type -function widgets.mocp(format, max_width) - local playing = '' - - ---- Get data from mocp - local info = io.popen('mocp -i') - local state = info:read() - state = state.gsub(state, 'State: ', '') - - if (state == "PLAY") then - local file = info:read() - file = file.gsub(file, 'File: ', '') - local title = info:read() - title = title.gsub(title, 'Title: ', '') - local artist = info:read() - artist = artist.gsub(artist, 'Artist: ', '') - local songtitle = info:read() - songtitle = songtitle.gsub(songtitle, 'SongTitle: ', '') - local album = info:read() - album = album.gsub(album, 'Album: ', '') - - -- Try artist - (song)title - if (artist:len() > 0) then - playing = artist .. ' - ' .. (songtitle ~= '' and songtitle or title) - - -- Else try title or songtitle - elseif (artist:len() == 0 and (title:len() > 0 or songtitle:len() > 0)) then - playing = (title ~= '' and title or songtitle) - - -- Else use the filename - else - file = string.reverse(file) - i = string.find(file, '/') - if (i ~= nil) then - file = string.sub(file, 0, i-1) - end - playing = string.reverse(file) - end - else - playing = state - end - - -- Close file - info:close() - - -- Apply maximum width - if (max_width ~= nil) then - playing = helper.max_width(playing, max_width) - end - - playing = helper.escape(playing) - - -- Return it - return {playing} -end - -widget_cache[widgets.mocp] = {} --- }}} - ----- {{{ CPU widget type -function widgets.cpu(format, padding) - -- Calculate CPU usage for all available CPUs / cores and return the - -- usage - - -- Perform a new measurement - ---- Get /proc/stat - local cpu_lines = {} - local cpu_usage_file = io.open('/proc/stat') - for line in cpu_usage_file:lines() do - if string.sub(line, 1, 3) == 'cpu' then - table.insert(cpu_lines, helper.splitbywhitespace(line)) - end - end - cpu_usage_file:close() - - ---- Ensure tables are initialized correctly - while #cpu_total < #cpu_lines do - table.insert(cpu_total, 0) - end - while #cpu_active < #cpu_lines do - table.insert(cpu_active, 0) - end - while #cpu_usage < #cpu_lines do - table.insert(cpu_usage, 0) - end - - ---- Setup tables - total_new = {} - active_new = {} - diff_total = {} - diff_active = {} - - for i,v in ipairs(cpu_lines) do - ---- Calculate totals - total_new[i] = 0 - for j = 2, #v do - total_new[i] = total_new[i] + v[j] - end - active_new[i] = v[2] + v[3] + v[4] - - ---- Calculate percentage - diff_total[i] = total_new[i] - cpu_total[i] - diff_active[i] = active_new[i] - cpu_active[i] - cpu_usage[i] = math.floor(diff_active[i] / diff_total[i] * 100) - - ---- Store totals - cpu_total[i] = total_new[i] - cpu_active[i] = active_new[i] - end - - if padding ~= nil then - for k,v in pairs(cpu_usage) do - if type(padding) == "table" then - p = padding[k] - else - p = padding - end - - cpu_usage[k] = helper.padd(cpu_usage[k], p) - end - end - - return cpu_usage -end - -widget_cache[widgets.cpu] = {} --- }}} - ----- {{{ Memory widget type -function widgets.mem(format, padding) - -- Return MEM usage values - local f = io.open('/proc/meminfo') - - ---- Get data - for line in f:lines() do - line = helper.splitbywhitespace(line) - - if line[1] == 'MemTotal:' then - mem_total = math.floor(line[2]/1024) - elseif line[1] == 'MemFree:' then - free = math.floor(line[2]/1024) - elseif line[1] == 'Buffers:' then - buffers = math.floor(line[2]/1024) - elseif line[1] == 'Cached:' then - cached = math.floor(line[2]/1024) - end - end - f:close() - - ---- Calculate percentage - mem_free=free+buffers+cached - mem_inuse=mem_total-mem_free - mem_usepercent = math.floor(mem_inuse/mem_total*100) - - if padding then - if type(padding) == "table" then - mem_usepercent = helper.padd(mem_usepercent, padding[1]) - mem_inuse = helper.padd(mem_inuse, padding[2]) - mem_total = helper.padd(mem_total, padding[3]) - mem_free = helper.padd(mem_free, padding[4]) - else - mem_usepercent = helper.padd(mem_usepercent, padding) - mem_inuse = helper.padd(mem_inuse, padding) - mem_total = helper.padd(mem_total, padding) - mem_free = helper.padd(mem_free, padding) - end - end - - return {mem_usepercent, mem_inuse, mem_total, mem_free} -end - -widget_cache[widgets.mem] = {} --- }}} - ----- {{{ Swap widget type -function widgets.swap(format, padding) - -- Return SWAP usage values - local f = io.open('/proc/meminfo') - - ---- Get data - for line in f:lines() do - line = helper.splitbywhitespace(line) - - if line[1] == 'SwapTotal:' then - swap_total = math.floor(line[2]/1024) - elseif line[1] == 'SwapFree:' then - free = math.floor(line[2]/1024) - elseif line[1] == 'SwapCached:' then - cached = math.floor(line[2]/1024) - end - end - f:close() - - ---- Calculate percentage - swap_free=free+cached - swap_inuse=swap_total-swap_free - swap_usepercent = math.floor(swap_inuse/swap_total*100) - - if padding then - if type(padding) == "table" then - swap_usepercent = helper.padd(swap_usepercent, padding[1]) - swap_inuse = helper.padd(swap_inuse, padding[2]) - swap_total = helper.padd(swap_total, padding[3]) - swap_free = helper.padd(swap_free, padding[4]) - else - swap_usepercent = helper.padd(swap_usepercent, padding) - swap_inuse = helper.padd(swap_inuse, padding) - swap_total = helper.padd(swap_total, padding) - swap_free = helper.padd(swap_free, padding) - end - end - - return {swap_usepercent, swap_inuse, swap_total, swap_free} -end - -widget_cache[widgets.swap] = {} --- }}} - ----- {{{ Date widget type -function widgets.date(format) - -- Get format - if format == nil then - return os.date() - else - return os.date(format) - end -end --- }}} - ----- {{{ Filesystem widget type -function widgets.fs(format, padding) - local f = io.popen('df -hP') - local args = {} - - for line in f:lines() do - vars = helper.splitbywhitespace(line) - - if vars[1] ~= 'Filesystem' and #vars == 6 then - vars[5] = vars[5]:gsub('%%','') - - if padding then - if type(padding) == "table" then - vars[2] = helper.padd(vars[2], padding[1]) - vars[3] = helper.padd(vars[3], padding[2]) - vars[4] = helper.padd(vars[4], padding[3]) - vars[5] = helper.padd(vars[5], padding[4]) - else - vars[2] = helper.padd(vars[2], padding) - vars[3] = helper.padd(vars[3], padding) - vars[4] = helper.padd(vars[4], padding) - vars[5] = helper.padd(vars[5], padding) - end - end - - args['{'..vars[6]..' size}'] = vars[2] - args['{'..vars[6]..' used}'] = vars[3] - args['{'..vars[6]..' avail}'] = vars[4] - args['{'..vars[6]..' usep}'] = vars[5] - end - end - - f:close() - return args -end --- }}} - ----- {{{ Net widget type -function widgets.net(format, padding) - local f = io.open('/proc/net/dev') - args = {} - - for line in f:lines() do - line = helper.splitbywhitespace(line) - - local p = line[1]:find(':') - if p ~= nil then - name = line[1]:sub(0,p-1) - line[1] = line[1]:sub(p+1) - - if tonumber(line[1]) == nil then - line[1] = line[2] - line[9] = line[10] - end - - if padding then - args['{'..name..' rx}'] = helper.bytes_to_string(line[1], nil, padding) - args['{'..name..' tx}'] = helper.bytes_to_string(line[9], nil, padding) - else - args['{'..name..' rx}'] = helper.bytes_to_string(line[1]) - args['{'..name..' tx}'] = helper.bytes_to_string(line[9]) - end - - args['{'..name..' rx_b}'] = math.floor(line[1]*10)/10 - args['{'..name..' tx_b}'] = math.floor(line[9]*10)/10 - - args['{'..name..' rx_kb}'] = math.floor(line[1]/1024*10)/10 - args['{'..name..' tx_kb}'] = math.floor(line[9]/1024*10)/10 - - args['{'..name..' rx_mb}'] = math.floor(line[1]/1024/1024*10)/10 - args['{'..name..' tx_mb}'] = math.floor(line[9]/1024/1024*10)/10 - - args['{'..name..' rx_gb}'] = math.floor(line[1]/1024/1024/1024*10)/10 - args['{'..name..' tx_gb}'] = math.floor(line[9]/1024/1024/1024*10)/10 - - if nets[name] == nil then - nets[name] = {} - args['{'..name..' down}'] = 'n/a' - args['{'..name..' up}'] = 'n/a' - - args['{'..name..' down_b}'] = 0 - args['{'..name..' up_b}'] = 0 - - args['{'..name..' down_kb}'] = 0 - args['{'..name..' up_kb}'] = 0 - - args['{'..name..' down_mb}'] = 0 - args['{'..name..' up_mb}'] = 0 - - args['{'..name..' down_gb}'] = 0 - args['{'..name..' up_gb}'] = 0 - - nets[name].time = os.time() - else - interval = os.time()-nets[name].time - nets[name].time = os.time() - - down = (line[1]-nets[name][1])/interval - up = (line[9]-nets[name][2])/interval - - if padding then - args['{'..name..' down}'] = helper.bytes_to_string(down, true, padding) - args['{'..name..' up}'] = helper.bytes_to_string(up, true, padding) - else - args['{'..name..' down}'] = helper.bytes_to_string(down, true) - args['{'..name..' up}'] = helper.bytes_to_string(up, true) - end - - args['{'..name..' down_b}'] = math.floor(down*10)/10 - args['{'..name..' up_b}'] = math.floor(up*10)/10 - - args['{'..name..' down_kb}'] = math.floor(down/1024*10)/10 - args['{'..name..' up_kb}'] = math.floor(up/1024*10)/10 - - args['{'..name..' down_mb}'] = math.floor(down/1024/1024*10)/10 - args['{'..name..' up_mb}'] = math.floor(up/1024/1024*10)/10 - - args['{'..name..' down_gb}'] = math.floor(down/1024/1024/1024*10)/10 - args['{'..name..' up_gb}'] = math.floor(up/1024/1024/1024*10)/10 - end - - nets[name][1] = line[1] - nets[name][2] = line[9] - end - end - - f:close() - return args -end -widget_cache[widgets.net] = {} --- }}} - ----- {{{ Uptime widget type -function widgets.uptime(format, padding) - --Get uptime from /proc/uptime - local f = io.open("/proc/uptime") - uptime_line = f:read() - - f:close() - - args = {} - --/proc/uptime has the format " " - if uptime_line:find(" ") ~= nil then - - pend = uptime_line:find(" ",0,true) - - uptime_line_part = uptime_line:sub(0,pend-1) - - total_uptime = math.floor( tonumber(uptime_line_part) ) - - uptime_days = math.floor( total_uptime / (3600 * 24) ) - uptime_hours = math.floor( ( total_uptime % (3600 * 24) ) / 3600 ) - uptime_minutes = math.floor( ( ( total_uptime % (3600 * 24) ) % 3600 ) / 60 ) - uptime_seconds = math.floor( ( ( total_uptime % (3600 * 24) ) % 3600) % 60 ) - - if padding then - - if type(padding) == "table" then - total_uptime = helper.padd(total_uptime , padding[1]) - uptime_days = helper.padd(uptime_days , padding[2]) - uptime_hours = helper.padd(uptime_hours , padding[3]) - uptime_minutes = helper.padd(uptime_minutes , padding[4]) - uptime_seconds = helper.padd(uptime_seconds , padding[5]) - else - total_uptime = helper.padd(total_uptime , padding) - uptime_days = helper.padd(uptime_days , padding) - uptime_hours = helper.padd(uptime_hours , padding) - uptime_minutes = helper.padd(uptime_minutes , padding) - uptime_seconds = helper.padd(uptime_seconds , padding) - end - - end - end - - return {total_uptime, uptime_days, uptime_hours, uptime_minutes, uptime_seconds} - -end -widget_cache[widgets.uptime] = {} --- }}} - --- For backwards compatibility: custom function -widgets["function"] = function () - return {} -end - --- }}} - ----- {{{ Main functions ----- {{{ Register widget -function register(widget, wtype, format, timer, field, padd) - local reg = {} - local widget = widget - - -- Set properties - reg.type = wtype - reg.format = format - reg.timer = timer - reg.field = field - reg.padd = padd - reg.widget = widget - - -- Update function - reg.update = function () - update(widget, reg) - end - - -- Default to timer=1 - if reg.timer == nil then - reg.timer = 1 - end - - -- Allow using a string widget type - if type(reg.type) == "string" then - reg.type = widgets[reg.type] - end - - -- Register reg object - regregister(reg) - - -- Return reg object for reuse - return reg -end --- }}} - --- {{{ Register from reg object -function regregister(reg) - if not reg.running then - -- Put widget in table - if registered[reg.widget] == nil then - registered[reg.widget] = {} - table.insert(registered[reg.widget], reg) - else - already = false - - for w, i in pairs(registered) do - if w == reg.widget then - for k,v in pairs(i) do - if v == reg then - already = true - break - end - end - - if already then - break - end - end - end - - if not already then - table.insert(registered[reg.widget], reg) - end - end - - -- Start timer - if reg.timer > 0 then - awful.hooks.timer.register(reg.timer, reg.update) - end - - -- Initial update - reg.update() - - -- Set running - reg.running = true - end -end --- }}} - --- {{{ Unregister widget -function unregister(widget, keep, reg) - if reg == nil then - for w, i in pairs(registered) do - if w == widget then - for k,v in pairs(i) do - reg = unregister(w, keep, v) - end - end - end - - return reg - end - - if not keep then - for w, i in pairs(registered) do - if w == widget then - for k,v in pairs(i) do - if v == reg then - table.remove(registered[w], k) - end - end - end - end - end - - awful.hooks.timer.unregister(reg.update) - - reg.running = false - return reg -end --- }}} - --- {{{ Suspend wicked, halt all widget updates -function suspend() - for w, i in pairs(registered) do - for k,v in pairs(i) do - unregister(w, true, v) - end - end -end --- }}} - --- {{{ Activate wicked, restart all widget updates -function activate(widget) - for w, i in pairs(registered) do - if widget == nil or w == widget then - for k,v in pairs(i) do - regregister(v) - end - end - end -end --- }}} - --- {{{ Enable caching for a widget type -function enable_caching(widget) - if widget_cache[widget] == nil then - widget_cache[widget] = {} - end -end --- }}} - ----- {{{ Update widget -function update(widget, reg, disablecache) - -- Check if there are any equal widgets - if reg == nil then - for w, i in pairs(registered) do - if w == widget then - for k,v in pairs(i) do - update(w, v, disablecache) - end - end - end - - return - end - - local t = os.time() - local data = {} - - -- Check if we have output chached for this widget, - -- newer than last widget update. - if widget_cache[reg.type] ~= nil then - local c = widget_cache[reg.type] - - if c.time == nil or c.time <= t-reg.timer or disablecache then - c.time = t - c.data = reg.type(reg.format, reg.padd) - end - - data = c.data - else - data = reg.type(reg.format, reg.padd) - end - - if type(data) == "table" then - if type(reg.format) == "string" then - data = helper.format(reg.format, data) - elseif type(reg.format) == "function" then - data = reg.format(widget, data) - end - end - - if reg.field == nil then - widget.text = data - elseif widget.plot_data_add ~= nil then - widget:plot_data_add(reg.field, tonumber(data)) - elseif widget.bar_data_add ~= nil then - widget:bar_data_add(reg.field, tonumber(data)) - end - return data -end - --- }}} - --- }}} - --- vim: set filetype=lua fdm=marker tabstop=4 shiftwidth=4 nu: From 673dc4e056f208f343e65cecef75455110216787 Mon Sep 17 00:00:00 2001 From: crater2150 Date: Sun, 7 Mar 2010 02:19:55 +0100 Subject: [PATCH 11/36] runraise replaces default spawning --- runraise.lua | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 runraise.lua diff --git a/runraise.lua b/runraise.lua new file mode 100644 index 0000000..6561f18 --- /dev/null +++ b/runraise.lua @@ -0,0 +1,44 @@ +--- Spawns cmd if no client can be found matching properties +-- If such a client can be found, pop to first tag where it is visible, and give it focus +-- @param cmd the command to execute +-- @param properties a table of properties to match against clients. Possible entries: any properties of the client object + +function runraise(cmd, properties) + local clients = client.get() + local focused = awful.client.next(0) + local findex = 0 + local matched_clients = {} + local n = 0 + for i, c in pairs(clients) do + --make an array of matched clients + if awful.rules.match(properties, c) then + n = n + 1 + matched_clients[n] = c + if c == focused then + findex = n + end + end + end + if n > 0 then + local c = matched_clients[1] + -- if the focused window matched switch focus to next in list + if 0 < findex and findex < n then + c = matched_clients[findex+1] + end + local ctags = c:tags() + if table.getn(ctags) == 0 then + -- ctags is empty, show client on current tag + local curtag = awful.tag.selected() + awful.client.movetotag(curtag, c) + else + -- Otherwise, pop to first tag client is visible on + awful.tag.viewonly(ctags[1]) + end + -- And then focus the client + client.focus = c + c:raise() + return + end + awful.util.spawn(cmd) +end + From 6c337386223238cb8639eedefe7bf5cd3d3397e4 Mon Sep 17 00:00:00 2001 From: crater2150 Date: Sun, 7 Mar 2010 02:22:40 +0100 Subject: [PATCH 12/36] teardrop floating by default --- rc.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rc.lua b/rc.lua index be54d68..83109ca 100644 --- a/rc.lua +++ b/rc.lua @@ -292,7 +292,7 @@ globalkeys = awful.util.table.join( awful.key({ modkey, "Shift" }, "q", awesome.quit), -- Audio control - awful.key({ }, "Print", function () teardrop("sakura -e alsamixer","top","center", 0.99, 0.4)end ), + awful.key({ }, "Print", function () teardrop("sakura --class=Teardrop -e alsamixer","top","center", 0.99, 0.4)end ), awful.key({ }, "XF86AudioLowerVolume", function () awful.util.spawn("amixer set Front 2dB-")end ), awful.key({ }, "XF86AudioRaiseVolume", function () awful.util.spawn("amixer set Front 2dB+")end ), awful.key({ }, "XF86AudioMute", function () awful.util.spawn("amixer set Front toggle") end), @@ -309,7 +309,7 @@ globalkeys = awful.util.table.join( -- Prompt awful.key({ modkey }, "r", function () obvious.popup_run_prompt.run_prompt() end), awful.key({ }, "Scroll_Lock", function () awful.util.spawn("wli") end), - awful.key({ }, "F12", function () teardrop("sakura -e 'screen -l'","center","center", 0.99, 0.7)end ), + awful.key({ }, "F12", function () teardrop("sakura --class=Teardrop -e 'screen -l'","center","center", 0.99, 0.7)end ), --{{{Default @@ -409,7 +409,7 @@ awful.rules.rules = { properties = { floating = true, ontop = true, focus = true } }, - { rule = { class = "DockApp" }, + { rule = { class = "Teardrop" }, properties = { floating = true, size_hints_honor = true } }, { rule = { class = "pinentry" }, From 369a8750917c1086abeaab1ffd0e77eb7b4c929d Mon Sep 17 00:00:00 2001 From: crater2150 Date: Sun, 30 May 2010 22:24:50 +0200 Subject: [PATCH 13/36] update --- rc.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rc.lua b/rc.lua index 83109ca..7a8180a 100644 --- a/rc.lua +++ b/rc.lua @@ -410,8 +410,7 @@ awful.rules.rules = { ontop = true, focus = true } }, { rule = { class = "Teardrop" }, - properties = { floating = true, - size_hints_honor = true } }, + properties = { floating = true } }, { rule = { class = "pinentry" }, properties = { floating = true } }, { rule = { class = "gimp" }, @@ -433,6 +432,8 @@ awful.rules.rules = { properties = { tag = tags[1][7] } }, { rule = { class = "Xhtop" }, properties = { tag = tags[1][22] } }, + --{ rule = { class = "OpenOffice.org 3.2" }, + --properties = { floating = false } }, } -- }}} From d3fa48bad458b0f714dcbcebd06c4093b1a1a961 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 6 Jun 2010 02:22:14 +0000 Subject: [PATCH 14/36] submodules configured --- .gitmodules | 6 ++++++ obvious | 2 +- vicious | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 .gitmodules diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..7757f61 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,6 @@ +[submodule "obvious"] + path = obvious + url = git://git.mercenariesguild.net/obvious.git +[submodule "vicious"] + path = vicious + url = http://git.sysphere.org/vicious diff --git a/obvious b/obvious index 58b3b5d..565f11c 160000 --- a/obvious +++ b/obvious @@ -1 +1 @@ -Subproject commit 58b3b5dae420955e4e815fc70744ee6ee5442565 +Subproject commit 565f11c05dd28a2bfe8a96a6ec0950b970f5abcd diff --git a/vicious b/vicious index 0d73f6d..ca1d8d7 160000 --- a/vicious +++ b/vicious @@ -1 +1 @@ -Subproject commit 0d73f6d8ae32f1cd48ce9f089b902eb0877605e1 +Subproject commit ca1d8d79e55b7addc28dc442832815692b01b894 From 9e434b8a593ad5bc1f2fc3568181c6302a54abf9 Mon Sep 17 00:00:00 2001 From: crater2150 Date: Sun, 6 Jun 2010 02:56:07 +0000 Subject: [PATCH 15/36] modularized config file --- bindings.lua | 170 ++++++++++++++ runraise.lua => helpers.lua | 9 + rc.lua | 448 +----------------------------------- rules.lua | 45 ++++ signals.lua | 31 +++ tags.lua | 40 ++++ wibox.lua | 91 ++++++++ 7 files changed, 397 insertions(+), 437 deletions(-) create mode 100644 bindings.lua rename runraise.lua => helpers.lua (85%) create mode 100644 rules.lua create mode 100644 signals.lua create mode 100644 tags.lua create mode 100644 wibox.lua diff --git a/bindings.lua b/bindings.lua new file mode 100644 index 0000000..ea14360 --- /dev/null +++ b/bindings.lua @@ -0,0 +1,170 @@ + +-- {{{ 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({ }, "XF86Word", awful.tag.viewprev ), + awful.key({ }, "XF86WebCam", awful.tag.viewnext ), + awful.key({ }, "XF86Away", awful.tag.history.restore), + + 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(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), + awful.key({ "Mod1", }, "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, }, "f", function () awful.util.spawn("firefox") end), +-- awful.key({ modkey, }, "t", function () awful.util.spawn("thunderbird") end), +-- awful.key({ modkey, }, "p", function () awful.util.spawn("pidgin") end), +-- awful.key({ modkey, }, "s", function () awful.util.spawn("sunbird") end), +-- awful.key({ modkey, }, "g", function () awful.util.spawn("gmpc") end), + awful.key({ modkey, }, "f", function () runraise("firefox", { class = "Firefox" }) end), + awful.key({ modkey, }, "t", function () runraise("thunderbird", { class = "Thunderbird" }) end), + awful.key({ modkey, }, "p", function () runraise("pidgin", { class = "Pidgin" }) end), + awful.key({ modkey, }, "s", function () runraised("sunbird", { class = "Sunbirdi-bin" }) end), + awful.key({ modkey, }, "g", function () runraise("gmpc", { class = "Gmpc" }) end), + awful.key({ }, "XF86Mail", function () awful.util.spawn("xset dpms force off") end), + awful.key({ }, "XF86Mail", function () awful.util.spawn("xset dpms force off") end), + awful.key({ modkey }, "XF86Mail", function () awful.util.spawn("urslock") end), + awful.key({ modkey, "Control" }, "r", awesome.restart), + awful.key({ modkey, "Shift" }, "q", awesome.quit), + + -- Audio control + awful.key({ }, "Print", function () teardrop("sakura --class=Teardrop -e alsamixer","top","center", 0.99, 0.4)end ), + awful.key({ }, "XF86AudioLowerVolume", function () awful.util.spawn("amixer set Front 2dB-")end ), + awful.key({ }, "XF86AudioRaiseVolume", function () awful.util.spawn("amixer set Front 2dB+")end ), + awful.key({ }, "XF86AudioMute", function () awful.util.spawn("amixer set Front toggle") end), + awful.key({ modkey , "Shift" }, "m", function () awful.util.spawn("mpdmenu -a") end), + awful.key({ modkey , "Control" }, "m", function () awful.util.spawn("mpdmenu -t") end), + awful.key({ modkey }, "m", function () awful.util.spawn("mpc toggle") end), + awful.key({ modkey }, "n", function () awful.util.spawn("mpc next") end), + awful.key({ modkey , "Shift"}, "n", function () awful.util.spawn("mpc prev") end), + awful.key({ }, "XF86AudioPlay", function () awful.util.spawn("mpc toggle") end), + awful.key({ }, "XF86AudioNext", function () awful.util.spawn("mpc next") end), + awful.key({ }, "XF86AudioPrev", function () awful.util.spawn("mpc prev") end), + awful.key({ }, "XF86AudioStop", function () awful.util.spawn("mpdmenu -a") end), + awful.key({ modkey , "Control" }, "n", function () awful.util.spawn("mpdmenu -j") end), + -- Prompt + awful.key({ modkey }, "r", function () obvious.popup_run_prompt.run_prompt() end), + awful.key({ }, "Scroll_Lock", function () awful.util.spawn("wli") end), + awful.key({ }, "F12", function () teardrop("sakura --class=Teardrop -e 'screen -l'","center","center", 0.99, 0.7)end ), + + + --{{{Default + 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, 0) end) + + --}}} +) + +clientkeys = awful.util.table.join( + awful.key({ modkey, "Shift" }, "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", function (c) c.ontop = not c.ontop end), + awful.key({ modkey, }, "a", function (c) c.sticky = not c.sticky end), + awful.key({ modkey, "Shift" }, "r", function (c) c:redraw() end), + awful.key({ modkey, }, "n", function (c) c.minimized = not c.minimized end) +) + +-- Compute the maximum number of digit we need, limited to 9 +keynumber = 0 +for s = 1, screen.count() do + keynumber = math.min(22, 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. +-- FKeys: 67-78 +for i = 1, keynumber do + if i < 10 then + k = "#" .. i + 9 + elseif i == 10 then + k = "#19" + elseif i > 10 then + k = "F" .. i - 10 + end + globalkeys = awful.util.table.join(globalkeys, + awful.key({ modkey }, k, + function () + local screen = mouse.screen + if tags[screen][i] then + awful.tag.viewonly(tags[screen][i]) + end + end), + awful.key({ modkey, "Control" }, k, + function () + local screen = mouse.screen + if tags[screen][i] then + awful.tag.viewtoggle(tags[screen][i]) + end + end), + awful.key({ modkey, "Shift" }, k, + 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" }, k, + 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) +-- }}} diff --git a/runraise.lua b/helpers.lua similarity index 85% rename from runraise.lua rename to helpers.lua index 6561f18..0c20f12 100644 --- a/runraise.lua +++ b/helpers.lua @@ -42,3 +42,12 @@ function runraise(cmd, properties) awful.util.spawn(cmd) end +-- Returns true if all pairs in table1 are present in table2 +function match (table1, table2) + for k, v in pairs(table1) do + if table2[k] ~= v and not table2[k]:find(v) then + return false + end + end + return true +end diff --git a/rc.lua b/rc.lua index 7a8180a..b72fdb4 100644 --- a/rc.lua +++ b/rc.lua @@ -1,3 +1,7 @@ +terminal = "sakura -e screen" +editor_cmd = "sakura -e vim" +modkey = "Mod4" + -- Standard awesome library require("awful") require("awful.autofocus") @@ -8,73 +12,12 @@ require("teardrop") require("obvious.battery") require("obvious.popup_run_prompt") require("vicious") ---- Spawns cmd if no client can be found matching properties --- If such a client can be found, pop to first tag where it is visible, and give it focus --- @param cmd the command to execute --- @param properties a table of properties to match against clients. Possible entries: any properties of the client object -function runraise(cmd, properties) - local clients = client.get() - local focused = awful.client.next(0) - local findex = 0 - local matched_clients = {} - local n = 0 - for i, c in pairs(clients) do - --make an array of matched clients - if match(properties, c) then - n = n + 1 - matched_clients[n] = c - if c == focused then - findex = n - end - end - end - if n > 0 then - local c = matched_clients[1] - -- if the focused window matched switch focus to next in list - if 0 < findex and findex < n then - c = matched_clients[findex+1] - end - local ctags = c:tags() - if table.getn(ctags) == 0 then - -- ctags is empty, show client on current tag - local curtag = awful.tag.selected() - awful.client.movetotag(curtag, c) - else - -- Otherwise, pop to first tag client is visible on - awful.tag.viewonly(ctags[1]) - end - -- And then focus the client - client.focus = c - c:raise() - return - end - awful.util.spawn(cmd) -end --- Returns true if all pairs in table1 are present in table2 -function match (table1, table2) - for k, v in pairs(table1) do - if table2[k] ~= v and not table2[k]:find(v) then - return false - end - end - return true -end --- {{{ Variable definitions + -- Themes define colours, icons, and wallpapers beautiful.init("/home/crater2150/.config/awesome/zenburn/theme.lua") --- This is used later as the default terminal and editor to run. -terminal = "sakura -e screen" -editor_cmd = "sakura -e vim" - --- 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 = @@ -89,381 +32,12 @@ layouts = awful.layout.suit.max.fullscreen, awful.layout.suit.floating } --- }}} --- {{{ Tags -local tags = {} -tags.setup = { - { name = "1:⚙", layout = layouts[1] }, - { name = "2:⌘", layout = layouts[7] }, - { name = "3:☻", layout = layouts[2], mwfact = 0.80 }, - { name = "4:✉", layout = layouts[7] }, - { name = "5:☑", layout = layouts[7] }, - { name = "6:♫", layout = layouts[1] }, - { name = "7:☣", layout = layouts[1] }, - { name = "8:☕", layout = layouts[1] }, - { name = "9:⚂", layout = layouts[1] }, - { name = "0:☠", layout = layouts[1] }, - { name = "F1:☭", layout = layouts[1] }, - { name = "F2:♚", layout = layouts[1] }, - { name = "F3:♛", layout = layouts[1] }, - { name = "F4:♜", layout = layouts[1] }, - { name = "F5:♝", layout = layouts[1] }, - { name = "F6:♞", layout = layouts[1] }, - { name = "F7:♟", layout = layouts[1] }, - { name = "F8:⚖", layout = layouts[1] }, - { name = "F9:⚛", layout = layouts[1] }, - { name = "F10:⚡", layout = layouts[1] }, - { name = "F11:⚰", layout = layouts[1] }, - { name = "F12:⚙", layout = layouts[1] } -} - -for s = 1, screen.count() do - tags[s] = {} - for i, t in ipairs(tags.setup) do - tags[s][i] = tag({ name = t.name }) - tags[s][i].screen = s - awful.tag.setproperty(tags[s][i], "layout", t.layout) - awful.tag.setproperty(tags[s][i], "mwfact", t.mwfact) - awful.tag.setproperty(tags[s][i], "hide", t.hide) - end - tags[s][1].selected = true -end --- }}} - --- {{{ Reusable separators -spacer = widget({ type = "textbox", name = "spacer" }) -spacer.text = " " - -separator = widget({ type = "textbox", name = "separator", align = "center" }) -separator.text = " )( " --- }}} - --- {{{ Wibox - ---popup run - --- Create a textclock widget ---clock = awful.widget.textclock({ align = "right" }) -mysystray = widget({ type = "systray" }) - -clock = widget({ type = "textbox" }) -vicious.register(clock, vicious.widgets.date, "%b %d, %R", 60) - -memwidget = widget({ type = "textbox" }) -vicious.register(memwidget, vicious.widgets.mem, "⌸ $1% ($2MB / $3MB) ", 13) - ---batwidget = obvious.battery(); -batwidget = widget({ type = "textbox" }) -vicious.register(batwidget, vicious.widgets.batat, "⌁ $1$2% - $3", 61) - -cpuwidget = awful.widget.progressbar() -cpulabel = widget({ type = "textbox" }) -cpuwidget:set_width(50) -cpuwidget:set_background_color("#494B4F") -cpuwidget:set_color("#FF5656") -cpuwidget:set_gradient_colors({ "#FF5656", "#88A175", "#AECF96" }) -vicious.register(cpuwidget, vicious.widgets.cpu, "$1",41) -vicious.register(cpulabel, vicious.widgets.cpu, "CPU: $1%") +dofile "./helpers.lua" +dofile "./tags.lua" +dofile "./wibox.lua" +dofile "./bindings.lua" +dofile "./rules.lua" +dofile "./signals.lua" -wlanwidget = widget({ type = "textbox" }) -vicious.register(wlanwidget, vicious.widgets.wifi, "WLAN ${ssid} @ ${sign}, Q:${link}/70", 31, "wlan0") --- Create a wibox for each screen and add it -leftwibox = {} -rightwibox = {} -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) - ) - -for s = 1, screen.count() do - -- 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 the wibox - leftwibox[s] = awful.wibox({ position = "left", screen = s }) - rightwibox[s] = awful.wibox({ position = "right", screen = s }) - -- Add widgets to the wibox - order matters - leftwibox[s].widgets = { - mytaglist[s], - mylayoutbox[s], - spacer, - layout = awful.widget.layout.horizontal.rightleft - } - rightwibox[s].widgets = { - { - clock, - separator, spacer, memwidget, - separator, spacer, batwidget, - separator, spacer, wlanwidget, - separator, spacer, cpulabel, cpuwidget, - spacer, - layout = awful.widget.layout.horizontal.leftright - }, - separator, spacer, s == 1 and mysystray or nil, - layout = awful.widget.layout.horizontal.leftright - } -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({ }, "XF86Word", awful.tag.viewprev ), - awful.key({ }, "XF86WebCam", awful.tag.viewnext ), - awful.key({ }, "XF86Away", awful.tag.history.restore), - - 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(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), - awful.key({ "Mod1", }, "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, }, "f", function () awful.util.spawn("firefox") end), --- awful.key({ modkey, }, "t", function () awful.util.spawn("thunderbird") end), --- awful.key({ modkey, }, "p", function () awful.util.spawn("pidgin") end), --- awful.key({ modkey, }, "s", function () awful.util.spawn("sunbird") end), --- awful.key({ modkey, }, "g", function () awful.util.spawn("gmpc") end), - awful.key({ modkey, }, "f", function () runraise("firefox", { class = "Firefox" }) end), - awful.key({ modkey, }, "t", function () runraise("thunderbird", { class = "Thunderbird" }) end), - awful.key({ modkey, }, "p", function () runraise("pidgin", { class = "Pidgin" }) end), - awful.key({ modkey, }, "s", function () runraised("sunbird", { class = "Sunbirdi-bin" }) end), - awful.key({ modkey, }, "g", function () runraise("gmpc", { class = "Gmpc" }) end), - awful.key({ }, "XF86Mail", function () awful.util.spawn("xset dpms force off") end), - awful.key({ }, "XF86Mail", function () awful.util.spawn("xset dpms force off") end), - awful.key({ modkey }, "XF86Mail", function () awful.util.spawn("urslock") end), - awful.key({ modkey, "Control" }, "r", awesome.restart), - awful.key({ modkey, "Shift" }, "q", awesome.quit), - - -- Audio control - awful.key({ }, "Print", function () teardrop("sakura --class=Teardrop -e alsamixer","top","center", 0.99, 0.4)end ), - awful.key({ }, "XF86AudioLowerVolume", function () awful.util.spawn("amixer set Front 2dB-")end ), - awful.key({ }, "XF86AudioRaiseVolume", function () awful.util.spawn("amixer set Front 2dB+")end ), - awful.key({ }, "XF86AudioMute", function () awful.util.spawn("amixer set Front toggle") end), - awful.key({ modkey , "Shift" }, "m", function () awful.util.spawn("mpdmenu -a") end), - awful.key({ modkey , "Control" }, "m", function () awful.util.spawn("mpdmenu -t") end), - awful.key({ modkey }, "m", function () awful.util.spawn("mpc toggle") end), - awful.key({ modkey }, "n", function () awful.util.spawn("mpc next") end), - awful.key({ modkey , "Shift"}, "n", function () awful.util.spawn("mpc prev") end), - awful.key({ }, "XF86AudioPlay", function () awful.util.spawn("mpc toggle") end), - awful.key({ }, "XF86AudioNext", function () awful.util.spawn("mpc next") end), - awful.key({ }, "XF86AudioPrev", function () awful.util.spawn("mpc prev") end), - awful.key({ }, "XF86AudioStop", function () awful.util.spawn("mpdmenu -a") end), - awful.key({ modkey , "Control" }, "n", function () awful.util.spawn("mpdmenu -j") end), - -- Prompt - awful.key({ modkey }, "r", function () obvious.popup_run_prompt.run_prompt() end), - awful.key({ }, "Scroll_Lock", function () awful.util.spawn("wli") end), - awful.key({ }, "F12", function () teardrop("sakura --class=Teardrop -e 'screen -l'","center","center", 0.99, 0.7)end ), - - - --{{{Default - 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, 0) end) - - --}}} -) - -clientkeys = awful.util.table.join( - awful.key({ modkey, "Shift" }, "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", function (c) c.ontop = not c.ontop end), - awful.key({ modkey, }, "a", function (c) c.sticky = not c.sticky end), - awful.key({ modkey, "Shift" }, "r", function (c) c:redraw() end), - awful.key({ modkey, }, "n", function (c) c.minimized = not c.minimized end) -) - --- Compute the maximum number of digit we need, limited to 9 -keynumber = 0 -for s = 1, screen.count() do - keynumber = math.min(22, 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. --- FKeys: 67-78 -for i = 1, keynumber do - if i < 10 then - k = "#" .. i + 9 - elseif i == 10 then - k = "#19" - elseif i > 10 then - k = "F" .. i - 10 - end - globalkeys = awful.util.table.join(globalkeys, - awful.key({ modkey }, k, - function () - local screen = mouse.screen - if tags[screen][i] then - awful.tag.viewonly(tags[screen][i]) - end - end), - awful.key({ modkey, "Control" }, k, - function () - local screen = mouse.screen - if tags[screen][i] then - awful.tag.viewtoggle(tags[screen][i]) - end - end), - awful.key({ modkey, "Shift" }, k, - 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" }, k, - 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, - size_hints_honor = false, - keys = clientkeys, - buttons = clientbuttons } }, - { rule = { class = "MPlayer" }, - properties = { floating = true, - size_hints_honor = true } }, - { rule = { class = "Passprompt" }, - properties = { floating = true, - ontop = true, - focus = true } }, - { rule = { class = "Teardrop" }, - properties = { floating = true } }, - { rule = { class = "pinentry" }, - properties = { floating = true } }, - { rule = { class = "gimp" }, - properties = { floating = true } }, - -- Set Firefox to always map on tags number 2 of screen 1. - { rule = { class = "Firefox" }, - properties = { tag = tags[1][2] } }, - { rule = { class = "Pidgin" }, - properties = { tag = tags[1][3] } }, - { rule = { role = "buddy_list" }, - properties = { master = true } }, - { rule = { class = "Thunderbird" }, - properties = { tag = tags[1][4] } }, - { rule = { class = "Sunbird-bin" }, - properties = { tag = tags[1][5] } }, - { rule = { class = "Gmpc" }, - properties = { tag = tags[1][6] } }, - { rule = { class = "Deluge" }, - properties = { tag = tags[1][7] } }, - { rule = { class = "Xhtop" }, - properties = { tag = tags[1][22] } }, - --{ rule = { class = "OpenOffice.org 3.2" }, - --properties = { floating = false } }, -} --- }}} - --- {{{ 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) --- }}} diff --git a/rules.lua b/rules.lua new file mode 100644 index 0000000..903b24c --- /dev/null +++ b/rules.lua @@ -0,0 +1,45 @@ + +-- {{{ Rules +awful.rules.rules = { + -- All clients will match this rule. + { rule = { }, + properties = { border_width = beautiful.border_width, + border_color = beautiful.border_normal, + focus = true, + size_hints_honor = false, + keys = clientkeys, + buttons = clientbuttons } }, + { rule = { class = "MPlayer" }, + properties = { floating = true, + size_hints_honor = true } }, + { rule = { class = "Passprompt" }, + properties = { floating = true, + ontop = true, + focus = true } }, + { rule = { class = "Teardrop" }, + properties = { floating = true } }, + { rule = { class = "pinentry" }, + properties = { floating = true } }, + { rule = { class = "gimp" }, + properties = { floating = true } }, + -- Set Firefox to always map on tags number 2 of screen 1. + { rule = { class = "Firefox" }, + properties = { tag = tags[1][2] } }, + { rule = { class = "Pidgin" }, + properties = { tag = tags[1][3] } }, + { rule = { role = "buddy_list" }, + properties = { master = true } }, + { rule = { class = "Thunderbird" }, + properties = { tag = tags[1][4] } }, + { rule = { class = "Sunbird-bin" }, + properties = { tag = tags[1][5] } }, + { rule = { class = "Gmpc" }, + properties = { tag = tags[1][6] } }, + { rule = { class = "Deluge" }, + properties = { tag = tags[1][7] } }, + { rule = { class = "Xhtop" }, + properties = { tag = tags[1][22] } }, + --{ rule = { class = "OpenOffice.org 3.2" }, + --properties = { floating = false } }, +} +-- }}} diff --git a/signals.lua b/signals.lua new file mode 100644 index 0000000..8f5f0c2 --- /dev/null +++ b/signals.lua @@ -0,0 +1,31 @@ + +-- {{{ 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) +-- }}} diff --git a/tags.lua b/tags.lua new file mode 100644 index 0000000..836ed58 --- /dev/null +++ b/tags.lua @@ -0,0 +1,40 @@ + +-- {{{ Tags +local tags = {} +tags.setup = { + { name = "1:⚙", layout = layouts[1] }, + { name = "2:⌘", layout = layouts[7] }, + { name = "3:☻", layout = layouts[2], mwfact = 0.80 }, + { name = "4:✉", layout = layouts[7] }, + { name = "5:☑", layout = layouts[7] }, + { name = "6:♫", layout = layouts[1] }, + { name = "7:☣", layout = layouts[1] }, + { name = "8:☕", layout = layouts[1] }, + { name = "9:⚂", layout = layouts[1] }, + { name = "0:☠", layout = layouts[1] }, + { name = "F1:☭", layout = layouts[1] }, + { name = "F2:♚", layout = layouts[1] }, + { name = "F3:♛", layout = layouts[1] }, + { name = "F4:♜", layout = layouts[1] }, + { name = "F5:♝", layout = layouts[1] }, + { name = "F6:♞", layout = layouts[1] }, + { name = "F7:♟", layout = layouts[1] }, + { name = "F8:⚖", layout = layouts[1] }, + { name = "F9:⚛", layout = layouts[1] }, + { name = "F10:⚡", layout = layouts[1] }, + { name = "F11:⚰", layout = layouts[1] }, + { name = "F12:⚙", layout = layouts[1] } +} + +for s = 1, screen.count() do + tags[s] = {} + for i, t in ipairs(tags.setup) do + tags[s][i] = tag({ name = t.name }) + tags[s][i].screen = s + awful.tag.setproperty(tags[s][i], "layout", t.layout) + awful.tag.setproperty(tags[s][i], "mwfact", t.mwfact) + awful.tag.setproperty(tags[s][i], "hide", t.hide) + end + tags[s][1].selected = true +end +-- }}} diff --git a/wibox.lua b/wibox.lua new file mode 100644 index 0000000..0afbebd --- /dev/null +++ b/wibox.lua @@ -0,0 +1,91 @@ + +-- {{{ Reusable separators +spacer = widget({ type = "textbox", name = "spacer" }) +spacer.text = " " + +separator = widget({ type = "textbox", name = "separator", align = "center" }) +separator.text = " )( " +-- }}} + +-- {{{ Wibox + +--popup run + +-- Create a textclock widget +--clock = awful.widget.textclock({ align = "right" }) +mysystray = widget({ type = "systray" }) + +clock = widget({ type = "textbox" }) +vicious.register(clock, vicious.widgets.date, "%b %d, %R", 60) + +memwidget = widget({ type = "textbox" }) +vicious.register(memwidget, vicious.widgets.mem, "⌸ $1% ($2MB / $3MB) ", 13) + +--batwidget = obvious.battery(); +batwidget = widget({ type = "textbox" }) +vicious.register(batwidget, vicious.widgets.batat, "⌁ $1$2% - $3", 61) + +cpuwidget = awful.widget.progressbar() +cpulabel = widget({ type = "textbox" }) +cpuwidget:set_width(50) +cpuwidget:set_background_color("#494B4F") +cpuwidget:set_color("#FF5656") +cpuwidget:set_gradient_colors({ "#FF5656", "#88A175", "#AECF96" }) +vicious.register(cpuwidget, vicious.widgets.cpu, "$1",41) +vicious.register(cpulabel, vicious.widgets.cpu, "CPU: $1%") + + +wlanwidget = widget({ type = "textbox" }) +vicious.register(wlanwidget, vicious.widgets.wifi, "WLAN ${ssid} @ ${sign}, Q:${link}/70", 31, "wlan0") +-- Create a wibox for each screen and add it +leftwibox = {} +rightwibox = {} +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) + ) + +for s = 1, screen.count() do + -- 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 the wibox + leftwibox[s] = awful.wibox({ position = "left", screen = s }) + rightwibox[s] = awful.wibox({ position = "right", screen = s }) + -- Add widgets to the wibox - order matters + leftwibox[s].widgets = { + mytaglist[s], + mylayoutbox[s], + spacer, + layout = awful.widget.layout.horizontal.rightleft + } + rightwibox[s].widgets = { + { + clock, + separator, spacer, memwidget, + separator, spacer, batwidget, + separator, spacer, wlanwidget, + separator, spacer, cpulabel, cpuwidget, + spacer, + layout = awful.widget.layout.horizontal.leftright + }, + separator, spacer, s == 1 and mysystray or nil, + layout = awful.widget.layout.horizontal.leftright + } +end +-- }}} From 7589790d73234403334fb06583aca3929c2abc99 Mon Sep 17 00:00:00 2001 From: crater2150 Date: Sun, 6 Jun 2010 03:37:20 +0000 Subject: [PATCH 16/36] bugfix path --- rc.lua | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/rc.lua b/rc.lua index b72fdb4..254a1fa 100644 --- a/rc.lua +++ b/rc.lua @@ -33,11 +33,13 @@ layouts = awful.layout.suit.floating } -dofile "./helpers.lua" -dofile "./tags.lua" -dofile "./wibox.lua" -dofile "./bindings.lua" -dofile "./rules.lua" -dofile "./signals.lua" +MY_PATH = os.getenv("HOME") .. "/.config/awesome/" + +dofile (MY_PATH .. "helpers.lua") +dofile (MY_PATH .. "tags.lua") +dofile (MY_PATH .. "wibox.lua") +dofile (MY_PATH .. "bindings.lua") +dofile (MY_PATH .. "rules.lua") +dofile (MY_PATH .. "signals.lua") From 4692e9aed402a49d674ccbe026b34b292f934701 Mon Sep 17 00:00:00 2001 From: crater2150 Date: Mon, 7 Jun 2010 09:05:22 +0000 Subject: [PATCH 17/36] updated --- rc.lua | 1 - tags.lua | 2 +- zenburn/theme.lua | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/rc.lua b/rc.lua index 254a1fa..9f315b4 100644 --- a/rc.lua +++ b/rc.lua @@ -9,7 +9,6 @@ require("awful.rules") require("beautiful") require("naughty") require("teardrop") -require("obvious.battery") require("obvious.popup_run_prompt") require("vicious") diff --git a/tags.lua b/tags.lua index 836ed58..ec24163 100644 --- a/tags.lua +++ b/tags.lua @@ -1,6 +1,6 @@ -- {{{ Tags -local tags = {} +tags = {} tags.setup = { { name = "1:⚙", layout = layouts[1] }, { name = "2:⌘", layout = layouts[7] }, diff --git a/zenburn/theme.lua b/zenburn/theme.lua index 756d611..141bc25 100644 --- a/zenburn/theme.lua +++ b/zenburn/theme.lua @@ -8,7 +8,7 @@ -- {{{ Main theme = {} -theme.wallpaper_cmd = { "awsetbg -a /home/crater2150/.config/awesome/wallpaper" } +theme.wallpaper_cmd = { "nitrogen --restore" } -- }}} -- {{{ Styles From ab55d384dceff5028de8225c468a1c32d8c8d229 Mon Sep 17 00:00:00 2001 From: crater2150 Date: Thu, 17 Jun 2010 20:20:38 +0200 Subject: [PATCH 18/36] vicious --- vicious | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vicious b/vicious index ca1d8d7..0d73f6d 160000 --- a/vicious +++ b/vicious @@ -1 +1 @@ -Subproject commit ca1d8d79e55b7addc28dc442832815692b01b894 +Subproject commit 0d73f6d8ae32f1cd48ce9f089b902eb0877605e1 From 3cc330e234b76031ab07bef06c8853a50c6d7529 Mon Sep 17 00:00:00 2001 From: crater2150 Date: Fri, 18 Jun 2010 23:13:19 +0200 Subject: [PATCH 19/36] added claws-mail rule --- rules.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rules.lua b/rules.lua index 903b24c..fb78759 100644 --- a/rules.lua +++ b/rules.lua @@ -31,6 +31,8 @@ awful.rules.rules = { properties = { master = true } }, { rule = { class = "Thunderbird" }, properties = { tag = tags[1][4] } }, + { rule = { class = "Claws-mail" }, + properties = { tag = tags[1][4] } }, { rule = { class = "Sunbird-bin" }, properties = { tag = tags[1][5] } }, { rule = { class = "Gmpc" }, From 30fd81b3a3e9046f94137b4584ff6d72a55f488c Mon Sep 17 00:00:00 2001 From: crater2150 Date: Thu, 24 Jun 2010 18:14:00 +0200 Subject: [PATCH 20/36] rules --- rules.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/rules.lua b/rules.lua index 903b24c..991b00b 100644 --- a/rules.lua +++ b/rules.lua @@ -29,6 +29,8 @@ awful.rules.rules = { properties = { tag = tags[1][3] } }, { rule = { role = "buddy_list" }, properties = { master = true } }, + { rule = { class = "Claws-mail" }, + properties = { tag = tags[1][4] } }, { rule = { class = "Thunderbird" }, properties = { tag = tags[1][4] } }, { rule = { class = "Sunbird-bin" }, @@ -41,5 +43,13 @@ awful.rules.rules = { properties = { tag = tags[1][22] } }, --{ rule = { class = "OpenOffice.org 3.2" }, --properties = { floating = false } }, + { rule = { class = "Cellwriter" }, + properties = { tag = tags[1][1], + ontop = true, + size_hints_honor = true, + float = true, + sticky = true, + fullscreen = true + } }, } -- }}} From 7bf8e56a3523f4b298e7c85037416b1256a2b1eb Mon Sep 17 00:00:00 2001 From: crater2150 Date: Thu, 24 Jun 2010 18:15:08 +0200 Subject: [PATCH 21/36] zenburn --- zenburn/theme.lua | 30 +++++++++--------- zenburn/titlebar/close_normal.png | Bin 370 -> 370 bytes zenburn/titlebar/floating_focus_inactive.png | Bin 339 -> 339 bytes zenburn/titlebar/floating_normal_active.png | Bin 361 -> 361 bytes zenburn/titlebar/floating_normal_inactive.png | Bin 328 -> 328 bytes zenburn/titlebar/maximized_focus_inactive.png | Bin 337 -> 337 bytes zenburn/titlebar/maximized_normal_active.png | Bin 369 -> 369 bytes .../titlebar/maximized_normal_inactive.png | Bin 349 -> 349 bytes zenburn/titlebar/ontop_focus_inactive.png | Bin 333 -> 333 bytes zenburn/titlebar/ontop_normal_active.png | Bin 349 -> 349 bytes zenburn/titlebar/ontop_normal_inactive.png | Bin 334 -> 334 bytes zenburn/titlebar/sticky_focus_inactive.png | Bin 330 -> 330 bytes zenburn/titlebar/sticky_normal_active.png | Bin 361 -> 361 bytes zenburn/titlebar/sticky_normal_inactive.png | Bin 329 -> 329 bytes 14 files changed, 15 insertions(+), 15 deletions(-) diff --git a/zenburn/theme.lua b/zenburn/theme.lua index 756d611..dae417f 100644 --- a/zenburn/theme.lua +++ b/zenburn/theme.lua @@ -8,25 +8,25 @@ -- {{{ Main theme = {} -theme.wallpaper_cmd = { "awsetbg -a /home/crater2150/.config/awesome/wallpaper" } +theme.wallpaper_cmd = { "nitrogen --restore" } -- }}} -- {{{ Styles theme.font = "sans 8" -- {{{ Colors -theme.fg_normal = "#8888FF" -theme.fg_focus = "#000000" -theme.fg_urgent = "#FF0000" -theme.bg_normal = "#000000" -theme.bg_focus = "#8888FF" -theme.bg_urgent = "#880000" +theme.fg_normal = "#DCDCCC" +theme.fg_focus = "#F0DFAF" +theme.fg_urgent = "#CC9393" +theme.bg_normal = "#3F3F3F" +theme.bg_focus = "#1E2320" +theme.bg_urgent = "#3F3F3F" -- }}} -- {{{ Borders theme.border_width = "2" -theme.border_normal = "#DDDDFF" -theme.border_focus = "#8888FF" +theme.border_normal = "#3F3F3F" +theme.border_focus = "#6F6F6F" theme.border_marked = "#CC9393" -- }}} @@ -83,12 +83,12 @@ theme.tasklist_floating_icon = "/usr/share/awesome/themes/default/tasklist/float -- }}} -- {{{ Layout -theme.layout_tile = "/usr/share/awesome/themes/zenburn/layouts/tilebottom.png" -theme.layout_tileleft = "/usr/share/awesome/themes/zenburn/layouts/tiletop.png" -theme.layout_tilebottom = "/usr/share/awesome/themes/zenburn/layouts/tileleft.png" -theme.layout_tiletop = "/usr/share/awesome/themes/zenburn/layouts/tile.png" -theme.layout_fairv = "/usr/share/awesome/themes/zenburn/layouts/fairh.png" -theme.layout_fairh = "/usr/share/awesome/themes/zenburn/layouts/fairv.png" +theme.layout_tile = "/usr/share/awesome/themes/zenburn/layouts/tile.png" +theme.layout_tileleft = "/usr/share/awesome/themes/zenburn/layouts/tileleft.png" +theme.layout_tilebottom = "/usr/share/awesome/themes/zenburn/layouts/tilebottom.png" +theme.layout_tiletop = "/usr/share/awesome/themes/zenburn/layouts/tiletop.png" +theme.layout_fairv = "/usr/share/awesome/themes/zenburn/layouts/fairv.png" +theme.layout_fairh = "/usr/share/awesome/themes/zenburn/layouts/fairh.png" theme.layout_spiral = "/usr/share/awesome/themes/zenburn/layouts/spiral.png" theme.layout_dwindle = "/usr/share/awesome/themes/zenburn/layouts/dwindle.png" theme.layout_max = "/usr/share/awesome/themes/zenburn/layouts/max.png" diff --git a/zenburn/titlebar/close_normal.png b/zenburn/titlebar/close_normal.png index c5266d7979efa7744480f32c87505f7e9cc3934a..bc97b7c651fc86d7f806dc11fc564ec5df9554df 100644 GIT binary patch delta 108 zcmeyw^oeOgG3S2mdKI;Vst E0NAi0L;wH) delta 108 zcmeyw^oeOgF((5E{B+)3Ke1+Bgn^~5p@FWENr-`^m9eFjiLthUft7(l?P=$kKvk+G yt`Q|Ei6yC4x%nxXX_X8{22c$KA%+%KCWcmq77z_DOdEE9%=L8jb6Mw<&;$Uu@E)Q7 diff --git a/zenburn/titlebar/floating_focus_inactive.png b/zenburn/titlebar/floating_focus_inactive.png index 6a8bd86f0a48341134834ed34260a9bae03d75c0..f442d7863e1d5e05447b70db96ffbcd9ae3688b4 100644 GIT binary patch delta 104 zcmcc2beU;FG3)>K{xkb0Ry0Q#8t59B=^B}Y7+P2vm|7WHY8x0?85o#u`@_n>z@S>< z8c~vxSdwa$o1c=IR>@#w0McNpYiJN+Xkuk-X=Q2-(Xf_%{sEu{22WQ%mvv4FO#tIj B9`67E delta 104 zcmcc2beU;FF)PEWUS*?+70nR_mb!)px<)1;29{RFmR2Ul+6D$z1_rgKoo6yIFsPQe yMwFx^mZVzc=BH$)RWcYEKs6YI7+P4F7+M)xKs3BCZP)?Sz~JfX=d#Wzp$Pyn#T{1w diff --git a/zenburn/titlebar/floating_normal_active.png b/zenburn/titlebar/floating_normal_active.png index 609a2a2f0b47e6b48eba9c5261c5f18106cf0262..1355a55527934580d4bcce3aacd18bc05e0d2ce8 100644 GIT binary patch delta 108 zcmaFK^pa^pG3S2mdKI;Vst E0L}m*DF6Tf delta 108 zcmaFK^pa^pF((5E{B+)3Ke1+Ngn^~5p@FWENr-`^m9eFjiLthUft7(l?P=$kKvk+G yt`Q|Ei6yC4x%nxXX_X8{22c$KA%+%KCWcmq77z_DOdEE9%=L8jb6Mw<&;$UkKpuwx diff --git a/zenburn/titlebar/floating_normal_inactive.png b/zenburn/titlebar/floating_normal_inactive.png index 579ebd3749c589c075c5fd5acbad36c9aae6ccf1..e6731a33686be5d5f8c3a655d12f5b79e548ef6e 100644 GIT binary patch delta 104 zcmX@Xbb@I@G3)>K{xkb0R#Ze78t59B=^B}Y7+P2vm|7W`Xd4(=85rDpH%pCyfkCyz nHKHUXu_VK{xkb0Ry0N!8t59B=^B}Y7+P2vm|7WHY8x0?85o#u`@_n>z@S>< z8c~vxSdwa$o1c=IR>@#w0McNpYiJN+Xkuk-X=Q2-(Xf_%{sEu{22WQ%mvv4FO#tBm B9_au8 delta 104 zcmcb}bdhO7F)PEWUS*?+6^#)Fmb!)px<)1;29{RFmR2Ul+6D$z1_rgKoo6yIFsPQe yMwFx^mZVzc=BH$)RWcYEKs6YI7+P4F7+M)xKs3BCZP)?Sz~JfX=d#Wzp$PylbsbRv diff --git a/zenburn/titlebar/maximized_normal_active.png b/zenburn/titlebar/maximized_normal_active.png index f98030eb9109ed68125e40d094d567f47253b7c4..ba5139abfcf1eedb14d84ccb174a36185ff80aee 100644 GIT binary patch delta 108 zcmey!^pR;oG3S2mdKI;Vst E0M~#aK>z>% delta 108 zcmey!^pR;oF((5E{B+)3Ke1+Rgn^~5p@FWENr-`^m9eFjiLthUft7(l?P=$kKvk+G yt`Q|Ei6yC4x%nxXX_X8{22c$KA%+%KCWcmq77z_DOdEE9%=L8jb6Mw<&;$Utz#g9f diff --git a/zenburn/titlebar/maximized_normal_inactive.png b/zenburn/titlebar/maximized_normal_inactive.png index d84c2be4976fcb40f0241ac600a8b5171112cab9..debd21f25778608e3cc5d9b47c6d28e44c6bd6a8 100644 GIT binary patch delta 87 zcmcc1beCyDG3)>K{xkb0R`g068t59B=^B}Y7+P2vm|7W`Xd4(=85rDpH%o1@0;8BZ V4*Auam1Z#jfv2mV%Q~loCIIL+8SwxB delta 87 zcmcc1beCyDF)PEWUS*?+6}{31mb!)px<)1;29{RFmR6=F+6D$z1_mX^YC9(@Fp8<; VkY}BJ)RX}TJYD@<);T3K0RS`87b^e& diff --git a/zenburn/titlebar/ontop_focus_inactive.png b/zenburn/titlebar/ontop_focus_inactive.png index dd29ebedae49694f96beb23c6a8f3b9808191bd7..3b8b5c33ce6d1c8c87dff15f33fbae3cf588f55d 100644 GIT binary patch delta 87 zcmX@hbe3sCG3)>K{xkb0R@6!x8t59B=^B}Y7+P2vm|7WHY8x0?85o#u`@=d}fKf~x kByXx~Xb@s(Vr6V;WoizQU&}uK00R(sy85}Sb4q9e0Jw)46#xJL delta 87 zcmX@hbe3sCF)PEWUS*?+6}8d^mb!)px<)1;29{RFmR2Ul+6D$z1_rgKoo7xKU=&k_ g${U0jT3DGFS{YhE|g)_Pgg&ebxsLQ0472geEQH%u5JL+q6GJOQ3yAy+(}o=&V?15`T-G@yGywpM9~i3u diff --git a/zenburn/titlebar/ontop_normal_inactive.png b/zenburn/titlebar/ontop_normal_inactive.png index 05ed63fc8cc81a364399f0c9fd1bed2ad6c330e4..136f3f07d2181839cf5e0f361385fd956a18fc64 100644 GIT binary patch delta 87 zcmX@dbdG64G3)>K{xkb0R@6xw8t59B=^B}Y7+P2vm|7W`Xd4(=85rDpH%o1@AfuQ% V4*Auam1Z#jfv2mV%Q~loCIHu08MOca delta 87 zcmX@dbdG64F)PEWUS*?+6?M`Emb!)px<)1;29{RFmR6=F+6D$z1_mX^YC9(jGK#6= VkY}BJ)RX}TJYD@<);T3K0RSTN7ViK6 diff --git a/zenburn/titlebar/sticky_focus_inactive.png b/zenburn/titlebar/sticky_focus_inactive.png index 93ea06f0707281e14b2a55bab261a112276ab9da..b83ceffde2cd803c049c4e41811aeb0f41344918 100644 GIT binary patch delta 104 zcmX@bbc$(0G3)>K{xkb0R#Zh88t59B=^B}Y7+P2vm|7WHY8x0?85o#u`@_n>z@S>< z8c~vxSdwa$o1c=IR>@#w0McNpYiJN+Xkuk-X=Q2-(Xf_%{sEu{22WQ%mvv4FO#s;G B9@GE; delta 104 zcmX@bbc$(0F)PEWUS*?+6;%-imb!)px<)1;29{RFmR2Ul+6D$z1_rgKoo6yIFsPQe yMwFx^mZVzc=BH$)RWcYEKs6YI7+P4F7+M)xKs3BCZP)?Sz~JfX=d#Wzp$PydT^&3C diff --git a/zenburn/titlebar/sticky_normal_active.png b/zenburn/titlebar/sticky_normal_active.png index 57984a0e91b0f59206294d383acf9ec6865d3f83..9b740568e587207f24e6b7dfa60aa8b6d14a418c 100644 GIT binary patch delta 108 zcmaFK^pa^pG3S2mdKI;Vst E0L}m*DF6Tf delta 108 zcmaFK^pa^pF((5E{B+)3Ke1+Ngn^~5p@FWENr-`^m9eFjiLthUft7(l?P=$kKvk+G yt`Q|Ei6yC4x%nxXX_X8{22c$KA%+%KCWcmq77z_DOdEE9%=L8jb6Mw<&;$UkKpuwx diff --git a/zenburn/titlebar/sticky_normal_inactive.png b/zenburn/titlebar/sticky_normal_inactive.png index 617c51716fd4bd90e60bcd71abcebdfd47aba0c2..0e2978084fdd2ecbe310b209f4ab25825480a56b 100644 GIT binary patch delta 104 zcmX@fbdqU8G3)>K{xkb0R#Zk98t59B=^B}Y7+P2vm|7W`Xd4(=85rDpH%pCyfkCyz nHKHUXu_V Date: Thu, 24 Jun 2010 18:15:35 +0200 Subject: [PATCH 22/36] submodules --- obvious | 2 +- vicious | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/obvious b/obvious index 565f11c..e3a3e05 160000 --- a/obvious +++ b/obvious @@ -1 +1 @@ -Subproject commit 565f11c05dd28a2bfe8a96a6ec0950b970f5abcd +Subproject commit e3a3e05405d6c622326f3faba6ce6b7c188bf1e9 diff --git a/vicious b/vicious index 0d73f6d..ca1d8d7 160000 --- a/vicious +++ b/vicious @@ -1 +1 @@ -Subproject commit 0d73f6d8ae32f1cd48ce9f089b902eb0877605e1 +Subproject commit ca1d8d79e55b7addc28dc442832815692b01b894 From 5bf889823d85e33f6f7c927f1eaf27b29f218bc0 Mon Sep 17 00:00:00 2001 From: crater2150 Date: Thu, 24 Jun 2010 18:15:57 +0200 Subject: [PATCH 23/36] tags no more local --- tags.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tags.lua b/tags.lua index 836ed58..68484da 100644 --- a/tags.lua +++ b/tags.lua @@ -1,6 +1,6 @@ -- {{{ Tags -local tags = {} +tags={} tags.setup = { { name = "1:⚙", layout = layouts[1] }, { name = "2:⌘", layout = layouts[7] }, From 21b9bf3edc3f5f7e27f3b51bfb76877bf6702ee9 Mon Sep 17 00:00:00 2001 From: Alexander Date: Tue, 29 Jun 2010 12:27:30 +0200 Subject: [PATCH 24/36] zenburn fixed, bindings for tabletkeys --- bindings.lua | 17 ++++--- rc.lua | 1 + zenburn.lua | 141 --------------------------------------------------- 3 files changed, 12 insertions(+), 147 deletions(-) delete mode 100644 zenburn.lua diff --git a/bindings.lua b/bindings.lua index ea14360..b4a806b 100644 --- a/bindings.lua +++ b/bindings.lua @@ -1,7 +1,6 @@ -- {{{ 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) )) @@ -57,16 +56,22 @@ globalkeys = awful.util.table.join( -- awful.key({ modkey, }, "p", function () awful.util.spawn("pidgin") end), -- awful.key({ modkey, }, "s", function () awful.util.spawn("sunbird") end), -- awful.key({ modkey, }, "g", function () awful.util.spawn("gmpc") end), - awful.key({ modkey, }, "f", function () runraise("firefox", { class = "Firefox" }) end), - awful.key({ modkey, }, "t", function () runraise("thunderbird", { class = "Thunderbird" }) end), - awful.key({ modkey, }, "p", function () runraise("pidgin", { class = "Pidgin" }) end), - awful.key({ modkey, }, "s", function () runraised("sunbird", { class = "Sunbirdi-bin" }) end), - awful.key({ modkey, }, "g", function () runraise("gmpc", { class = "Gmpc" }) end), + awful.key({ modkey, }, "f", function () awful.util.spawn("firefox") end), + awful.key({ modkey, }, "t", function () awful.util.spawn("thunderbird") end), + awful.key({ modkey, }, "p", function () awful.util.spawn("pidgin") end), + awful.key({ modkey, }, "s", function () awful.util.spawn("sunbird") end), + awful.key({ modkey, }, "g", function () awful.util.spawn("gmpc") end), awful.key({ }, "XF86Mail", function () awful.util.spawn("xset dpms force off") end), awful.key({ }, "XF86Mail", function () awful.util.spawn("xset dpms force off") end), awful.key({ modkey }, "XF86Mail", function () awful.util.spawn("urslock") end), awful.key({ modkey, "Control" }, "r", awesome.restart), awful.key({ modkey, "Shift" }, "q", awesome.quit), + + + --tabletpc keys + awful.key({ hyper }, "6", function () awful.util.spawn("/usr/local/bin/rotate") end), + awful.key({ modkey }, "x", function () awful.util.spawn("cellwriter --show-window") end), + awful.key({ modkey, "Control" }, "Delete", function () awful.util.spawn("xlock") end), -- Audio control awful.key({ }, "Print", function () teardrop("sakura --class=Teardrop -e alsamixer","top","center", 0.99, 0.4)end ), diff --git a/rc.lua b/rc.lua index 254a1fa..9400fa6 100644 --- a/rc.lua +++ b/rc.lua @@ -1,6 +1,7 @@ terminal = "sakura -e screen" editor_cmd = "sakura -e vim" modkey = "Mod4" +hyper = "Mod3" -- Standard awesome library require("awful") diff --git a/zenburn.lua b/zenburn.lua deleted file mode 100644 index c293633..0000000 --- a/zenburn.lua +++ /dev/null @@ -1,141 +0,0 @@ -------------------------------- --- "Zenburn" awesome theme -- --- By Adrian C. (anrxc) -- -------------------------------- - - --- {{{ Main -theme = {} -theme.confdir = awful.util.getdir("config") -theme.wallpaper_cmd = { "/usr/bin/nitrogen --restore" } ---theme.wallpaper_cmd = { "awsetbg /usr/share/awesome/themes/zenburn/zenburn-background.png" } --- }}} - - --- {{{ Styles -theme.font = "Profont 8" - --- {{{ Colors -theme.fg_normal = "#DCDCCC" -theme.fg_focus = "#F0DFAF" -theme.fg_urgent = "#CC9393" -theme.bg_normal = "#3F3F3F" -theme.bg_focus = "#1E2320" -theme.bg_urgent = "#ff0000" --- }}} - --- {{{ Borders -theme.border_width = "1" -theme.border_normal = "#3F3F3F" -theme.border_focus = "#6F6F6F" -theme.border_marked = "#CC9393" --- }}} - --- {{{ Titlebars -theme.titlebar_bg_focus = "#3F3F3F" -theme.titlebar_bg_normal = "#3F3F3F" --- theme.titlebar_[normal|focus] --- }}} - --- {{{ Widgets -theme.fg_widget = "#AECF96" -theme.fg_center_widget = "#88A175" -theme.fg_end_widget = "#FF5656" -theme.fg_off_widget = "#494B4F" -theme.fg_netup_widget = "#7F9F7F" -theme.fg_netdn_widget = "#CC9393" -theme.bg_widget = "#3F3F3F" -theme.border_widget = "#3F3F3F" --- }}} - --- {{{ Mouse finder -theme.mouse_finder_color = "#CC9393" --- theme.mouse_finder_[timeout|animate_timeout|radius|factor] --- }}} - --- {{{ Tooltips --- theme.tooltip_[font|opacity|fg_color|bg_color|border_width|border_color] --- }}} - --- {{{ Taglist and Tasklist --- theme.[taglist|tasklist]_[bg|fg]_[focus|urgent] --- }}} - --- {{{ Menu --- theme.menu_[bg|fg]_[normal|focus] --- theme.menu_[height|width|border_color|border_width] --- }}} --- }}} - - --- {{{ Icons --- --- {{{ Taglist icons -theme.taglist_squares_sel = theme.confdir .. "/icons/taglist/squarefz.png" -theme.taglist_squares_unsel = theme.confdir .. "/icons/taglist/squareza.png" ---theme.taglist_squares_resize = "false" --- }}} - --- {{{ Misc icons ---theme.awesome_icon = theme.confdir .. "/icons/awesome.png" ---theme.menu_submenu_icon = "/usr/share/awesome/themes/default/submenu.png" ---theme.tasklist_floating_icon = "/usr/share/awesome/themes/default/tasklist/floatingw.png" --- }}} - --- {{{ Layout icons -theme.layout_tile = theme.confdir .. "/icons/layouts/tile.png" -theme.layout_tileleft = theme.confdir .. "/icons/layouts/tileleft.png" -theme.layout_tilebottom = theme.confdir .. "/icons/layouts/tilebottom.png" -theme.layout_tiletop = theme.confdir .. "/icons/layouts/tiletop.png" -theme.layout_fairv = theme.confdir .. "/icons/layouts/fairv.png" -theme.layout_fairh = theme.confdir .. "/icons/layouts/fairh.png" -theme.layout_spiral = theme.confdir .. "/icons/layouts/spiral.png" -theme.layout_dwindle = theme.confdir .. "/icons/layouts/dwindle.png" -theme.layout_max = theme.confdir .. "/icons/layouts/max.png" -theme.layout_fullscreen = theme.confdir .. "/icons/layouts/fullscreen.png" -theme.layout_magnifier = theme.confdir .. "/icons/layouts/magnifier.png" -theme.layout_floating = theme.confdir .. "/icons/layouts/floating.png" --- }}} - --- {{{ Widget icons -theme.widget_cpu = theme.confdir .. "/icons/cpu.png" -theme.widget_bat = theme.confdir .. "/icons/bat.png" -theme.widget_mem = theme.confdir .. "/icons/mem.png" -theme.widget_fs = theme.confdir .. "/icons/disk.png" -theme.widget_net = theme.confdir .. "/icons/down.png" -theme.widget_netup = theme.confdir .. "/icons/up.png" -theme.widget_mail = theme.confdir .. "/icons/mail.png" -theme.widget_vol = theme.confdir .. "/icons/vol.png" -theme.widget_org = theme.confdir .. "/icons/cal.png" -theme.widget_date = theme.confdir .. "/icons/time.png" -theme.widget_crypto = theme.confdir .. "/icons/crypto.png" --- }}} - --- {{{ Titlebar icons -theme.titlebar_close_button_focus = theme.confdir .. "/icons/titlebar/close_focus.png" -theme.titlebar_close_button_normal = theme.confdir .. "/icons/titlebar/close_normal.png" - -theme.titlebar_ontop_button_focus_active = theme.confdir .. "/icons/titlebar/ontop_focus_active.png" -theme.titlebar_ontop_button_normal_active = theme.confdir .. "/icons/titlebar/ontop_normal_active.png" -theme.titlebar_ontop_button_focus_inactive = theme.confdir .. "/icons/titlebar/ontop_focus_inactive.png" -theme.titlebar_ontop_button_normal_inactive = theme.confdir .. "/icons/titlebar/ontop_normal_inactive.png" - -theme.titlebar_sticky_button_focus_active = theme.confdir .. "/icons/titlebar/sticky_focus_active.png" -theme.titlebar_sticky_button_normal_active = theme.confdir .. "/icons/titlebar/sticky_normal_active.png" -theme.titlebar_sticky_button_focus_inactive = theme.confdir .. "/icons/titlebar/sticky_focus_inactive.png" -theme.titlebar_sticky_button_normal_inactive = theme.confdir .. "/icons/titlebar/sticky_normal_inactive.png" - -theme.titlebar_floating_button_focus_active = theme.confdir .. "/icons/titlebar/floating_focus_active.png" -theme.titlebar_floating_button_normal_active = theme.confdir .. "/icons/titlebar/floating_normal_active.png" -theme.titlebar_floating_button_focus_inactive = theme.confdir .. "/icons/titlebar/floating_focus_inactive.png" -theme.titlebar_floating_button_normal_inactive = theme.confdir .. "/icons/titlebar/floating_normal_inactive.png" - -theme.titlebar_maximized_button_focus_active = theme.confdir .. "/icons/titlebar/maximized_focus_active.png" -theme.titlebar_maximized_button_normal_active = theme.confdir .. "/icons/titlebar/maximized_normal_active.png" -theme.titlebar_maximized_button_focus_inactive = theme.confdir .. "/icons/titlebar/maximized_focus_inactive.png" -theme.titlebar_maximized_button_normal_inactive = theme.confdir .. "/icons/titlebar/maximized_normal_inactive.png" --- }}} --- }}} - - -return theme From 6c41bc8a93e01f556a87c3d286a604e15b2fbcc3 Mon Sep 17 00:00:00 2001 From: crater2150 Date: Wed, 25 Aug 2010 12:17:12 +0200 Subject: [PATCH 25/36] some changes, e.g. per tag wallpaper --- rc.lua | 58 ++++++++++++++++++++++++++++++++-------------------------- 1 file changed, 32 insertions(+), 26 deletions(-) diff --git a/rc.lua b/rc.lua index 83109ca..b2c3ecd 100644 --- a/rc.lua +++ b/rc.lua @@ -5,10 +5,11 @@ require("awful.rules") require("beautiful") require("naughty") require("teardrop") -require("obvious.battery") require("obvious.popup_run_prompt") require("vicious") ---- Spawns cmd if no client can be found matching properties + +confdir = "/home/crater2150/.config/awesome" +-- {{{ Spawns cmd if no client can be found matching properties -- If such a client can be found, pop to first tag where it is visible, and give it focus -- @param cmd the command to execute -- @param properties a table of properties to match against clients. Possible entries: any properties of the client object @@ -49,7 +50,7 @@ function runraise(cmd, properties) return end awful.util.spawn(cmd) -end +end --}}} -- Returns true if all pairs in table1 are present in table2 function match (table1, table2) @@ -153,10 +154,6 @@ vicious.register(clock, vicious.widgets.date, "%b %d, %R", 60) memwidget = widget({ type = "textbox" }) vicious.register(memwidget, vicious.widgets.mem, "⌸ $1% ($2MB / $3MB) ", 13) ---batwidget = obvious.battery(); -batwidget = widget({ type = "textbox" }) -vicious.register(batwidget, vicious.widgets.batat, "⌁ $1$2% - $3", 61) - cpuwidget = awful.widget.progressbar() cpulabel = widget({ type = "textbox" }) cpuwidget:set_width(50) @@ -167,8 +164,6 @@ vicious.register(cpuwidget, vicious.widgets.cpu, "$1",41) vicious.register(cpulabel, vicious.widgets.cpu, "CPU: $1%") -wlanwidget = widget({ type = "textbox" }) -vicious.register(wlanwidget, vicious.widgets.wifi, "WLAN ${ssid} @ ${sign}, Q:${link}/70", 31, "wlan0") -- Create a wibox for each screen and add it leftwibox = {} rightwibox = {} @@ -210,8 +205,6 @@ for s = 1, screen.count() do { clock, separator, spacer, memwidget, - separator, spacer, batwidget, - separator, spacer, wlanwidget, separator, spacer, cpulabel, cpuwidget, spacer, layout = awful.widget.layout.horizontal.leftright @@ -230,12 +223,30 @@ awful.button({ }, 5, awful.tag.viewprev) )) -- }}} +curtag = 1 +function prevtag() + curtag = curtag - 1 + if curtag == 0 then curtag = 22 end + awful.util.spawn("awbg " .. curtag) + awful.tag.viewprev() +end + +function nexttag( + if curtag == 23 then curtag = 1 end + awful.util.spawn("awbg " .. curtag) + awful.tag.viewnext() +end + -- {{{ Key bindings globalkeys = awful.util.table.join( --{{{ - awful.key({ modkey, }, "Left", awful.tag.viewprev ), - awful.key({ modkey, }, "Right", awful.tag.viewnext ), + --awful.key({ modkey, }, "Left", awful.tag.viewprev ), + --awful.key({ modkey, }, "Right", awful.tag.viewnext ), + awful.key({ modkey, }, "Left", prevtag ), + awful.key({ modkey, }, "Right", nexttag ), awful.key({ modkey, }, "Escape", awful.tag.history.restore), + --awful.key({ }, "XF86Word", awful.tag.viewprev ), + --awful.key({ }, "XF86WebCam", awful.tag.viewnext ), awful.key({ }, "XF86Word", awful.tag.viewprev ), awful.key({ }, "XF86WebCam", awful.tag.viewnext ), awful.key({ }, "XF86Away", awful.tag.history.restore), @@ -275,16 +286,10 @@ globalkeys = awful.util.table.join( --}}} -- Standard program awful.key({ modkey, }, "Return", function () awful.util.spawn(terminal) end), --- awful.key({ modkey, }, "f", function () awful.util.spawn("firefox") end), --- awful.key({ modkey, }, "t", function () awful.util.spawn("thunderbird") end), --- awful.key({ modkey, }, "p", function () awful.util.spawn("pidgin") end), --- awful.key({ modkey, }, "s", function () awful.util.spawn("sunbird") end), --- awful.key({ modkey, }, "g", function () awful.util.spawn("gmpc") end), - awful.key({ modkey, }, "f", function () runraise("firefox", { class = "Firefox" }) end), - awful.key({ modkey, }, "t", function () runraise("thunderbird", { class = "Thunderbird" }) end), - awful.key({ modkey, }, "p", function () runraise("pidgin", { class = "Pidgin" }) end), - awful.key({ modkey, }, "s", function () runraised("sunbird", { class = "Sunbirdi-bin" }) end), - awful.key({ modkey, }, "g", function () runraise("gmpc", { class = "Gmpc" }) end), + awful.key({ modkey, }, "f", function () awful.util.spawn("firefox") end), + awful.key({ modkey, }, "t", function () awful.util.spawn("claws-mail") end), + awful.key({ modkey, }, "p", function () awful.util.spawn("pidgin") end), + awful.key({ modkey, }, "g", function () awful.util.spawn("gmpc") end), awful.key({ }, "XF86Mail", function () awful.util.spawn("xset dpms force off") end), awful.key({ }, "XF86Mail", function () awful.util.spawn("xset dpms force off") end), awful.key({ modkey }, "XF86Mail", function () awful.util.spawn("urslock") end), @@ -359,6 +364,8 @@ for i = 1, keynumber do function () local screen = mouse.screen if tags[screen][i] then + curtag = i + awful.util.spawn("awbg " .. i) awful.tag.viewonly(tags[screen][i]) end end), @@ -410,8 +417,7 @@ awful.rules.rules = { ontop = true, focus = true } }, { rule = { class = "Teardrop" }, - properties = { floating = true, - size_hints_honor = true } }, + properties = { floating = true } }, { rule = { class = "pinentry" }, properties = { floating = true } }, { rule = { class = "gimp" }, @@ -423,7 +429,7 @@ awful.rules.rules = { properties = { tag = tags[1][3] } }, { rule = { role = "buddy_list" }, properties = { master = true } }, - { rule = { class = "Thunderbird" }, + { rule = { class = "Claws-mail" }, properties = { tag = tags[1][4] } }, { rule = { class = "Sunbird-bin" }, properties = { tag = tags[1][5] } }, From 3820f1882e181b46b77f4f463a0b0c70aaf45976 Mon Sep 17 00:00:00 2001 From: crater2150 Date: Wed, 1 Sep 2010 17:52:20 +0200 Subject: [PATCH 26/36] foo --- bindings.lua | 3 ++- rules.lua | 7 ++++++- tags.lua | 2 +- zenburn/theme.lua | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/bindings.lua b/bindings.lua index b4a806b..3f04c85 100644 --- a/bindings.lua +++ b/bindings.lua @@ -70,7 +70,8 @@ globalkeys = awful.util.table.join( --tabletpc keys awful.key({ hyper }, "6", function () awful.util.spawn("/usr/local/bin/rotate") end), - awful.key({ modkey }, "x", function () awful.util.spawn("cellwriter --show-window") end), + --awful.key({ modkey }, "x", function () awful.util.spawn("cellwriter --show-window") end), + awful.key({ modkey }, "x", function () teardrop("cellwriter","top","center", 0.99, 0.4)end ), awful.key({ modkey, "Control" }, "Delete", function () awful.util.spawn("xlock") end), -- Audio control diff --git a/rules.lua b/rules.lua index 991b00b..fc16100 100644 --- a/rules.lua +++ b/rules.lua @@ -26,9 +26,14 @@ awful.rules.rules = { { rule = { class = "Firefox" }, properties = { tag = tags[1][2] } }, { rule = { class = "Pidgin" }, - properties = { tag = tags[1][3] } }, + properties = { tag = tags[1][3]} }, { rule = { role = "buddy_list" }, properties = { master = true } }, + { rule = { role = "conversation" }, + callback = awful.client.setslave}, + { rule = { class = "Irssi"}, + properties = { tag = tags[1][3]} , + callback = awful.client.setslave}, { rule = { class = "Claws-mail" }, properties = { tag = tags[1][4] } }, { rule = { class = "Thunderbird" }, diff --git a/tags.lua b/tags.lua index 68484da..1af42e9 100644 --- a/tags.lua +++ b/tags.lua @@ -4,7 +4,7 @@ tags={} tags.setup = { { name = "1:⚙", layout = layouts[1] }, { name = "2:⌘", layout = layouts[7] }, - { name = "3:☻", layout = layouts[2], mwfact = 0.80 }, + { name = "3:☻", layout = layouts[2], mwfact = 0.20 }, { name = "4:✉", layout = layouts[7] }, { name = "5:☑", layout = layouts[7] }, { name = "6:♫", layout = layouts[1] }, diff --git a/zenburn/theme.lua b/zenburn/theme.lua index dae417f..ae93bb1 100644 --- a/zenburn/theme.lua +++ b/zenburn/theme.lua @@ -8,7 +8,7 @@ -- {{{ Main theme = {} -theme.wallpaper_cmd = { "nitrogen --restore" } +theme.wallpaper_cmd = { "awsetbg /usr/share/awesome/themes/zenburn/zenburn-background.png" } -- }}} -- {{{ Styles From ade6d89c41085c3f22056a0fcb9407767e7c2d25 Mon Sep 17 00:00:00 2001 From: crater2150 Date: Sat, 4 Sep 2010 00:52:38 +0200 Subject: [PATCH 27/36] update --- bindings.lua | 1 + rc.lua | 2 ++ rules.lua | 3 ++- zenburn/theme.lua | 2 +- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/bindings.lua b/bindings.lua index 3f04c85..86095b4 100644 --- a/bindings.lua +++ b/bindings.lua @@ -66,6 +66,7 @@ globalkeys = awful.util.table.join( awful.key({ modkey }, "XF86Mail", function () awful.util.spawn("urslock") end), awful.key({ modkey, "Control" }, "r", awesome.restart), awful.key({ modkey, "Shift" }, "q", awesome.quit), + awful.key({ }, "Menu", aweswt.switch), --tabletpc keys diff --git a/rc.lua b/rc.lua index 9400fa6..7ae56bc 100644 --- a/rc.lua +++ b/rc.lua @@ -13,6 +13,8 @@ require("teardrop") require("obvious.battery") require("obvious.popup_run_prompt") require("vicious") +require("aweswt") + diff --git a/rules.lua b/rules.lua index fc16100..15ca44f 100644 --- a/rules.lua +++ b/rules.lua @@ -24,7 +24,8 @@ awful.rules.rules = { properties = { floating = true } }, -- Set Firefox to always map on tags number 2 of screen 1. { rule = { class = "Firefox" }, - properties = { tag = tags[1][2] } }, + properties = { tag = tags[1][2], + floating = false } }, { rule = { class = "Pidgin" }, properties = { tag = tags[1][3]} }, { rule = { role = "buddy_list" }, diff --git a/zenburn/theme.lua b/zenburn/theme.lua index ae93bb1..dae417f 100644 --- a/zenburn/theme.lua +++ b/zenburn/theme.lua @@ -8,7 +8,7 @@ -- {{{ Main theme = {} -theme.wallpaper_cmd = { "awsetbg /usr/share/awesome/themes/zenburn/zenburn-background.png" } +theme.wallpaper_cmd = { "nitrogen --restore" } -- }}} -- {{{ Styles From c7985df86a5d9cc053ff37bc1aff962365a84a68 Mon Sep 17 00:00:00 2001 From: crater2150 Date: Sat, 4 Sep 2010 01:09:24 +0200 Subject: [PATCH 28/36] some things --- aweswt.lua | 50 +++++++++++++++++++++++++++++++++++++++++++++++ rc.lua | 6 ++---- tags.lua | 6 +++--- zenburn/theme.lua | 20 +++++++++---------- 4 files changed, 65 insertions(+), 17 deletions(-) create mode 100644 aweswt.lua diff --git a/aweswt.lua b/aweswt.lua new file mode 100644 index 0000000..2ccf363 --- /dev/null +++ b/aweswt.lua @@ -0,0 +1,50 @@ + -- aweswt.lua + local io=io + local table=table + local pairs=pairs + local awful=awful + local client=client + local string=string + local USE_T=true + module("aweswt") + function get_out (a) + local f=io.popen (a) + t={} + for line in f:lines() do + table.insert(t, line ) + end + return t + end + function get_input (a) + s1='echo -e "'..a..'"|dmenu' + return get_out(s1) + end + + function switch() + local clients = client.get() + if table.getn(clients) == 0 then + return + end + local m1="" + local t2={} + local tmp + for i, c in pairs(clients) do + if USE_T then do + tmp=i..':'..string.sub(c['name'], 1, 20) + end + else do + tmp=i..':'..c['instance']..'.'..c['class'] + end + end + m1=m1..tmp..'\n' + t2[tmp]=c + end + local t6=t2[get_input(m1)[1]] + if t6 then + local ctags = t6:tags() + awful.tag.viewonly(ctags[1]) + client.focus = t6 + t6:raise() + end + end + diff --git a/rc.lua b/rc.lua index 7ae56bc..1fd564b 100644 --- a/rc.lua +++ b/rc.lua @@ -25,12 +25,10 @@ beautiful.init("/home/crater2150/.config/awesome/zenburn/theme.lua") -- Table of layouts to cover with awful.layout.inc, order matters. layouts = { - 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.tile, + awful.layout.suit.tile.bottom, awful.layout.suit.max, awful.layout.suit.max.fullscreen, awful.layout.suit.floating diff --git a/tags.lua b/tags.lua index 1af42e9..4bc1ef9 100644 --- a/tags.lua +++ b/tags.lua @@ -3,10 +3,10 @@ tags={} tags.setup = { { name = "1:⚙", layout = layouts[1] }, - { name = "2:⌘", layout = layouts[7] }, + { name = "2:⌘", layout = layouts[5] }, { name = "3:☻", layout = layouts[2], mwfact = 0.20 }, - { name = "4:✉", layout = layouts[7] }, - { name = "5:☑", layout = layouts[7] }, + { name = "4:✉", layout = layouts[5] }, + { name = "5:☑", layout = layouts[1] }, { name = "6:♫", layout = layouts[1] }, { name = "7:☣", layout = layouts[1] }, { name = "8:☕", layout = layouts[1] }, diff --git a/zenburn/theme.lua b/zenburn/theme.lua index dae417f..346a717 100644 --- a/zenburn/theme.lua +++ b/zenburn/theme.lua @@ -15,12 +15,12 @@ theme.wallpaper_cmd = { "nitrogen --restore" } theme.font = "sans 8" -- {{{ Colors -theme.fg_normal = "#DCDCCC" +theme.fg_normal = "#DCDCDC" theme.fg_focus = "#F0DFAF" theme.fg_urgent = "#CC9393" -theme.bg_normal = "#3F3F3F" -theme.bg_focus = "#1E2320" -theme.bg_urgent = "#3F3F3F" +theme.bg_normal = "#121212" +theme.bg_focus = "#3F3F3F" +theme.bg_urgent = "#DA4E4E" -- }}} -- {{{ Borders @@ -83,12 +83,12 @@ theme.tasklist_floating_icon = "/usr/share/awesome/themes/default/tasklist/float -- }}} -- {{{ Layout -theme.layout_tile = "/usr/share/awesome/themes/zenburn/layouts/tile.png" -theme.layout_tileleft = "/usr/share/awesome/themes/zenburn/layouts/tileleft.png" -theme.layout_tilebottom = "/usr/share/awesome/themes/zenburn/layouts/tilebottom.png" -theme.layout_tiletop = "/usr/share/awesome/themes/zenburn/layouts/tiletop.png" -theme.layout_fairv = "/usr/share/awesome/themes/zenburn/layouts/fairv.png" -theme.layout_fairh = "/usr/share/awesome/themes/zenburn/layouts/fairh.png" +theme.layout_tiletop = "/usr/share/awesome/themes/zenburn/layouts/tile.png" +theme.layout_tilebottom = "/usr/share/awesome/themes/zenburn/layouts/tileleft.png" +theme.layout_tile = "/usr/share/awesome/themes/zenburn/layouts/tilebottom.png" +theme.layout_tileleft = "/usr/share/awesome/themes/zenburn/layouts/tiletop.png" +theme.layout_fairh = "/usr/share/awesome/themes/zenburn/layouts/fairv.png" +theme.layout_fairv = "/usr/share/awesome/themes/zenburn/layouts/fairh.png" theme.layout_spiral = "/usr/share/awesome/themes/zenburn/layouts/spiral.png" theme.layout_dwindle = "/usr/share/awesome/themes/zenburn/layouts/dwindle.png" theme.layout_max = "/usr/share/awesome/themes/zenburn/layouts/max.png" From 4542e5ac2ecd0d523c25e3e4dbe0fc0c5ba196b1 Mon Sep 17 00:00:00 2001 From: crater2150 Date: Sat, 4 Sep 2010 01:11:13 +0200 Subject: [PATCH 29/36] fixing --- tags.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tags.lua b/tags.lua index 4bc1ef9..f36117e 100644 --- a/tags.lua +++ b/tags.lua @@ -4,7 +4,7 @@ tags={} tags.setup = { { name = "1:⚙", layout = layouts[1] }, { name = "2:⌘", layout = layouts[5] }, - { name = "3:☻", layout = layouts[2], mwfact = 0.20 }, + { name = "3:☻", layout = layouts[3], mwfact = 0.20 }, { name = "4:✉", layout = layouts[5] }, { name = "5:☑", layout = layouts[1] }, { name = "6:♫", layout = layouts[1] }, From cdab953dbdefadc71a67781893ec07d87005acfc Mon Sep 17 00:00:00 2001 From: crater2150 Date: Tue, 7 Sep 2010 17:07:00 +0200 Subject: [PATCH 30/36] ignorefile --- .gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..26708af --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +wallpaper From 24d275a18a8fb71eac20e736cf3df02d01b8042c Mon Sep 17 00:00:00 2001 From: crater2150 Date: Tue, 7 Sep 2010 17:22:03 +0200 Subject: [PATCH 31/36] ignorefile --- .gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..26708af --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +wallpaper From 787dfa94bdfeb4128b94effac8d4694fc516b810 Mon Sep 17 00:00:00 2001 From: crater2150 Date: Tue, 7 Sep 2010 17:35:08 +0200 Subject: [PATCH 32/36] batwidget correction --- wibox.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wibox.lua b/wibox.lua index 0afbebd..a640906 100644 --- a/wibox.lua +++ b/wibox.lua @@ -23,7 +23,7 @@ vicious.register(memwidget, vicious.widgets.mem, "⌸ $1% ($2MB / $3MB) ", 13) --batwidget = obvious.battery(); batwidget = widget({ type = "textbox" }) -vicious.register(batwidget, vicious.widgets.batat, "⌁ $1$2% - $3", 61) +vicious.register(batwidget, vicious.widgets.bat, "⌁ $1$2% - $3", 61) cpuwidget = awful.widget.progressbar() cpulabel = widget({ type = "textbox" }) From 1882efd0fdc56d50c46b2723af86ea67e333ef46 Mon Sep 17 00:00:00 2001 From: crater2150 Date: Wed, 15 Sep 2010 22:42:31 +0200 Subject: [PATCH 33/36] foo --- rc.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rc.lua b/rc.lua index b2c3ecd..6613038 100644 --- a/rc.lua +++ b/rc.lua @@ -231,7 +231,7 @@ function prevtag() awful.tag.viewprev() end -function nexttag( +function nexttag() if curtag == 23 then curtag = 1 end awful.util.spawn("awbg " .. curtag) awful.tag.viewnext() @@ -247,8 +247,8 @@ globalkeys = awful.util.table.join( awful.key({ modkey, }, "Escape", awful.tag.history.restore), --awful.key({ }, "XF86Word", awful.tag.viewprev ), --awful.key({ }, "XF86WebCam", awful.tag.viewnext ), - awful.key({ }, "XF86Word", awful.tag.viewprev ), - awful.key({ }, "XF86WebCam", awful.tag.viewnext ), + awful.key({ }, "XF86Word", prevtag ), + awful.key({ }, "XF86WebCam", nexttag ), awful.key({ }, "XF86Away", awful.tag.history.restore), awful.key({ modkey, }, "j", From a3b4c66737a46095145b271a8abb2c2e831f9dd4 Mon Sep 17 00:00:00 2001 From: crater2150 Date: Wed, 15 Sep 2010 22:42:56 +0200 Subject: [PATCH 34/36] keymaps --- keymaps/actions.lua | 48 +++++++++++++++++++++++++++++ keymaps/spawn.lua | 73 +++++++++++++++++++++++++++++++++++++++++++++ keymaps/wmbase.lua | 49 ++++++++++++++++++++++++++++++ 3 files changed, 170 insertions(+) create mode 100644 keymaps/actions.lua create mode 100644 keymaps/spawn.lua create mode 100644 keymaps/wmbase.lua diff --git a/keymaps/actions.lua b/keymaps/actions.lua new file mode 100644 index 0000000..a81e8f5 --- /dev/null +++ b/keymaps/actions.lua @@ -0,0 +1,48 @@ +-- Client manipulation +modkey = "Mod4" + +keybinding({ "Mod1" }, "Tab", function () awful.client.focus.byidx(1); if client.focus then client.focus:raise() end end):add() + + + +--From Here default config + +keybinding({ modkey, "Shift" }, "f", function () if client.focus then client.focus.fullscreen = not client.focus.fullscreen end end):add() +keybinding({ modkey, "Shift" }, "c", function () if client.focus then client.focus:kill() end end):add() +keybinding({ modkey }, "j", function () awful.client.focus.byidx(1); if client.focus then client.focus:raise() end end):add() +keybinding({ modkey }, "k", function () awful.client.focus.byidx(-1); if client.focus then client.focus:raise() end end):add() +keybinding({ modkey, "Shift" }, "j", function () awful.client.swap.byidx(1) end):add() +keybinding({ modkey, "Shift" }, "k", function () awful.client.swap.byidx(-1) end):add() +keybinding({ modkey, "Control" }, "j", function () awful.screen.focus(1) end):add() +keybinding({ modkey, "Control" }, "k", function () awful.screen.focus(-1) end):add() +keybinding({ modkey, "Control" }, "space", awful.client.togglefloating):add() +keybinding({ modkey, "Control" }, "Return", function () if client.focus then client.focus:swap(awful.client.getmaster()) end end):add() +keybinding({ modkey }, "o", awful.client.movetoscreen):add() +keybinding({ modkey }, "Tab", awful.client.focus.history.previous):add() +keybinding({ modkey }, "u", awful.client.urgent.jumpto):add() +keybinding({ modkey, "Shift" }, "r", function () if client.focus then client.focus:redraw() end end):add() + +-- Layout manipulation +keybinding({ modkey }, "l", function () awful.tag.incmwfact(0.05) end):add() +keybinding({ modkey }, "h", function () awful.tag.incmwfact(-0.05) end):add() +keybinding({ modkey, "Shift" }, "h", function () awful.tag.incnmaster(1) end):add() +keybinding({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1) end):add() +keybinding({ modkey, "Control" }, "h", function () awful.tag.incncol(1) end):add() +keybinding({ modkey, "Control" }, "l", function () awful.tag.incncol(-1) end):add() +keybinding({ modkey }, "space", function () awful.layout.inc(layouts, 1) end):add() +keybinding({ modkey, "Shift" }, "space", function () awful.layout.inc(layouts, -1) end):add() + +-- Client awful tagging: this is useful to tag some clients and then do stuff like move to tag on them +keybinding({ modkey }, "t", awful.client.togglemarked):add() + +for i = 1, keynumber do + keybinding({ modkey, "Shift" }, "F" .. i, + function () + local screen = mouse.screen + if tags[screen][i] then + for k, c in pairs(awful.client.getmarked()) do + awful.client.movetotag(tags[screen][i], c) + end + end + end):add() +end diff --git a/keymaps/spawn.lua b/keymaps/spawn.lua new file mode 100644 index 0000000..93c88fe --- /dev/null +++ b/keymaps/spawn.lua @@ -0,0 +1,73 @@ + + +keybinding({ modkey }, "Return", function () awful.util.spawn(terminal) end):add() +keybinding({ modkey }, "f", function () awful.util.spawn("firefox") end):add() +keybinding({ }, "XF86AudioLowerVolume", function () awful.util.spawn("voldown 3") end):add() +keybinding({ }, "XF86AudioRaiseVolume", function () awful.util.spawn("volup 3") end):add() +keybinding({ "Shift" }, "XF86AudioLowerVolume", function () awful.util.spawn("voldown 10") end):add() +keybinding({ "Shift" }, "XF86AudioRaiseVolume", function () awful.util.spawn("volup 10") end):add() +keybinding({ modkey }, "XF86Mail", function () awful.util.spawn("xset dpms force off") end):add() +keybinding({ modkey }, "XF86WWW", function () awful.util.spawn(terminal .. " -e apselect") end):add() + + +keybinding({ }, "XF86AudioPlay", function () awful.util.spawn("mpc toggle") end):add() +keybinding({ }, "XF86AudioNext", function () awful.util.spawn("mpc next") end):add() +keybinding({ }, "XF86AudioPrev", function () awful.util.spawn("mpc prev") end):add() +keybinding({ }, "XF86AudioStop", function () awful.util.spawn("mpc stop") end):add() +keybinding({ modkey }, "XF86AudioStop", function () awful.util.spawn("mpc clear") end):add() +keybinding({ modkey }, "XF86AudioPlay", function () + awful.prompt.run({ prompt = "Play Band: " }, + mypromptbox[mouse.screen], playband, + awful.completion.bash, + awful.util.getdir("cache") .. "/history") +end):add() + +function playband(b) + return awful.util.spawn("playband " .. b) +end + + +keybinding({ modkey }, "Return", function () awful.util.spawn(terminal) end):add() + +keybinding({ modkey }, "F1", function () + awful.prompt.run({ prompt = "Run: " }, + mypromptbox[mouse.screen], awful.util.spawn, + awful.completion.bash, + awful.util.getdir("cache") .. "/history") +end):add() + +keybinding({ modkey }, "F4", function () + awful.prompt.run({ prompt = "Run Lua code: " }, + mypromptbox[mouse.screen], + awful.util.eval, + awful.prompt.bash, + awful.util.getdir("cache") .. "/history_eval") +end):add() + +keybinding({ modkey, "Ctrl" }, "i", function () + local s = mouse.screen + if mypromptbox[s].text then + mypromptbox[s].text = nil + elseif client.focus then + mypromptbox[s].text = nil + if client.focus.class then + mypromptbox[s].text = "Class: " .. client.focus.class .. " " + end + if client.focus.instance then + mypromptbox[s].text = mypromptbox[s].text .. "Instance: " + .. client.focus.instance .. " " + end + if client.focus.role then + mypromptbox[s].text = mypromptbox[s].text .. "Role: " + .. client.focus.role + end + end + end):add() + + +keybinding({}, "F12", function () + + tags[1][10].selected = not tags[1][10].selected; + +end):add() + diff --git a/keymaps/wmbase.lua b/keymaps/wmbase.lua new file mode 100644 index 0000000..e6d47aa --- /dev/null +++ b/keymaps/wmbase.lua @@ -0,0 +1,49 @@ + +-- Bind keyboard digits +-- 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 + +for i = 1, keynumber do + keybinding({ modkey }, i, + function () + local screen = mouse.screen + if tags[screen][i] then + awful.tag.viewonly(tags[screen][i]) + end + end):add() + keybinding({ modkey, "Control" }, i, + function () + local screen = mouse.screen + if tags[screen][i] then + tags[screen][i].selected = not tags[screen][i].selected + end + end):add() + keybinding({ modkey, "Shift" }, i, + function () + if client.focus then + if tags[client.focus.screen][i] then + awful.client.movetotag(tags[client.focus.screen][i]) + end + end + end):add() + keybinding({ modkey, "Control", "Shift" }, i, + function () + if client.focus then + if tags[client.focus.screen][i] then + awful.client.toggletag(tags[client.focus.screen][i]) + end + end + end):add() +end + +keybinding({ modkey }, "Left", awful.tag.viewprev):add() +keybinding({ modkey }, "Right", awful.tag.viewnext):add() +keybinding({ modkey }, "Escape", awful.tag.history.restore):add() + +keybinding({ modkey, "Control" }, "r", function () + mypromptbox[mouse.screen].text = awful.util.escape(awful.util.restart()) + end):add() +keybinding({ modkey, "Shift" }, "q", awesome.quit):add() From 9c40f2d82ebcb97ebee8eb633b2bc559eddfc0be Mon Sep 17 00:00:00 2001 From: crater2150 Date: Wed, 15 Sep 2010 22:43:23 +0200 Subject: [PATCH 35/36] ignorefile --- .gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..30cc063 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +wp From 1f3554a5343e9ed333f785fd1c65b5588a854cc7 Mon Sep 17 00:00:00 2001 From: crater2150 Date: Mon, 18 Oct 2010 10:44:10 +0200 Subject: [PATCH 36/36] update# Please enter the commit message for your changes. Lines starting --- aweswt.lua | 2 +- bindings.lua | 6 +++--- rc.lua | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/aweswt.lua b/aweswt.lua index 2ccf363..4d8a0a4 100644 --- a/aweswt.lua +++ b/aweswt.lua @@ -16,7 +16,7 @@ return t end function get_input (a) - s1='echo -e "'..a..'"|dmenu' + s1='echo -e "'..a..'"|dmenu -i' return get_out(s1) end diff --git a/bindings.lua b/bindings.lua index 86095b4..4bec762 100644 --- a/bindings.lua +++ b/bindings.lua @@ -57,7 +57,7 @@ globalkeys = awful.util.table.join( -- awful.key({ modkey, }, "s", function () awful.util.spawn("sunbird") end), -- awful.key({ modkey, }, "g", function () awful.util.spawn("gmpc") end), awful.key({ modkey, }, "f", function () awful.util.spawn("firefox") end), - awful.key({ modkey, }, "t", function () awful.util.spawn("thunderbird") end), + awful.key({ modkey, }, "t", function () awful.util.spawn("claws-mail") end), awful.key({ modkey, }, "p", function () awful.util.spawn("pidgin") end), awful.key({ modkey, }, "s", function () awful.util.spawn("sunbird") end), awful.key({ modkey, }, "g", function () awful.util.spawn("gmpc") end), @@ -76,7 +76,7 @@ globalkeys = awful.util.table.join( awful.key({ modkey, "Control" }, "Delete", function () awful.util.spawn("xlock") end), -- Audio control - awful.key({ }, "Print", function () teardrop("sakura --class=Teardrop -e alsamixer","top","center", 0.99, 0.4)end ), + awful.key({ }, "Print", function () teardrop("urxvtc -e alsamixer","top","center", 0.99, 0.4)end ), awful.key({ }, "XF86AudioLowerVolume", function () awful.util.spawn("amixer set Front 2dB-")end ), awful.key({ }, "XF86AudioRaiseVolume", function () awful.util.spawn("amixer set Front 2dB+")end ), awful.key({ }, "XF86AudioMute", function () awful.util.spawn("amixer set Front toggle") end), @@ -93,7 +93,7 @@ globalkeys = awful.util.table.join( -- Prompt awful.key({ modkey }, "r", function () obvious.popup_run_prompt.run_prompt() end), awful.key({ }, "Scroll_Lock", function () awful.util.spawn("wli") end), - awful.key({ }, "F12", function () teardrop("sakura --class=Teardrop -e 'screen -l'","center","center", 0.99, 0.7)end ), + awful.key({ }, "F12", function () teardrop("urxvtc -e screen -l","center","center", 0.99, 0.7)end ), --{{{Default diff --git a/rc.lua b/rc.lua index 1fd564b..599afd4 100644 --- a/rc.lua +++ b/rc.lua @@ -1,5 +1,5 @@ -terminal = "sakura -e screen" -editor_cmd = "sakura -e vim" +terminal = "urxvtc -e screen" +editor_cmd = "urxvt -e vim" modkey = "Mod4" hyper = "Mod3"