From 9abcf6cfbf35678317bc03f8b2605d243d214519 Mon Sep 17 00:00:00 2001 From: "Adrian C. (anrxc)" Date: Sat, 5 Sep 2009 21:48:27 +0200 Subject: Initial import of awesome configuration --- icons/LICENSE | 12 + icons/awesome.png | Bin 0 -> 205 bytes icons/bat.png | Bin 0 -> 214 bytes icons/cal.png | Bin 0 -> 217 bytes icons/chat.png | Bin 0 -> 216 bytes icons/cpu.png | Bin 0 -> 235 bytes icons/crypto.png | Bin 0 -> 219 bytes icons/disk.png | Bin 0 -> 201 bytes icons/down.png | Bin 0 -> 250 bytes icons/info.png | Bin 0 -> 189 bytes icons/layouts/dwindle.png | Bin 0 -> 216 bytes icons/layouts/fairh.png | Bin 0 -> 194 bytes icons/layouts/fairv.png | Bin 0 -> 225 bytes icons/layouts/floating.png | Bin 0 -> 241 bytes icons/layouts/fullscreen.png | Bin 0 -> 213 bytes icons/layouts/magnifier.png | Bin 0 -> 215 bytes icons/layouts/max.png | Bin 0 -> 240 bytes icons/layouts/spiral.png | Bin 0 -> 215 bytes icons/layouts/tile.png | Bin 0 -> 196 bytes icons/layouts/tilebottom.png | Bin 0 -> 214 bytes icons/layouts/tileleft.png | Bin 0 -> 210 bytes icons/layouts/tiletop.png | Bin 0 -> 213 bytes icons/mail.png | Bin 0 -> 213 bytes icons/mem.png | Bin 0 -> 203 bytes icons/music.png | Bin 0 -> 192 bytes icons/pacman.png | Bin 0 -> 226 bytes icons/phones.png | Bin 0 -> 232 bytes icons/power.png | Bin 0 -> 222 bytes icons/rss.png | Bin 0 -> 203 bytes icons/sat.png | Bin 0 -> 226 bytes icons/sun.png | Bin 0 -> 203 bytes icons/taglist/squarefz.png | Bin 0 -> 377 bytes icons/taglist/squarefza.png | Bin 0 -> 163 bytes icons/taglist/squarez.png | Bin 0 -> 377 bytes icons/taglist/squareza.png | Bin 0 -> 377 bytes icons/temp.png | Bin 0 -> 240 bytes icons/time.png | Bin 0 -> 225 bytes icons/titlebar/close_focus.png | Bin 0 -> 209 bytes icons/titlebar/close_normal.png | Bin 0 -> 368 bytes icons/titlebar/floating_focus_active.png | Bin 0 -> 207 bytes icons/titlebar/floating_focus_inactive.png | Bin 0 -> 337 bytes icons/titlebar/floating_normal_active.png | Bin 0 -> 359 bytes icons/titlebar/floating_normal_inactive.png | Bin 0 -> 326 bytes icons/titlebar/maximized_focus_active.png | Bin 0 -> 200 bytes icons/titlebar/maximized_focus_inactive.png | Bin 0 -> 335 bytes icons/titlebar/maximized_normal_active.png | Bin 0 -> 366 bytes icons/titlebar/maximized_normal_inactive.png | Bin 0 -> 347 bytes icons/titlebar/ontop_focus_active.png | Bin 0 -> 186 bytes icons/titlebar/ontop_focus_inactive.png | Bin 0 -> 331 bytes icons/titlebar/ontop_normal_active.png | Bin 0 -> 347 bytes icons/titlebar/ontop_normal_inactive.png | Bin 0 -> 332 bytes icons/titlebar/sticky_focus_active.png | Bin 0 -> 197 bytes icons/titlebar/sticky_focus_inactive.png | Bin 0 -> 328 bytes icons/titlebar/sticky_normal_active.png | Bin 0 -> 359 bytes icons/titlebar/sticky_normal_inactive.png | Bin 0 -> 328 bytes icons/up.png | Bin 0 -> 277 bytes icons/vol.png | Bin 0 -> 228 bytes icons/wifi.png | Bin 0 -> 213 bytes rc.lua | 881 +++++++++++++++++++++++++++ teardrop.lua | 141 +++++ zenburn.lua | 133 ++++ 61 files changed, 1167 insertions(+) create mode 100644 icons/LICENSE create mode 100644 icons/awesome.png create mode 100644 icons/bat.png create mode 100644 icons/cal.png create mode 100644 icons/chat.png create mode 100644 icons/cpu.png create mode 100644 icons/crypto.png create mode 100644 icons/disk.png create mode 100644 icons/down.png create mode 100644 icons/info.png create mode 100644 icons/layouts/dwindle.png create mode 100644 icons/layouts/fairh.png create mode 100644 icons/layouts/fairv.png create mode 100644 icons/layouts/floating.png create mode 100644 icons/layouts/fullscreen.png create mode 100644 icons/layouts/magnifier.png create mode 100644 icons/layouts/max.png create mode 100644 icons/layouts/spiral.png create mode 100644 icons/layouts/tile.png create mode 100644 icons/layouts/tilebottom.png create mode 100644 icons/layouts/tileleft.png create mode 100644 icons/layouts/tiletop.png create mode 100644 icons/mail.png create mode 100644 icons/mem.png create mode 100644 icons/music.png create mode 100644 icons/pacman.png create mode 100644 icons/phones.png create mode 100644 icons/power.png create mode 100644 icons/rss.png create mode 100644 icons/sat.png create mode 100644 icons/sun.png create mode 100644 icons/taglist/squarefz.png create mode 100644 icons/taglist/squarefza.png create mode 100644 icons/taglist/squarez.png create mode 100644 icons/taglist/squareza.png create mode 100644 icons/temp.png create mode 100644 icons/time.png create mode 100644 icons/titlebar/close_focus.png create mode 100644 icons/titlebar/close_normal.png create mode 100644 icons/titlebar/floating_focus_active.png create mode 100644 icons/titlebar/floating_focus_inactive.png create mode 100644 icons/titlebar/floating_normal_active.png create mode 100644 icons/titlebar/floating_normal_inactive.png create mode 100644 icons/titlebar/maximized_focus_active.png create mode 100644 icons/titlebar/maximized_focus_inactive.png create mode 100644 icons/titlebar/maximized_normal_active.png create mode 100644 icons/titlebar/maximized_normal_inactive.png create mode 100644 icons/titlebar/ontop_focus_active.png create mode 100644 icons/titlebar/ontop_focus_inactive.png create mode 100644 icons/titlebar/ontop_normal_active.png create mode 100644 icons/titlebar/ontop_normal_inactive.png create mode 100644 icons/titlebar/sticky_focus_active.png create mode 100644 icons/titlebar/sticky_focus_inactive.png create mode 100644 icons/titlebar/sticky_normal_active.png create mode 100644 icons/titlebar/sticky_normal_inactive.png create mode 100644 icons/up.png create mode 100644 icons/vol.png create mode 100644 icons/wifi.png create mode 100644 rc.lua create mode 100644 teardrop.lua create mode 100644 zenburn.lua diff --git a/icons/LICENSE b/icons/LICENSE new file mode 100644 index 0000000..f313823 --- /dev/null +++ b/icons/LICENSE @@ -0,0 +1,12 @@ +All 'awesome' icons in this package were created by Adrian C. (anrxc). +They are licensed under the same terms as the awesome distribution itself +- GNU General Public License version 2. To view a human-readable copy of +this license, visit: http://creativecommons.org/licenses/GPL/2.0/ + +The widget icons with the exception of: 'chat', 'crypt', 'power' and +'rss' icons (which were made by me) were originally made by 'sm4tik' +for purposes of 'dzen', I could not find any licensing information +attached to those original bitmaps. Assuming they are in the public +domain I am licensing the widget icons under the terms of the +Creative Commons Attribution-Share Alike license. To view a copy of +this license, visit: http://creativecommons.org/licenses/by-sa/3.0/ diff --git a/icons/awesome.png b/icons/awesome.png new file mode 100644 index 0000000..44697e6 Binary files /dev/null and b/icons/awesome.png differ diff --git a/icons/bat.png b/icons/bat.png new file mode 100644 index 0000000..8ca804a Binary files /dev/null and b/icons/bat.png differ diff --git a/icons/cal.png b/icons/cal.png new file mode 100644 index 0000000..a93384c Binary files /dev/null and b/icons/cal.png differ diff --git a/icons/chat.png b/icons/chat.png new file mode 100644 index 0000000..5dd010e Binary files /dev/null and b/icons/chat.png differ diff --git a/icons/cpu.png b/icons/cpu.png new file mode 100644 index 0000000..38bf844 Binary files /dev/null and b/icons/cpu.png differ diff --git a/icons/crypto.png b/icons/crypto.png new file mode 100644 index 0000000..20f0313 Binary files /dev/null and b/icons/crypto.png differ diff --git a/icons/disk.png b/icons/disk.png new file mode 100644 index 0000000..fea47b9 Binary files /dev/null and b/icons/disk.png differ diff --git a/icons/down.png b/icons/down.png new file mode 100644 index 0000000..22d5855 Binary files /dev/null and b/icons/down.png differ diff --git a/icons/info.png b/icons/info.png new file mode 100644 index 0000000..fd54609 Binary files /dev/null and b/icons/info.png differ diff --git a/icons/layouts/dwindle.png b/icons/layouts/dwindle.png new file mode 100644 index 0000000..1e0aa0a Binary files /dev/null and b/icons/layouts/dwindle.png differ diff --git a/icons/layouts/fairh.png b/icons/layouts/fairh.png new file mode 100644 index 0000000..2cd065d Binary files /dev/null and b/icons/layouts/fairh.png differ diff --git a/icons/layouts/fairv.png b/icons/layouts/fairv.png new file mode 100644 index 0000000..1849883 Binary files /dev/null and b/icons/layouts/fairv.png differ diff --git a/icons/layouts/floating.png b/icons/layouts/floating.png new file mode 100644 index 0000000..dadb295 Binary files /dev/null and b/icons/layouts/floating.png differ diff --git a/icons/layouts/fullscreen.png b/icons/layouts/fullscreen.png new file mode 100644 index 0000000..cbb28e0 Binary files /dev/null and b/icons/layouts/fullscreen.png differ diff --git a/icons/layouts/magnifier.png b/icons/layouts/magnifier.png new file mode 100644 index 0000000..60386ca Binary files /dev/null and b/icons/layouts/magnifier.png differ diff --git a/icons/layouts/max.png b/icons/layouts/max.png new file mode 100644 index 0000000..7eec7cc Binary files /dev/null and b/icons/layouts/max.png differ diff --git a/icons/layouts/spiral.png b/icons/layouts/spiral.png new file mode 100644 index 0000000..20db5b1 Binary files /dev/null and b/icons/layouts/spiral.png differ diff --git a/icons/layouts/tile.png b/icons/layouts/tile.png new file mode 100644 index 0000000..b44da88 Binary files /dev/null and b/icons/layouts/tile.png differ diff --git a/icons/layouts/tilebottom.png b/icons/layouts/tilebottom.png new file mode 100644 index 0000000..1a4e9f3 Binary files /dev/null and b/icons/layouts/tilebottom.png differ diff --git a/icons/layouts/tileleft.png b/icons/layouts/tileleft.png new file mode 100644 index 0000000..5dd6f29 Binary files /dev/null and b/icons/layouts/tileleft.png differ diff --git a/icons/layouts/tiletop.png b/icons/layouts/tiletop.png new file mode 100644 index 0000000..23efb3f Binary files /dev/null and b/icons/layouts/tiletop.png differ diff --git a/icons/mail.png b/icons/mail.png new file mode 100644 index 0000000..f489e88 Binary files /dev/null and b/icons/mail.png differ diff --git a/icons/mem.png b/icons/mem.png new file mode 100644 index 0000000..b088d4a Binary files /dev/null and b/icons/mem.png differ diff --git a/icons/music.png b/icons/music.png new file mode 100644 index 0000000..4c2764d Binary files /dev/null and b/icons/music.png differ diff --git a/icons/pacman.png b/icons/pacman.png new file mode 100644 index 0000000..466c34f Binary files /dev/null and b/icons/pacman.png differ diff --git a/icons/phones.png b/icons/phones.png new file mode 100644 index 0000000..8b6c26a Binary files /dev/null and b/icons/phones.png differ diff --git a/icons/power.png b/icons/power.png new file mode 100644 index 0000000..b8add29 Binary files /dev/null and b/icons/power.png differ diff --git a/icons/rss.png b/icons/rss.png new file mode 100644 index 0000000..62d361e Binary files /dev/null and b/icons/rss.png differ diff --git a/icons/sat.png b/icons/sat.png new file mode 100644 index 0000000..485f36e Binary files /dev/null and b/icons/sat.png differ diff --git a/icons/sun.png b/icons/sun.png new file mode 100644 index 0000000..2f22c8e Binary files /dev/null and b/icons/sun.png differ diff --git a/icons/taglist/squarefz.png b/icons/taglist/squarefz.png new file mode 100644 index 0000000..6291037 Binary files /dev/null and b/icons/taglist/squarefz.png differ diff --git a/icons/taglist/squarefza.png b/icons/taglist/squarefza.png new file mode 100644 index 0000000..5475446 Binary files /dev/null and b/icons/taglist/squarefza.png differ diff --git a/icons/taglist/squarez.png b/icons/taglist/squarez.png new file mode 100644 index 0000000..df65248 Binary files /dev/null and b/icons/taglist/squarez.png differ diff --git a/icons/taglist/squareza.png b/icons/taglist/squareza.png new file mode 100644 index 0000000..c3838b4 Binary files /dev/null and b/icons/taglist/squareza.png differ diff --git a/icons/temp.png b/icons/temp.png new file mode 100644 index 0000000..2e712e9 Binary files /dev/null and b/icons/temp.png differ diff --git a/icons/time.png b/icons/time.png new file mode 100644 index 0000000..929327e Binary files /dev/null and b/icons/time.png differ diff --git a/icons/titlebar/close_focus.png b/icons/titlebar/close_focus.png new file mode 100644 index 0000000..6b037ed Binary files /dev/null and b/icons/titlebar/close_focus.png differ diff --git a/icons/titlebar/close_normal.png b/icons/titlebar/close_normal.png new file mode 100644 index 0000000..66ecf40 Binary files /dev/null and b/icons/titlebar/close_normal.png differ diff --git a/icons/titlebar/floating_focus_active.png b/icons/titlebar/floating_focus_active.png new file mode 100644 index 0000000..cd367c1 Binary files /dev/null and b/icons/titlebar/floating_focus_active.png differ diff --git a/icons/titlebar/floating_focus_inactive.png b/icons/titlebar/floating_focus_inactive.png new file mode 100644 index 0000000..2ae6e94 Binary files /dev/null and b/icons/titlebar/floating_focus_inactive.png differ diff --git a/icons/titlebar/floating_normal_active.png b/icons/titlebar/floating_normal_active.png new file mode 100644 index 0000000..3d17780 Binary files /dev/null and b/icons/titlebar/floating_normal_active.png differ diff --git a/icons/titlebar/floating_normal_inactive.png b/icons/titlebar/floating_normal_inactive.png new file mode 100644 index 0000000..3faa1a3 Binary files /dev/null and b/icons/titlebar/floating_normal_inactive.png differ diff --git a/icons/titlebar/maximized_focus_active.png b/icons/titlebar/maximized_focus_active.png new file mode 100644 index 0000000..6b235a5 Binary files /dev/null and b/icons/titlebar/maximized_focus_active.png differ diff --git a/icons/titlebar/maximized_focus_inactive.png b/icons/titlebar/maximized_focus_inactive.png new file mode 100644 index 0000000..53d914b Binary files /dev/null and b/icons/titlebar/maximized_focus_inactive.png differ diff --git a/icons/titlebar/maximized_normal_active.png b/icons/titlebar/maximized_normal_active.png new file mode 100644 index 0000000..dc59180 Binary files /dev/null and b/icons/titlebar/maximized_normal_active.png differ diff --git a/icons/titlebar/maximized_normal_inactive.png b/icons/titlebar/maximized_normal_inactive.png new file mode 100644 index 0000000..7dc97ee Binary files /dev/null and b/icons/titlebar/maximized_normal_inactive.png differ diff --git a/icons/titlebar/ontop_focus_active.png b/icons/titlebar/ontop_focus_active.png new file mode 100644 index 0000000..16b44d5 Binary files /dev/null and b/icons/titlebar/ontop_focus_active.png differ diff --git a/icons/titlebar/ontop_focus_inactive.png b/icons/titlebar/ontop_focus_inactive.png new file mode 100644 index 0000000..219d3ca Binary files /dev/null and b/icons/titlebar/ontop_focus_inactive.png differ diff --git a/icons/titlebar/ontop_normal_active.png b/icons/titlebar/ontop_normal_active.png new file mode 100644 index 0000000..ba39ce8 Binary files /dev/null and b/icons/titlebar/ontop_normal_active.png differ diff --git a/icons/titlebar/ontop_normal_inactive.png b/icons/titlebar/ontop_normal_inactive.png new file mode 100644 index 0000000..2d0de52 Binary files /dev/null and b/icons/titlebar/ontop_normal_inactive.png differ diff --git a/icons/titlebar/sticky_focus_active.png b/icons/titlebar/sticky_focus_active.png new file mode 100644 index 0000000..3e897c7 Binary files /dev/null and b/icons/titlebar/sticky_focus_active.png differ diff --git a/icons/titlebar/sticky_focus_inactive.png b/icons/titlebar/sticky_focus_inactive.png new file mode 100644 index 0000000..04f425c Binary files /dev/null and b/icons/titlebar/sticky_focus_inactive.png differ diff --git a/icons/titlebar/sticky_normal_active.png b/icons/titlebar/sticky_normal_active.png new file mode 100644 index 0000000..3e6b39f Binary files /dev/null and b/icons/titlebar/sticky_normal_active.png differ diff --git a/icons/titlebar/sticky_normal_inactive.png b/icons/titlebar/sticky_normal_inactive.png new file mode 100644 index 0000000..c7b96a5 Binary files /dev/null and b/icons/titlebar/sticky_normal_inactive.png differ diff --git a/icons/up.png b/icons/up.png new file mode 100644 index 0000000..94d4898 Binary files /dev/null and b/icons/up.png differ diff --git a/icons/vol.png b/icons/vol.png new file mode 100644 index 0000000..09714c8 Binary files /dev/null and b/icons/vol.png differ diff --git a/icons/wifi.png b/icons/wifi.png new file mode 100644 index 0000000..d9eaef5 Binary files /dev/null and b/icons/wifi.png differ diff --git a/rc.lua b/rc.lua new file mode 100644 index 0000000..14a8f2d --- /dev/null +++ b/rc.lua @@ -0,0 +1,881 @@ +-- {{{ Header +-- +-- Awesome configuration file, using awesome 3.3.3 on Arch GNU/Linux. +-- * Adrian C. + +-- Updated on: Aug 27, 04:27:20 CEST 2009 +-- Screenshot: http://sysphere.org/gallery/snapshots + +-- FAQ: +-- 1. Statusbar widgets created with Vicious: +-- - http://git.sysphere.org/vicious + +-- 2. Why is there no Menu or a Taskbar in your config? +-- Everything is done with the keyboard. + +-- 3. Why these colors? +-- It's Zenburn. Awesome, Emacs, Urxvt, Alpine... all use these colors. +-- - http://slinky.imukuppi.org/zenburnpage/ + +-- 3a. My .Xdefaults can be found here: +-- - http://git.sysphere.org/dotfiles + +-- 4. Fonts used on my desktop: +-- Terminus : http://www.is-vn.bg/hamster +-- Profont : http://www.tobias-jung.de/seekingprofont + +-- This work is licensed under the Creative Commons Attribution-Share Alike License. +-- To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/ +-- }}} + + +-- {{{ Libraries +require("awful") +require("beautiful") +-- User libraries +require("vicious") +require("teardrop") +-- }}} + + +-- {{{ Variable definitions +-- +-- Zenburn theme +beautiful.init(awful.util.getdir("config") .. "/zenburn.lua") + +-- Modifier keys +altkey = "Mod1" -- Alt_L +modkey = "Mod4" -- Super_L + +-- Window titlebars +use_titlebar = false -- True for floaters (arrange hook) + +-- Window management layouts +layouts = { + awful.layout.suit.tile, -- 1 + awful.layout.suit.tile.left, -- 2 + awful.layout.suit.tile.bottom, -- 3 + awful.layout.suit.tile.top, -- 4 + awful.layout.suit.fair, -- 5 + awful.layout.suit.fair.horizontal, -- 6 + awful.layout.suit.max, -- 7 +-- awful.layout.suit.max.fullscreen, -- / + awful.layout.suit.magnifier, -- 8 + awful.layout.suit.floating -- 9 +} + +-- Application specific behaviour +apprules = { +-- cls = class, ins = instance, name, scr = screen, tag, float + { cls = "Gajim.py", scr = 1, tag = 5 }, + { cls = "Knode", scr = 1, tag = 8 }, + { cls = "Akregator", scr = 1, tag = 8 }, + { cls = "Amarok", scr = 1, tag = 9 }, + { cls = "Amarokapp", scr = 1, tag = 9 }, + { cls = "Gimp", scr = 1, tag = 9 }, + { name = "Alpine", scr = 1, tag = 4 }, + { ins = "uTorrent.exe", scr = screen.count(), tag = 9 }, + { cls = "Emacs", scr = screen.count(), tag = 2 }, + { cls = "Firefox", scr = screen.count(), tag = 3 }, + { cls = "Firefox", ins = "Download", float = true }, + { cls = "Firefox", ins = "Places", float = true }, + { cls = "Firefox", ins = "Greasemonkey", float = true }, + { cls = "Firefox", ins = "Extension", float = true }, + { cls = "Firefox", ins = "Scrapbook", float = true }, + { cls = "Emacs", ins = "_Remember_", float = true }, + { cls = "Xmag", ins = "xmag", float = true }, + { cls = "Xmessage", ins = "xmessage", float = true }, + { cls = "ROX-Filer", float = true }, + { cls = "Ark", float = true }, + { cls = "Kgpg", float = true }, + { cls = "Kmix", float = true }, + { cls = "Geeqie", float = true }, + { cls = "Smplayer", float = true }, + { cls = "xine", float = true }, + { name = "VLC media player", float = true }, + { name = "pinentry-gtk-2", float = true }, +} +-- }}} + + +-- {{{ Tags +-- +-- Define tags table +tags = {} +tags.settings = { + { name = "term", layout = layouts[2] }, + { name = "emacs", layout = layouts[1] }, + { name = "web", layout = layouts[1] }, + { name = "mail", layout = layouts[7] }, + { name = "im", layout = layouts[1], mwfact = 0.13 }, + { name = "6", layout = layouts[9] }, + { name = "7", layout = layouts[9] }, + { name = "rss", layout = layouts[8] }, + { name = "media", layout = layouts[9] } +} + +-- Initialize tags +for s = 1, screen.count() do + tags[s] = {} + for i, v in ipairs(tags.settings) do + tags[s][i] = tag(v.name) + tags[s][i].screen = s + awful.tag.setproperty(tags[s][i], "layout", v.layout) + awful.tag.setproperty(tags[s][i], "mwfact", v.mwfact) + end + tags[s][1].selected = true +end +-- }}} + + +-- {{{ Wibox +-- +-- {{{ Widgets configuration +-- +-- {{{ Reusable separators +myspacer = widget({ type = "textbox", name = "myspacer", align = "right" }) +myseparator = widget({ type = "textbox", name = "myseparator", align = "right" }) +myspacer.text = " " +myseparator.text = "|" +-- }}} + +-- {{{ CPU usage graph and temperature +-- Widget icon +mycpuicon = widget({ type = "imagebox", name = "mycpuicon", align = "right" }) +mycpuicon.image = image(beautiful.widget_cpu) +-- Initialize widgets +mythermalwidget = widget({ type = "textbox", name = "mythermalwidget", align = "right" }) +mycpuwidget = widget({ type = "graph", name = "mycpuwidget", align = "right" }) +-- CPU graph properties +mycpuwidget.width = 50 +mycpuwidget.height = 0.90 +mycpuwidget.grow = "left" +mycpuwidget.bg = beautiful.fg_off_widget +mycpuwidget.border_color = beautiful.border_widget +mycpuwidget:plot_properties_set("cpu", { + fg = beautiful.fg_widget, + fg_center = beautiful.fg_center_widget, + fg_end = beautiful.fg_end_widget, + vertical_gradient = false }) +-- Register widgets +vicious.register(mycpuwidget, vicious.widgets.cpu, "$1", 2, "cpu") +vicious.register(mythermalwidget, vicious.widgets.thermal, "$1°C", 60, nil, "TZS0") +-- }}} + +-- {{{ Battery percentage and state indicator +-- Widget icon +mybaticon = widget({ type = "imagebox", name = "mybaticon", align = "right" }) +mybaticon.image = image(beautiful.widget_bat) +-- Initialize widget +mybatwidget = widget({ type = "textbox", name = "mybatwidget", align = "right" }) +-- Register widget +vicious.register(mybatwidget, vicious.widgets.bat, "$1$2%", 60, nil, "BAT0") +-- }}} + +-- {{{ Memory usage bar +-- Widget icon +mymemicon = widget({ type = "imagebox", name = "mymemicon", align = "right" }) +mymemicon.image = image(beautiful.widget_mem) +-- Initialize widget +mymemwidget = widget({ type = "progressbar", name = "mymemwidget", align = "right" }) +-- MEM progressbar properties +mymemwidget.width = 10 +mymemwidget.height = 0.9 +mymemwidget.gap = 0 +mymemwidget.border_padding = 1 +mymemwidget.border_width = 0 +mymemwidget.ticks_count = 4 +mymemwidget.ticks_gap = 1 +mymemwidget.vertical = true +mymemwidget:bar_properties_set("mem", { + bg = beautiful.bg_widget, + fg = beautiful.fg_widget, + fg_center = beautiful.fg_center_widget, + fg_end = beautiful.fg_end_widget, + fg_off = beautiful.fg_off_widget, + min_value = 0, + max_value = 100 }) +-- Register widget +vicious.register(mymemwidget, vicious.widgets.mem, "$1", 60, "mem") +-- }}} + +-- {{{ File system usage bars +-- Widget icon +myfsicon = widget({ type = "imagebox", name = "myfsicon", align = "right" }) +myfsicon.image = image(beautiful.widget_fs) +-- Initialize widget +myfswidget = widget({ type = "progressbar", name = "myfswidget", align = "right" }) +-- FS progressbar properties +myfswidget.width = 20 +myfswidget.height = 0.9 +myfswidget.gap = 1 +myfswidget.border_padding = 1 +myfswidget.border_width = 0 +myfswidget.ticks_count = 4 +myfswidget.ticks_gap = 1 +myfswidget.vertical = true +myfswidget:bar_properties_set("rootfs", { + bg = beautiful.bg_widget, + fg = beautiful.fg_widget, + fg_center = beautiful.fg_center_widget, + fg_end = beautiful.fg_end_widget, + fg_off = beautiful.fg_off_widget, + min_value = 0, + max_value = 100 }) +myfswidget:bar_properties_set("homefs", { + bg = beautiful.bg_widget, + fg = beautiful.fg_widget, + fg_center = beautiful.fg_center_widget, + fg_end = beautiful.fg_end_widget, + fg_off = beautiful.fg_off_widget, + min_value = 0, + max_value = 100 }) +myfswidget:bar_properties_set("storagefs", { + bg = beautiful.bg_widget, + fg = beautiful.fg_widget, + fg_center = beautiful.fg_center_widget, + fg_end = beautiful.fg_end_widget, + fg_off = beautiful.fg_off_widget, + min_value = 0, + max_value = 100 }) +myfswidget:bar_properties_set("backupfs", { + bg = beautiful.bg_widget, + fg = beautiful.fg_widget, + fg_center = beautiful.fg_center_widget, + fg_end = beautiful.fg_end_widget, + fg_off = beautiful.fg_off_widget, + min_value = 0, + max_value = 100 }) +-- Register widgets +vicious.register(myfswidget, vicious.widgets.fs, "${/ usep}", 240, "rootfs") +vicious.register(myfswidget, vicious.widgets.fs, "${/home usep}", 240, "homefs") +vicious.register(myfswidget, vicious.widgets.fs, "${/mnt/storage usep}", 240, "storagefs") +vicious.register(myfswidget, vicious.widgets.fs, "${/mnt/backup usep}", 240, "backupfs") +-- Register buttons +myfswidget:buttons(awful.util.table.join( + awful.button({ }, 1, function () awful.util.spawn("rox", false) end))) +-- }}} + +-- {{{ Network usage statistics +-- Widget icons +myneticon = widget({ type = "imagebox", name = "myneticon", align = "right" }) +myneticonup = widget({ type = "imagebox", name = "myneticonup", align = "right" }) +myneticon.image = image(beautiful.widget_net) +myneticonup.image = image(beautiful.widget_netup) +-- Initialize widgets +mynetwidget = widget({ type = "textbox", name = "mynetwidget", align = "right" }) +mynetfiwidget = widget({ type = "textbox", name = "mynetfiwidget", align = "right" }) +-- Register ethernet widget +vicious.register(mynetwidget, vicious.widgets.net, + '${eth0 down_kb} ${eth0 up_kb}', 2) +-- Register wireless widget +vicious.register(mynetfiwidget, vicious.widgets.net, + '${wlan0 down_kb} ${wlan0 up_kb}', 2) +-- }}} + +-- {{{ Mail subject (latest e-mail) +-- Widget icon +mymailicon = widget({ type = "imagebox", name = "mymailicon", align = "right" }) +mymailicon.image = image(beautiful.widget_mail) +-- Initialize widget +mymboxwidget = widget({ type = "textbox", name = "mymboxwidget", align = "right" }) +-- Register widget +vicious.register(mymboxwidget, vicious.widgets.mbox, "$1", 60, nil, "/home/anrxc/mail/Inbox") +-- Register buttons +mymboxwidget:buttons(awful.util.table.join( + awful.button({ }, 1, function () awful.util.spawn("urxvt -title Alpine -e alpine_exp", false) end))) +-- }}} + +-- {{{ Agenda and Todo (Emacs org-mode) +-- Widget icon +myorgicon = widget({ type = "imagebox", name = "myorgicon", align = "right" }) +myorgicon.image = image(beautiful.widget_org) +-- Initialize widget +myorgwidget = widget({ type = "textbox", name = "myorgwidget", align = "right" }) +-- Configure widget +myorgmode = {} +myorgmode.files = { -- Agenda files to be included + os.getenv("HOME") .. "/.org/work.org", os.getenv("HOME") .. "/.org/index.org", + os.getenv("HOME") .. "/.org/personal.org", os.getenv("HOME") .. "/.org/computers.org" +} +myorgmode.colors = { -- Index: past, today, soon, future + '', '', + '', '' +} +-- Register widget +vicious.register(myorgwidget, vicious.widgets.org, + myorgmode.colors[1] .. '$1|' .. myorgmode.colors[2] .. '$2|' .. + myorgmode.colors[3] .. '$3|' .. myorgmode.colors[4] .. '$4', + 240, nil, myorgmode.files) +-- Register buttons +myorgwidget:buttons(awful.util.table.join( + awful.button({ }, 1, function () + awful.util.spawn("emacsclient --eval '(org-agenda-list)'", false) + end), + awful.button({ }, 3, function () + awful.util.spawn("emacsclient --eval '(make-remember-frame)'", false) + end))) +-- }}} + +-- {{{ Volume level, progressbar and changer +-- Widget icon +myvolicon = widget({ type = "imagebox", name = "myvolicon", align = "right" }) +myvolicon.image = image(beautiful.widget_vol) +-- Initialize widgets +myvolwidget = widget({ type = "textbox", name = "myvolwidget", align = "right" }) +myvolbarwidget = widget({ type = "progressbar", name = "myvolbarwidget", align = "right" }) +-- VOL progressbar properties +myvolbarwidget.width = 10 +myvolbarwidget.height = 0.9 +myvolbarwidget.gap = 0 +myvolbarwidget.border_padding = 1 +myvolbarwidget.border_width = 0 +myvolbarwidget.ticks_count = 4 +myvolbarwidget.ticks_gap = 1 +myvolbarwidget.vertical = true +myvolbarwidget:bar_properties_set("volume", { + bg = beautiful.bg_widget, + fg = beautiful.fg_widget, + fg_center = beautiful.fg_widget, + fg_end = beautiful.fg_end_widget, + fg_off = beautiful.fg_off_widget, + min_value = 0, + max_value = 100 }) +-- Register widgets +vicious.register(myvolwidget, vicious.widgets.volume, "$1%", 2, nil, "PCM") +vicious.register(myvolbarwidget, vicious.widgets.volume, "$1", 2, "volume", "PCM") +-- Register buttons +myvolbarwidget:buttons(awful.util.table.join( + awful.button({ }, 1, function () awful.util.spawn("kmix", false) end), + awful.button({ }, 2, function () awful.util.spawn("amixer -q sset Master toggle", false) end), + awful.button({ }, 4, function () awful.util.spawn("amixer -q sset PCM 2dB+", false) end), + awful.button({ }, 5, function () awful.util.spawn("amixer -q sset PCM 2dB-", false) end))) +-- Register buttons +myvolwidget:buttons( myvolbarwidget:buttons() ) +-- }}} + +-- {{{ Date, time and a calendar +-- Widget icon +mydateicon = widget({ type = "imagebox", name = "mydateicon", align = "right" }) +mydateicon.image = image(beautiful.widget_date) +-- Initialize widget +mydatewidget = widget({ type = "textbox", name = "mydatewidget", align = "right" }) +-- Register widget +vicious.register(mydatewidget, vicious.widgets.date, "%b %e, %R", 60) +-- Register buttons +mydatewidget:buttons(awful.util.table.join( + -- PyLendar: http://sysphere.org/~anrxc/j/archives/2009/03/11/desktop_calendars + awful.button({ }, 1, function () awful.util.spawn("pylendar.py", false) end))) +-- }}} + +-- {{{ System tray +-- Initialize widget +mysystray = widget({ type = "systray", align = "right" }) +-- }}} +-- }}} + +-- {{{ Wibox initialisation +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)) + +-- Add a wibox to each screen +for s = 1, screen.count() do + -- Create a promptbox + mypromptbox[s] = awful.widget.prompt({ align = "left" }) + -- Create an imagebox widget with icons indicating active layout + mylayoutbox[s] = widget({ type = "imagebox", align = "left" }) + 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 the taglist + mytaglist[s] = awful.widget.taglist(s, awful.widget.taglist.label.all, mytaglist.buttons) + -- Create the wibox + mywibox[s] = wibox({ position="top", height="14", fg=beautiful.fg_normal, bg=beautiful.bg_normal }) + -- Add widgets to the wibox (order matters) + mywibox[s].widgets = { mytaglist[s], + mylayoutbox[s], + mypromptbox[s], + mycpuicon, mythermalwidget, myspacer, mycpuwidget, + myseparator, + mybaticon, mybatwidget, myspacer, + myseparator, + mymemicon, myspacer, mymemwidget, myspacer, + myseparator, + myfsicon, myfswidget, myspacer, + myseparator, + myneticon, mynetwidget, myneticonup, + myseparator, + myneticon, mynetfiwidget, myneticonup, + myseparator, + mymailicon, myspacer, mymboxwidget, myspacer, + myseparator, + myorgicon, myorgwidget, myspacer, + myseparator, + myvolicon, myvolwidget, myspacer, myvolbarwidget, myspacer, + myseparator, + mydateicon, mydatewidget, + myseparator, + s == screen.count() and mysystray or nil + } + mywibox[s].screen = s +end +-- }}} +-- }}} + + +-- {{{ Mouse bindings +root.buttons(awful.util.table.join( + awful.button({ }, 3, function () + awful.prompt.run({ prompt = "Run: " }, mypromptbox[mouse.screen].widget, + function (...) mypromptbox[mouse.screen].text = awful.util.spawn(unpack(arg), false) end, + awful.completion.shell, awful.util.getdir("cache") .. "/history") + end), + awful.button({ }, 4, awful.tag.viewnext), + awful.button({ }, 5, awful.tag.viewprev) +)) +-- }}} + + +-- {{{ Key bindings +-- +-- {{{ Global keys +globalkeys = awful.util.table.join( + -- {{{ Applications + awful.key({ modkey }, "e", function () awful.util.spawn("emacsclient -n -c", false) end), + awful.key({ modkey }, "r", function () awful.util.spawn("rox", false) end), + awful.key({ modkey }, "u", function () awful.util.spawn("utorrent", false) end), + awful.key({ modkey }, "w", function () awful.util.spawn("firefox", false) end), + awful.key({ altkey }, "F1", function () awful.util.spawn("urxvt", false) end), + awful.key({ altkey }, "#49", function () teardrop.toggle("urxvt") end), + awful.key({ modkey }, "F2", function () teardrop.toggle("gmrun", 1, 0.08) end), + awful.key({ modkey }, "a", function () + awful.util.spawn("urxvt -title Alpine -e alpine_exp", false) + end), + awful.key({ modkey }, "g", function () + awful.util.spawn_with_shell("GTK2_RC_FILES=~/.gtkrc-gajim gajim", false) + end), + awful.key({ modkey }, "q", function () + awful.util.spawn("emacsclient --eval '(make-remember-frame)'", false) + end), + -- }}} + + -- {{{ Multimedia keys + awful.key({}, "#160", function () awful.util.spawn("kscreenlocker --forcelock", false) end), + awful.key({}, "#146", function () awful.util.spawn("khelpcenter", false) end), + -- pvol: http://sysphere.org/~anrxc/j/archives/2009/03/21/pvol_and_ossaudiodev + awful.key({}, "#121", function () awful.util.spawn("pvol.py -m", false) end), + awful.key({}, "#122", function () awful.util.spawn("pvol.py -p -c -2", false) end), + awful.key({}, "#123", function () awful.util.spawn("pvol.py -p -c 2", false) end), + -- plight: http://sysphere.org/~anrxc/j/archives/2009/05/13/plight_and_brightness + awful.key({}, "#232", function () awful.util.spawn("plight.py -s -a", false) end), + awful.key({}, "#233", function () awful.util.spawn("plight.py -s -a", false) end), + awful.key({}, "#244", function () awful.util.spawn("sudo /usr/sbin/pm-hibernate", false) end), + awful.key({}, "#150", function () awful.util.spawn("sudo /usr/sbin/pm-suspend", false) end), + awful.key({}, "#156", function () awful.util.spawn("emacsclient -n -c", false) end), + -- pypres: http://sysphere.org/~anrxc/j/archives/2009/07/23/python_presentation_manager + awful.key({}, "#225", function () awful.util.spawn("pypres.py", false) end), + awful.key({}, "#181", function () awful.util.spawn("xrefresh", false) end), + awful.key({}, "#180", function () awful.util.spawn("firefox -browser", false) end), + awful.key({}, "#163", function () awful.util.spawn("urxvt -title Alpine -e alpine", false) end), + awful.key({}, "#157", function () awful.util.spawn("geeqie", false) end), + awful.key({}, "Print",function () awful.util.spawn("ksnapshot", false) end), + -- }}} + + -- {{{ Prompt menus + -- - Run, Dictionary, Manual, Lua, SSH, Calculator and Web search + awful.key({ altkey }, "F2", function () + awful.prompt.run({ prompt = "Run: " }, mypromptbox[mouse.screen].widget, + function (...) mypromptbox[mouse.screen].text = awful.util.spawn(unpack(arg), false) end, + awful.completion.shell, awful.util.getdir("cache") .. "/history") + end), + awful.key({ altkey }, "F3", function () + awful.prompt.run({ prompt = "Dictionary: " }, mypromptbox[mouse.screen].widget, + function (words) + local xmessage = "xmessage -timeout 10 -file -" + awful.util.spawn_with_shell("crodict " .. words .. " | " .. xmessage, false) + end) + end), + awful.key({ altkey }, "F4", function () + awful.prompt.run({ prompt = "Manual: " }, mypromptbox[mouse.screen].widget, + function (page) awful.util.spawn("urxvt -e man " .. page, false) end, + function(cmd, cur_pos, ncomp) + local pages = {} + local m = 'IFS=: && find $(manpath||echo "$MANPATH") -type f -printf "%f\n"| cut -d. -f1' + local c, err = io.popen(m) + if c then while true do + local manpage = c:read("*line") + if not manpage then break end + if manpage:find("^" .. cmd:sub(1, cur_pos)) then + table.insert(pages, manpage) + end + end + c:close() + else io.stderr:write(err) end + if #cmd == 0 then return cmd, cur_pos end + if #pages == 0 then return end + while ncomp > #pages do ncomp = ncomp - #pages end + return pages[ncomp], cur_pos + end) + end), + awful.key({ altkey }, "F5", function () + awful.prompt.run({ prompt = "Run Lua code: " }, mypromptbox[mouse.screen].widget, + awful.util.eval, nil, awful.util.getdir("cache") .. "/history_eval") + end), + awful.key({ altkey }, "F10", function () + awful.prompt.run({ prompt = "Connect: " }, mypromptbox[mouse.screen].widget, + function (host) awful.util.spawn("urxvt -e ssh " .. host, false) end) + end), + awful.key({ altkey }, "F11", function () + awful.prompt.run({ prompt = "Calculate: " }, mypromptbox[mouse.screen].widget, + function (expr) + local xmessage = "xmessage -timeout 10 -file -" + awful.util.spawn_with_shell("echo '" .. expr .. ' = ' .. + awful.util.eval("return (" .. expr .. ")") .. "' | " .. xmessage, false) + end) + end), + awful.key({ altkey }, "F12", function () + awful.prompt.run({ prompt = "Web search: " }, mypromptbox[mouse.screen].widget, + function (command) + awful.util.spawn("firefox 'http://yubnub.org/parser/parse?command="..command.."'", false) + if tags[mouse.screen][3] then awful.tag.viewonly(tags[mouse.screen][3]) end + end) + end), + -- }}} + + -- {{{ Awesome controls + awful.key({ modkey, "Shift" }, "q", awesome.quit), + awful.key({ modkey, "Shift" }, "r", function () + mypromptbox[mouse.screen].text = awful.util.escape(awful.util.restart()) + end), + -- }}} + + -- {{{ Tag browsing + awful.key({ altkey }, "n", awful.tag.viewnext), + awful.key({ altkey }, "p", awful.tag.viewprev), + awful.key({ altkey }, "Escape", awful.tag.history.restore), + -- }}} + + -- {{{ Layout manipulation + 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" }, "l", function () awful.client.incwfact(-0.05) end), + awful.key({ modkey, "Shift" }, "h", function () awful.client.incwfact(0.05) end), + awful.key({ modkey }, "space", function () awful.layout.inc(layouts, 1) end), + awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(layouts, -1) end), + awful.key({ altkey, "Shift" }, "l", function () awful.tag.incnmaster(-1) end), + awful.key({ altkey, "Shift" }, "h", function () awful.tag.incnmaster(1) end), + awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1) end), + awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol(1) end), + -- }}} + + -- {{{ Focus controls + awful.key({ modkey }, "p", function () awful.screen.focus(1) end), + awful.key({ modkey }, "s", function () + for k, c in pairs(client.get(mouse.screen)) do + if c.minimized then -- Scratchpad replacement/imitation + awful.client.movetotag(awful.tag.selected(mouse.screen), c) + awful.client.floating.set(c, true) + awful.placement.centered(c) + c.minimized = false; c.sticky = true + client.focus = c; c:raise() + end + end + end), + awful.key({ altkey }, "Tab", 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({ 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 }, "#48", function () awful.client.focus.bydirection("down"); + if client.focus then client.focus:raise() end + end), + awful.key({ modkey }, "#34", function () awful.client.focus.bydirection("up"); + if client.focus then client.focus:raise() end + end), + awful.key({ modkey }, "#47", function () awful.client.focus.bydirection("left"); + if client.focus then client.focus:raise() end + end), + awful.key({ modkey }, "#51", function () awful.client.focus.bydirection("right"); + if client.focus then client.focus:raise() end + end), + 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, "Shift" }, "#48", function () awful.client.swap.bydirection("down") end), + awful.key({ modkey, "Shift" }, "#34", function () awful.client.swap.bydirection("up") end), + awful.key({ modkey, "Shift" }, "#47", function () awful.client.swap.bydirection("left") end), + awful.key({ modkey, "Shift" }, "#51", function () awful.client.swap.bydirection("right") end) + -- }}} +) +-- }}} + +-- {{{ Client manipulation +clientkeys = awful.util.table.join( + awful.key({ modkey }, "b", function () -- Hide the wibox + if mywibox[mouse.screen].screen == nil then mywibox[mouse.screen].screen = mouse.screen + else mywibox[mouse.screen].screen = nil end + end), + awful.key({ modkey }, "c", function (c) c:kill() end), + awful.key({ modkey }, "f", function (c) c.fullscreen = not c.fullscreen end), + awful.key({ modkey }, "m", function (c) + c.maximized_horizontal = not c.maximized_horizontal + c.maximized_vertical = not c.maximized_vertical + end), + awful.key({ modkey }, "o", awful.client.movetoscreen), + awful.key({ modkey }, "t", awful.client.togglemarked), + awful.key({ modkey }, "Next", function () awful.client.moveresize(20, 20, -20, -20) end), + awful.key({ modkey }, "Prior", function () awful.client.moveresize(-20, -20, 20, 20) end), + awful.key({ modkey }, "Down", function () awful.client.moveresize(0, 20, 0, 0) end), + awful.key({ modkey }, "Up", function () awful.client.moveresize(0, -20, 0, 0) end), + awful.key({ modkey }, "Left", function () awful.client.moveresize(-20, 0, 0, 0) end), + awful.key({ modkey }, "Right", function () awful.client.moveresize(20, 0, 0, 0) end), + awful.key({ modkey }, "d", function (c) c.minimized = not c.minimized end), + awful.key({ modkey, "Shift" }, "0", function (c) c.sticky = not c.sticky end), + awful.key({ modkey, "Shift" }, "o", function (c) c.ontop = not c.ontop end), + awful.key({ modkey, "Shift" }, "t", function (c) + if c.titlebar then awful.titlebar.remove(c) + else awful.titlebar.add(c, { modkey = modkey }) end + end), + awful.key({ modkey, "Control" }, "r", function (c) c:redraw() end), + awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle), + awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end), + -- Suspend/resume on focus changes could be auto. when running on bat power, if only suspending FF: + awful.key({ modkey, "Shift" }, "c", function (c) awful.util.spawn("kill -CONT "..c.pid, false) end), + awful.key({ modkey, "Shift" }, "s", function (c) awful.util.spawn("kill -STOP "..c.pid, false) end) +) +-- }}} + +-- {{{ Bind keyboard digits +keynumber = 0 +for s = 1, screen.count() do + keynumber = math.min(9, math.max(#tags[s], keynumber)); +end +-- }}} + +-- {{{ Tag controls +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) + -- If we are not managing this application at startup, + -- move it to the screen where the mouse is + if not startup and awful.client.focus.filter(c) then + c.screen = mouse.screen + -- Additionaly make sure it is not maximized + -- - common problem with apps like Firefox + c.maximized_vertical = false + c.maximized_horizontal = false + end + + -- Add a titlebar to each client if enabled globaly + -- - check the arrange hook for finer controls + if use_titlebar then + awful.titlebar.add(c, { modkey = modkey }) + c.titlebar.border_width = beautiful.border_width + c.titlebar.border_color = beautiful.border_focus + end + + -- Set client 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 clients may not receive focus (unfocusable), so set the border anyway + c.border_width = beautiful.border_width + c.border_color = beautiful.border_normal + + -- Check application->screen/tag mappings and floating state + local target_screen, target_tag, target_float + + for _, rule in pairs(apprules) do + if (((rule.cls == nil) or (c.class and c.class == rule.cls)) + and ((rule.ins == nil) or (c.instance and c.instance == rule.ins)) + and ((rule.name == nil) or (c.name and string.find(c.name, rule.name, 1, true)))) + then + target_screen = rule.scr + target_tag = rule.tag + target_float = rule.float + end + end + + -- Apply application->screen/tag mappings and floating state + if target_float then awful.client.floating.set(c, target_float) end + if target_screen then + c.screen = target_screen + awful.client.movetotag(tags[target_screen][target_tag], c) + end + + -- Focus after tag mapping + client.focus = c + + -- Set client key bindings + c:keys(clientkeys) + + -- Set new clients as slaves + awful.client.setslave(c) + + -- New floating windows: + -- - don't cover the wibox + awful.placement.no_offscreen(c) + -- - don't overlap until it's unavoidable + --awful.placement.no_overlap(c) + -- - are centered on the screen + --awful.placement.centered(c, c.transient_for) + + -- Honoring of size hints + -- - false will remove gaps between windows + c.size_hints_honor = false +end) +-- }}} + +-- {{{ Hook function to execute when arranging the screen +awful.hooks.arrange.register(function (screen) + -- Update layout imagebox widget with an icon indicating active layout + 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 + + -- If no window has focus or current one is a desktop or a dock: + if not client.focus then + -- - give focus to the latest client in history + local c = awful.client.focus.history.get(screen, 0) + -- - give focus the the client under the pointer + --local c = awful.mouse.client_under_pointer() + if c then client.focus = c end + end + + -- Fine grained borders and floaters control + local visible_clients = awful.client.visible(screen) + + if #visible_clients > 0 then + for _, c in pairs(visible_clients) do + -- Floating clients always have borders + if awful.client.floating.get(c) or layout == "floating" then + c.border_width = beautiful.border_width + if not c.fullscreen then + -- Floating clients always have titlebars + if not c.titlebar and c.class ~= "Xmessage" then + awful.titlebar.add(c, { modkey = modkey }) + end + -- Floating clients are always on top + c.above = true + end + -- Tiled clients don't have borders if only one client is visible + --elseif (#visible_clients == 1) or (layout == "max") then + -- - avoid flicker in max layout if floaters are on top + elseif #visible_clients == 1 then + visible_clients[1].border_width = 0 + else + c.border_width = beautiful.border_width + end + end + end +end) +-- }}} +-- }}} diff --git a/teardrop.lua b/teardrop.lua new file mode 100644 index 0000000..dd68940 --- /dev/null +++ b/teardrop.lua @@ -0,0 +1,141 @@ +--------------------------------------------------------------------------- +-- Drop down (quake-like) applications for the awesome window manager +-- * Updated on: Aug 24, 14:53:50 CEST 2009 +--------------------------------------------------------------------------- +-- Original by: Lucas de Vries +-- * http://awesome.naquadah.org/wiki/Drop-down_terminal +-- +-- Modified by: Adrian C. +-- * Original code turned into a module +-- * Startup notification disabled +-- * Slides in from the bottom of the screen by default +-- +-- Licensed under the WTFPL version 2 +-- * http://sam.zoy.org/wtfpl/COPYING +--------------------------------------------------------------------------- +-- To use this module add: +-- require("teardrop") +-- to the top of your rc.lua and call: +-- teardrop.toggle(prog, edge, height, screen) +-- from a keybinding. +-- +-- Parameters: +-- prog - Program to run, for example: "urxvt" or "gmrun" +-- edge - Screen edge (optional), 1 to drop down from the top of the +-- screen, by default it slides in from the bottom +-- height - Height (optional), in absolute pixels when > 1 or a height +-- percentage when < 1, 0.25 (25% of the screen) by default +-- screen - Screen (optional) +--------------------------------------------------------------------------- + +-- Grab environment +local pairs = pairs +local awful = require("awful") +local capi = { + mouse = mouse, + client = client, + screen = screen +} + + +-- Teardrop: Drop down (quake-like) applications for the awesome window manager +module("teardrop") + + +local dropdown = {} + +-- Drop down (quake-like) application toggle +-- +-- Create a new window for the drop-down application when it doesn't +-- exist, or toggle between hidden and visible states if one does +-- exist. +function toggle(prog, edge, height, screen) + if screen == nil then screen = capi.mouse.screen end + if height == nil then height = 0.25 end + if edge == nil then edge = 0 end + + if not dropdown[prog] then + -- Create table + dropdown[prog] = {} + + -- Add unmanage hook for dropdown programs + awful.hooks.unmanage.register(function (c) + for scr, cl in pairs(dropdown[prog]) do + if cl == c then + dropdown[prog][scr] = nil + end + end + end) + end + + if not dropdown[prog][screen] then + spawnw = function (c) + -- Store client + dropdown[prog][screen] = c + + -- Float client + awful.client.floating.set(c, true) + + -- Get screen geometry + screengeom = capi.screen[screen].workarea + + -- Calculate height + if height < 1 then + height = screengeom.height * height + end + + -- Screen edge + if edge < 1 then + -- Slide in from the bottom of the screen + -- * screen height (resolution-wibox)+wibox size-term height + screenedge = screengeom.height + screengeom.y - height + else + -- Drop down from the top of the screen + -- * not covering the wibox + --screenedge = screengeom.y + -- * covering the wibox + screenedge = screengeom.y - screengeom.y + end + + -- Resize client + c:geometry({ + x = screengeom.x, + y = screenedge, + width = screengeom.width, + height = height + }) + + -- Mark application as ontop + c.ontop = true + c.above = true + + -- Focus and raise client + c:raise() + capi.client.focus = c + + -- Remove hook + awful.hooks.manage.unregister(spawnw) + end + + -- Add hook + awful.hooks.manage.register(spawnw) + + -- Spawn program + awful.util.spawn(prog, false) + else + -- Get client + c = dropdown[prog][screen] + + -- Switch the client to the current workspace + awful.client.movetotag(awful.tag.selected(screen), c) + + -- Focus and raise if not hidden + if c.hide then + c.hide = false + c:raise() + capi.client.focus = c + else + c.hide = true + end + end +end diff --git a/zenburn.lua b/zenburn.lua new file mode 100644 index 0000000..2c5e1f2 --- /dev/null +++ b/zenburn.lua @@ -0,0 +1,133 @@ +------------------------------- +-- "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 = "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 = "#3F3F3F" +-- }}} + +-- {{{ 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" +-- }}} + +-- {{{ 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/squarefz.png" +theme.taglist_squares_unsel = confdir .. "/icons/taglist/squareza.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/tile.png" +theme.layout_tileleft = confdir .. "/icons/layouts/tileleft.png" +theme.layout_tilebottom = confdir .. "/icons/layouts/tilebottom.png" +theme.layout_tiletop = confdir .. "/icons/layouts/tiletop.png" +theme.layout_fairv = confdir .. "/icons/layouts/fairv.png" +theme.layout_fairh = confdir .. "/icons/layouts/fairh.png" +theme.layout_spiral = confdir .. "/icons/layouts/spiral.png" +theme.layout_dwindle = confdir .. "/icons/layouts/dwindle.png" +theme.layout_max = confdir .. "/icons/layouts/max.png" +theme.layout_fullscreen = confdir .. "/icons/layouts/fullscreen.png" +theme.layout_magnifier = confdir .. "/icons/layouts/magnifier.png" +theme.layout_floating = confdir .. "/icons/layouts/floating.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 -- cgit v1.2.3