diff --git a/autobeautiful.lua b/autobeautiful.lua new file mode 100644 index 0000000..0935cf7 --- /dev/null +++ b/autobeautiful.lua @@ -0,0 +1,12 @@ +local beautiful = require("beautiful") +local gears = require("gears") + +beautiful.init(awful.util.getdir("config") .. "/theme.lua") + +if beautiful.wallpaper then + for s = 1, screen.count() do + gears.wallpaper.maximized(beautiful.wallpaper, s, true) + end +end + +return beautiful diff --git a/bindings.lua b/bindings.lua index cc2845d..4a949f5 100644 --- a/bindings.lua +++ b/bindings.lua @@ -1,6 +1,15 @@ -local aweswt = require("aweswt") -local mb = require("modalbind") +-- key bindings +local awful = awful +local conf = conf local mpd = require("mpd") +local obvious = {} +local scratch = require("scratch") +obvious.popup_run_prompt = require("obvious.popup_run_prompt") + +local modkey = conf.modkey or "Mod4" +local mb = require("modalbind") + +local bindings = {mb = mb} -- {{{ Mouse bindings root.buttons(awful.util.table.join( @@ -9,14 +18,16 @@ awful.button({ }, 5, awful.tag.viewprev) )) -- }}} +local function spawnf(cmd) return function() awful.util.spawn(cmd) end end mpdmap = { name = "MPD", m = mpd.ctrl.toggle, n = mpd.ctrl.next, N = mpd.ctrl.prev, - s = function() awful.util.spawn("mpd") end, - g = function () awful.util.spawn(cmd.mpd_client) end + s = spawnf("mpd"), + S = spawnf("mpd --kill"), + g = spawnf(conf.cmd.mpd_client) } mpdpromts = { name = "MPD PROMPTS", @@ -28,91 +39,49 @@ mpdpromts = { progmap = { name = "PROGRAMS", - f = function () awful.util.spawn(cmd.browser) end, - i = function () awful.util.spawn(cmd.im_client) end, - m = function () awful.util.spawn(cmd.mail_client) end + f = spawnf(conf.cmd.browser), + i = spawnf(conf.cmd.im_client), + I = spawnf(conf.cmd.irc_client), + m = spawnf(conf.cmd.mail_client) } --- {{{ Key bindings -globalkeys = awful.util.table.join( - --{{{ Focus and Tags - awful.key({ modkey, }, "Left", awful.tag.viewprev ), - awful.key({ modkey, }, "Right", awful.tag.viewnext ), - awful.key({ modkey, }, "Escape", awful.tag.history.restore), +adapters = { u = "wwan", w = "wlan", b = "bluetooth" } +function rfkill(cmd) + map={ name = string.upper(cmd) } + for key, adapter in pairs(adapters) do + map[key] = spawnf("sudo rfkill "..cmd.." "..adapter) + end + print(map["name"]) + return map +end +-- wirelessmap = { +-- name = "RFKILL", +-- b = function () mb.grab(rfkill("block")) end, +-- u = function () mb.grab(rfkill("unblock")) 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, "Control" }, "j", function () - awful.screen.focus_relative( 1) - end), - - awful.key({ modkey, "Control" }, "k", function () - awful.screen.focus_relative(-1) - end), - - awful.key({ }, "Menu", aweswt.switch), - --}}} - - --{{{ 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, }, "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), - - 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), - - --}}} +function bindings.extend_and_register_key_table(globalkeys) + local totalkeys = globalkeys or {} + totalkeys = awful.util.table.join(totalkeys, + awful.key({ }, "Menu", spawnf('wmselect')), awful.key({ modkey, "Control" }, "r", awesome.restart), awful.key({ modkey, "Shift" }, "q", awesome.quit), - awful.key({ modkey, }, "Return", function () awful.util.spawn(cmd.terminal) end), + awful.key({ modkey, }, "Return", spawnf(conf.cmd.terminal)), --{{{ Modal mappings awful.key({ modkey }, "m", function () mb.grab(mpdmap, true) end), awful.key({ modkey, "Shift" }, "m", function () mb.grab(mpdpromts) end), awful.key({ modkey }, "c", function () mb.grab(progmap) end), - + awful.key({ modkey }, "w", function () mb.grab(wirelessmap) end), --}}} --{{{ Audio control - awful.key({ }, "XF86AudioLowerVolume", function () awful.util.spawn("amixer set Master 2%-")end ), - awful.key({ }, "XF86AudioRaiseVolume", function () awful.util.spawn("amixer set Master 2%+")end ), - awful.key({ }, "XF86AudioMute", function () awful.util.spawn("amixer set Master toggle") end), + awful.key({ }, "XF86AudioLowerVolume", spawnf("amixer set Master 2%-")), + awful.key({ }, "XF86AudioRaiseVolume", spawnf("amixer set Master 2%+")), + awful.key({ }, "XF86AudioMute", spawnf("amixer set Master toggle")), awful.key({ }, "XF86AudioPlay", mpd.ctrl.toggle), awful.key({ }, "XF86AudioNext", mpd.ctrl.next), awful.key({ }, "XF86AudioPrev", mpd.ctrl.prev), @@ -120,38 +89,38 @@ globalkeys = awful.util.table.join( --}}} -- {{{ teardrops - awful.key({ }, "F12", function () teardrop(cmd.terminal,"center","center", 0.99, 0.7)end ), - awful.key({ modkey }, "`", function () teardrop("urxvtc -e ncmpcpp","bottom","center", 0.99, 0.4)end ), - awful.key({ }, "Print", function () teardrop("urxvtc -e alsamixer","top","center", 0.99, 0.4)end ), + awful.key({ }, "F12", function () + scratch.drop(conf.cmd.terminal,"center","center", 0.99, 0.7) + end ), + awful.key({ modkey }, "`", function () + scratch.drop("urxvtc -e ncmpcpp","bottom","center", 0.99, 0.4) + end ), + awful.key({ }, "Print", function () + scratch.drop("galsamixer","top","center", 0.99, 0.4) + end ), -- }}} --{{{ Prompt - awful.key({ modkey }, "r", function () - obvious.popup_run_prompt.set_prompt_string(" Run~ ") - obvious.popup_run_prompt.set_cache("history") - obvious.popup_run_prompt.set_run_function(awful.util.spawn) - obvious.popup_run_prompt.run_prompt() - end), - awful.key({ modkey }, "e", function () - obvious.popup_run_prompt.set_prompt_string(" exec Lua~ ") - obvious.popup_run_prompt.set_cache("history_eval") - obvious.popup_run_prompt.set_run_function(awful.util.eval) - obvious.popup_run_prompt.run_prompt() - end), + awful.key({ modkey }, "r", spawnf("dmenu_run")), + + awful.key({ modkey }, "s", spawnf("dmsearch")), --}}} --{{{ misc. XF86 Keys - awful.key({ }, "XF86Sleep", function () awful.util.spawn("/usr/local/bin/s2ram")end ), - awful.key({ }, "XF86Away", function () awful.util.spawn("xlock")end ), - awful.key({ }, "XF86TouchpadToggle", function () awful.util.spawn("touchpad")end ), + awful.key({ }, "XF86Sleep", spawnf("s2ram")), + awful.key({ }, "XF86Away", spawnf("xlock")), + awful.key({ }, "XF86TouchpadToggle", spawnf("touchpad")) + ) --}}} - awful.key({ modkey }, "BackSpace", rodentbane.start) -) + -- Set keys + root.keys(totalkeys) +end + function client_opacity_set(c, default, max, step) if c.opacity < 0 or c.opacity > 1 then @@ -165,7 +134,6 @@ function client_opacity_set(c, default, max, step) end 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), @@ -181,60 +149,10 @@ clientkeys = awful.util.table.join( awful.key({ }, "XF86Calculater", awful.client.movetoscreen ) ) --- Compute the maximum number of digit we need, limited to 22 -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) --- }}} +return bindings -- vim: set fenc=utf-8 tw=80 foldmethod=marker : - diff --git a/boxes.lua b/boxes.lua deleted file mode 100644 index 20f64b4..0000000 --- a/boxes.lua +++ /dev/null @@ -1,188 +0,0 @@ -local wibox = require("wibox") -function exists(filename) - local file = io.open(filename) - if file then - io.close(file) - return true - else - return false - end -end - - --- {{{ Reusable separators -spacer = wibox.widget.textbox({ name = "spacer" }) -spacer.set_text(" ") - -nullwidget = wibox.widget.textbox({ name = "nullwidget" }) --- }}} - --- {{{ Wibox - ---popup run - --- Create a textclock widget ---clock = awful.widget.textclock({ align = "right" }) -mysystray = wibox.widget.systray() - -clock = wibox.widget.textbox() -vicious.register(clock, vicious.widgets.date, "%b %d, %R", 60) - - --- music widget {{{ -mpdwidget = wibox.widget.textbox() -vicious.register(mpdwidget, vicious.widgets.mpd, - function(widget, args) - if args["{state}"] == "N/A" then - return "" - else - return "[ ♫ "..args["{Artist}"].." - "..args["{Title}"].." ]" - end - end, 3, {nil, os.getenv("MPD_HOST"), os.getenv("MPD_PORT")}) --- }}} - --- mail widget {{{ -mailwidget = wibox.widget.textbox() -vicious.register(mailwidget, vicious.widgets.mdir, - function(widget, args) - if args[1] > 0 then - naughty.notify({ - title = "New mail arrived", - text = "Unread "..args[2].." / New "..args[1], - position = "top_left" - - }) - widget.bg = theme.bg_urgent - widget.fg = theme.fg_urgent - elseif args[2] > 0 then - widget.bg = theme.bg_focus - widget.fg = theme.fg_focus - else - widget.bg = theme.bg_normal - widget.fg = theme.fg_normal - end - return "⬓⬓ Unread "..args[2].." / New "..args[1].. " " - end, 181, {os.getenv("HOME") .. "/.maildir/"}) ---}}} - --- battery {{{ -if exists("/sys/class/power_supply/BAT0") then - batwidget0 = wibox.widget.textbox() - vicious.register(batwidget0, vicious.widgets.bat, - function (widget, args) - if args[2] == 0 then return "" - else - if args[2] < 15 then - widget.bg = theme.bg_urgent - widget.fg = theme.fg_urgent - else - widget.bg = theme.bg_normal - widget.fg = theme.fg_normal - end - return "( BAT0: "..args[1]..args[2].."% - "..args[3].." )" - end - end, 61, "BAT0") -else batwidget0 = nullwidget end - -if exists("/sys/class/power_supply/BAT1") then - batwidget1 = wibox.widget.textbox() - vicious.register(batwidget1, vicious.widgets.bat, - function (widget, args) - if args[2] == 0 then return "" - else - if args[2] < 15 then - widget.bg = theme.bg_urgent - widget.fg = theme.fg_urgent - else - widget.bg = theme.bg_normal - widget.fg = theme.fg_normal - end - return "( BAT1: "..args[1]..args[2].."% - "..args[3].." )" - end - end, 61, "BAT1") -else batwidget1 = nullwidget end - -if exists("/sys/class/power_supply/BAT2") then - batwidget2 = wibox.widget.textbox() - vicious.register(batwidget2, vicious.widgets.bat, - function (widget, args) - if args[2] == 0 then return "" - else - if args[2] < 15 then - widget.bg = theme.bg_urgent - widget.fg = theme.fg_urgent - else - widget.bg = theme.bg_normal - widget.fg = theme.fg_normal - end - return "( BAT2: "..args[1]..args[2].."% - "..args[3].." )" - end - end, 61, "BAT2") -else batwidget2 = nullwidget end - ---}}} - -cpulabel = wibox.widget.textbox() -vicious.register(cpulabel, vicious.widgets.cpu, "CPU: $1%") - -if exists("/sys/class/net/wlan0") then - wlanwidget = wibox.widget.textbox() - vicious.register(wlanwidget, vicious.widgets.wifi, " )( WLAN ${ssid} @ ${sign}, Q:${link}/70", 31, "wlan0") -else wlanwidget = nullwidget end - --- 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 - 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, width = 18 }) - rightwibox[s] = awful.wibox({ position = "right", screen = s , width = 18}) - -- Add widgets to the wibox - order matters - leftwibox[s].widgets = { - mytaglist[s], - mylayoutbox[s], - mailwidget, - spacer, - layout = awful.widget.layout.horizontal.rightleft - } - rightwibox[s].widgets = { - { - clock, spacer, - batwidget0, - batwidget1, - batwidget2, - wlanwidget, - spacer, cpulabel, cpuwidget, - spacer, mpdwidget, mpdnext, spacer, mpdprev, - spacer, - layout = awful.widget.layout.horizontal.leftright - }, - separator, spacer, mysystray, - layout = awful.widget.layout.horizontal.leftright - } -end --- }}} --- --- vim:foldmethod=marker diff --git a/errors.lua b/errors.lua new file mode 100644 index 0000000..268b601 --- /dev/null +++ b/errors.lua @@ -0,0 +1,27 @@ +-- Notification library +local naughty = naughty + +-- {{{ Error handling +-- Check if awesome encountered an error during startup and fell back to +-- another config (This code will only ever execute for the fallback config) +if awesome.startup_errors then + naughty.notify({ preset = naughty.config.presets.critical, + title = "Oops, there were errors during startup!", + text = awesome.startup_errors }) +end + +-- Handle runtime errors after startup +do + local in_error = false + awesome.connect_signal("debug::error", function (err) + -- Make sure we don't go into an endless error loop + if in_error then return end + in_error = true + + naughty.notify({ preset = naughty.config.presets.critical, + title = "Oops, an error happened!", + text = err }) + in_error = false + end) +end +-- }}} diff --git a/layouts.lua b/layouts.lua new file mode 100644 index 0000000..7bf2a52 --- /dev/null +++ b/layouts.lua @@ -0,0 +1,90 @@ +local awful = awful +local conf = conf +local modkey = conf.modkey or "Mod4" + +local layouts={ mt={} } +local list = { + 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 +} + +function layouts.set_list(layout_list) + list = layout_list +end + +function layouts.extend_key_table(globalkeys) + local layoutkeys = globalkeys or {} + return awful.util.table.join(layoutkeys, + 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 }, "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), + 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(list, 1) + end), + awful.key({ modkey, "Shift" }, "space", function () + awful.layout.inc(list, -1) + 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, "Control" }, "j", function () + awful.screen.focus_relative( 1) + end), + awful.key({ modkey, "Control" }, "k", function () + awful.screen.focus_relative(-1) + end), + awful.key({ modkey }, "Left", awful.tag.viewprev ), + awful.key({ modkey }, "Right", awful.tag.viewnext ), + awful.key({ modkey }, "Escape", awful.tag.history.restore) + ); +end + +layouts.mt.__index = list +layouts.mt.__newindex = list +return setmetatable(layouts, layouts.mt) diff --git a/modalbind.lua b/modalbind.lua index ee56437..f3f027c 100644 --- a/modalbind.lua +++ b/modalbind.lua @@ -4,7 +4,153 @@ local modewidget = {} local modewibox = { screen = -1 } --local functions -local ensure_init, set_default, update_settings, show_box, hide_box + +local defaults = {} + +defaults.opacity = 1.0 +defaults.height = 22 +defaults.border_width = 1 +defaults.x_offset = 0 +defaults.y_offset = 0 +defaults.show_options = true + +-- Clone the defaults for the used settings +local settings = {} +for key, value in pairs(defaults) do + settings[key] = value +end + +local function update_settings() + for s, value in ipairs(modewibox) do + value.border_width = settings.border_width + set_default(s) + value.opacity = settings.opacity + end +end + + +--- Change the opacity of the modebox. +-- @param amount opacity between 0.0 and 1.0, or nil to use default +M.set_opacity = function (amount) + settings.opacity = amount or defaults.opacity + update_settings() +end + +--- Change height of the modebox. +-- @param amount height in pixels, or nil to use default +M.set_height = function (amount) + settings.height = amount or defaults.height + update_settings() +end + +--- Change border width of the modebox. +-- @param amount width in pixels, or nil to use default +M.set_border_width = function (amount) + settings.border_width = amount or defaults.border_width + update_settings() +end + +--- Change horizontal offset of the modebox. +-- set location for the box with set_corner(). The box is shifted to the right +-- if it is in one of the left corners or to the left otherwise +-- @param amount horizontal shift in pixels, or nil to use default +M.set_x_offset = function (amount) + settings.x_offset = amount or defaults.x_offset + update_settings() +end + +--- Change vertical offset of the modebox. +-- set location for the box with set_corner(). The box is shifted downwards if it +-- is in one of the upper corners or upwards otherwise. +-- @param amount vertical shift in pixels, or nil to use default +M.set_y_offset = function (amount) + settings.y_offset = amount or defaults.y_offset + update_settings() +end + +--- Set the corner, where the modebox will be displayed +-- If a parameter is not a valid orientation (see below), the function returns +-- without doing anything +-- @param vertical either top or bottom +-- @param horizontal either left or right +M.set_corner = function (vertical, horizontal) + if (vertical ~= "top" and vertical ~= "bottom") then + return + end + if (horizontal ~= "left" and horizontal ~= "right") then + return + end + settings.corner_v = vertical or defaults.corner_v + settings.corner_h = horizontal or defaults.corner_h +end + +M.set_show_options = function (bool) + settings.show_options = bool +end + +local function set_default(s) + minwidth, minheight = modewidget[s]:fit(screen[s].geometry.width, + screen[s].geometry.height) + modewibox[s].width = minwidth + 1; + modewibox[s].height = math.max(settings.height, minheight) + modewibox[s].x = settings.x_offset < 0 and + screen[s].geometry.x - width + settings.x_offset or + settings.x_offset + modewibox[s].y = screen[s].geometry.height - settings.height +end + +local function ensure_init() + if inited then + return + end + inited = true + for s = 1, screen.count() do + modewidget[s] = wibox.widget.textbox() + modewidget[s]:set_align("center") + + modewibox[s] = wibox({ + fg = beautiful.fg_normal, + bg = beautiful.bg_normal, + border_width = settings.border_width, + border_color = beautiful.bg_focus, + }) + + local modelayout = {} + modelayout[s] = wibox.layout.fixed.horizontal() + modelayout[s]:add(modewidget[s]) + modewibox[s]:set_widget(modelayout[s]); + set_default(s) + modewibox[s].visible = false + modewibox[s].screen = s + modewibox[s].ontop = true + + -- Widgets for prompt wibox + modewibox[s].widgets = { + modewidget[s], + layout = wibox.layout.fixed.horizontal + } + end +end + +local function show_box(s, map) + ensure_init() + modewibox.screen = s + local label = " -- " .. map.name .. " -- " + if settings.show_options then + for key in pairs(map) do + if key ~= "name" then label = label .. " " .. key end + end + end + modewidget[s]:set_text(label) + modewibox[s].visible = true + set_default(s) +end + +local function hide_box() + local s = modewibox.screen + if s ~= -1 then modewibox[s].visible = false end +end + M.grab = function(keymap, stay_in_mode) if keymap.name then show_box(mouse.screen, keymap) end @@ -31,118 +177,10 @@ M.grab = function(keymap, stay_in_mode) return true end) end - --- Partially adapted from Obvious Widget Library module "popup_run_prompt" -- --- Original Author: Andrei "Garoth" Thorp -- --- Copyright 2009 Andrei "Garoth" Thorp -- - -local defaults = {} --- Default is 1 for people without compositing -defaults.opacity = 1.0 -defaults.height = 22 -defaults.border_width = 1 -defaults.x_offset = 18 -defaults.show_options = true - --- Clone the defaults for the used settings -local settings = {} -for key, value in pairs(defaults) do - settings[key] = value +M.grabf = function(keymap, stay_in_mode) + return function() M.grab(keymap, stay_in_mode) end end - -M.set_opacity = function (amount) - settings.opacity = amount or defaults.opacity - update_settings() -end - -M.set_height = function (amount) - settings.height = amount or defaults.height - update_settings() -end - -M.set_border_width = function (amount) - settings.border_width = amount or defaults.border_width - update_settings() -end - -M.set_x_offset = function (amount) - settings.x_offset = amount or defaults.x_offset - update_settings() -end - -M.set_show_options = function (bool) - settings.show_options = bool -end - -ensure_init = function () - if inited then - return - end - - inited = true - for s = 1, screen.count() do - modewidget[s] = widget({ - type = "textbox", - name = "modewidget" .. s, - align = "center" - }) - - modewibox[s] = wibox({ - fg = beautiful.fg_normal, - bg = beautiful.bg_normal, - border_width = settings.border_width, - border_color = beautiful.bg_focus, - }) - set_default(s) - modewibox[s].visible = false - modewibox[s].screen = s - modewibox[s].ontop = true - - -- Widgets for prompt wibox - modewibox[s].widgets = { - modewidget[s], - layout = awful.widget.layout.vertical.center - } - end -end - -set_default = function (s) - modewibox[s]:geometry({ - width = modewidget[s].extents(modewidget[s]).width, - height = settings.height, - x = settings.x_offset < 0 and - screen[s].geometry.x - width + settings.x_offset or - settings.x_offset, - y = screen[s].geometry.y + screen[s].geometry.height - settings.height - }) -end - -update_settings = function () - for s, value in ipairs(modewibox) do - value.border_width = settings.border_width - set_default(s) - value.opacity = settings.opacity - end -end - -show_box = function (s, map) - ensure_init() - modewibox.screen = s - local label = " -- " .. map.name .. " -- " - if settings.show_options then - for key in pairs(map) do - if key ~= "name" then label = label .. " " .. key end - end - end - modewidget[s].text = label - set_default(s) - modewibox[s].visible = true -end - -hide_box = function () - local s = modewibox.screen - if s ~= -1 then modewibox[s].visible = false end -end +M.wibox = function() return modewibox[1] end return M diff --git a/mpd.lua b/mpd.lua index aeade91..1d8239c 100644 --- a/mpd.lua +++ b/mpd.lua @@ -2,6 +2,7 @@ require "mpdc" local M = {} local type = "" +local conf = conf -- local functions local show, mpc_play_search, notify @@ -74,9 +75,9 @@ end -- {{{ mpd.prompt submodule -local clear_before = cfg.mpd_prompt_clear_before == nil and +local clear_before = conf.mpd_prompt_clear_before == nil and true or - cfg.mpd_prompt_clear_before + conf.mpd_prompt_clear_before M.prompt = {} diff --git a/obvious b/obvious index dccf3cb..c5b8844 160000 --- a/obvious +++ b/obvious @@ -1 +1 @@ -Subproject commit dccf3cb530ff250c0e5db363d04e1ef803cb3808 +Subproject commit c5b884459194a15a38b88c99d5558a64efaf4e89 diff --git a/rc.lua b/rc.lua index 5cd37d5..3183d93 100644 --- a/rc.lua +++ b/rc.lua @@ -1,38 +1,68 @@ +-- libraries {{{ +awful = require("awful") +awful.rules = require("awful.rules") + require("awful.autofocus") +wibox = require("wibox") +beautiful = require("autobeautiful") +naughty = require("naughty") +conf = require("localconf") + require("errors") +-- }}} --- Standard awesome library -require("awful") -require("awful.autofocus") -require("awful.rules") -require("beautiful") -require("naughty") -require("teardrop") -require("obvious.popup_run_prompt") -require("vicious") -require("rodentbane.rodentbane") +layouts = require('layouts') -MY_PATH = os.getenv("HOME") .. "/.config/awesome/" +-- {{{ Tags -dofile (MY_PATH .. "localconf.lua") +tags = require('tags') +tags.setup() +-- }}} --- Themes define colours, icons, and wallpapers -beautiful.init("/home/crater2150/.config/awesome/zenburn/theme.lua") +-- {{{ widgets +widgets = require("widgets") +widgets.setup() +for s = 1, screen.count() do + local ltop = widgets.layout(s,"left","top") + local rtop = widgets.layout(s,"right","top") + local lbottom = widgets.layout(s,"left","bottom") + -- {{{ + widgets.add.mail(s, ltop, { os.getenv("HOME") .. "/.maildir/" }) + widgets.add.spacer(ltop) + widgets.add.clock(s, ltop) --- Table of layouts to cover with awful.layout.inc, order matters. -layouts = -{ - 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 -} + widgets.add.layout(s, lbottom) + widgets.add.taglist(s, lbottom) -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") --- dofile (MY_PATH .. "uzbl.lua") + widgets.add.cpu(s, rtop) + widgets.add.spacer(rtop) + widgets.add.battery(s, rtop, "BAT0") + widgets.add.spacer(rtop) + widgets.add.battery(s, rtop, "BAT1") + widgets.add.spacer(rtop) + widgets.add.wifi(s, rtop, "wlan0") + widgets.add.spacer(rtop) + widgets.add.systray(s, rtop) + + widgets.set_spacer_text(" ◈ ") +end +-- }}} + +-- {{{ Key bindings +globalkeys = {} +globalkeys = layouts.extend_key_table(globalkeys); +globalkeys = tags.extend_key_table(globalkeys); + +bindings = require("bindings") +bindings.extend_and_register_key_table(globalkeys) +bindings.mb.set_x_offset(18) +-- }}} + +-- {{{ rules +rules = require("rules") +rules.setup() +-- }}} + +require("signals") + +-- +-- vim: fdm=marker diff --git a/rules.lua b/rules.lua index 475b6f5..b512885 100644 --- a/rules.lua +++ b/rules.lua @@ -1,67 +1,151 @@ +local rules = { mt={} } +local awful = awful +local conf = conf +local tags = tags +local beautiful = beautiful +local inspect=require("inspect") -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, - minimized = false, - --skip_taskbar = true, - buttons = clientbuttons } }, - { rule = { class = "MPlayer" }, - properties = { floating = true, - size_hints_honor = true } }, - { rule = { class = "Passprompt" }, - properties = { floating = true, - ontop = true, - focus = true } }, - { rule = { class = "pinentry" }, - properties = { floating = true } }, - -- Set Firefox to always map on tags number 2 of screen 1. - { rule = { class = "Uzbl-core" }, - properties = { tag = tags[rule_screen][2], - skip_taskbar = false } }, - { rule = { class = "Firefox", instance = "Navigator" }, - properties = { tag = tags[rule_screen][2], - floating = false, minimized = false } }, - { rule = { class = "Pidgin" }, - properties = { tag = tags[rule_screen][3], opacity = 0.9 } }, - { rule = { role = "buddy_list" }, - properties = { master = true } }, - { rule = { role = "conversation" }, - callback = awful.client.setslave }, - { rule = { instance = "Weechat"}, - properties = { tag = tags[rule_screen][3]} , - callback = awful.client.setslave}, - { rule = { class = "Irssi"}, - properties = { tag = tags[rule_screen][3]} , - callback = awful.client.setslave}, - { rule = { class = "Claws-mail" }, - properties = { tag = tags[rule_screen][4] } }, - { rule = { instance = "Gmutt" }, - properties = { tag = tags[rule_screen][4] } }, - { rule = { instance = "Gcanto" }, - properties = { tag = tags[rule_screen][5] } }, - { rule = { instance = "Gncmpcpp" }, - properties = { tag = tags[rule_screen][6] } }, - { rule = { class = "Gmpc" }, - properties = { tag = tags[rule_screen][6] } }, - { rule = { class = "Deluge" }, - properties = { tag = tags[rule_screen][7] } }, - { rule = { class = "Cellwriter" }, - properties = { tag = tags[rule_screen][1], - ontop = true, - size_hints_honor = true, - float = true, - sticky = true, - fullscreen = true - } }, - { rule = { class = "Xhtop" }, - properties = { tag = tags[rule_screen][22] } }, - { rule = { class = "URxvt" }, - properties = { opacity = 0.9 } }, - { rule = { instance = "URxvt" }, - properties = { opacity = 0.9 } }, -} +local rule_screen = conf.rule_screen or 1 + +local function setup(self) + 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, + minimized = false, + --skip_taskbar = true, + buttons = clientbuttons + } + }, + { + rule = { class = "Passprompt" }, + properties = { ontop = true, focus = true} + }, + { + rule_any = { class = { + "pinentry", "Passprompt", "MPlayer" + }}, + properties = { floating = true, size_hints_honor = true } + }, + + { + rule = { class = "Firefox", instance = "Navigator" }, + properties = { + tag = tags[rule_screen][2], + floating = false, minimized = false + } + }, + { + rule_any = { class = {"Pidgin"}, instance = {"Weechat"} }, + properties = { + tag = tags[rule_screen][3], opacity = 0.9 + } + }, + { + rule = { role = "buddy_list" }, + properties = { + master = true + } + }, + { + rule_any = { role ={ "conversation" }, instance = { "Weechat" } }, + callback = awful.client.setslave + }, + { + rule = { class = "Irssi"}, + properties = { + tag = tags[rule_screen][3] + } , + callback = awful.client.setslave + }, + { + rule = { class = "Claws-mail" }, + properties = { + tag = tags[rule_screen][4] + } + }, + { + rule = { instance = "Gmutt" }, + properties = { + tag = tags[rule_screen][4] + } + }, + { + rule = { instance = "Gcanto" }, + properties = { + tag = tags[rule_screen][5] + } + }, + { + rule = { instance = "Gncmpcpp" }, + properties = { + tag = tags[rule_screen][6] + } + }, + { + rule = { class = "Gmpc" }, + properties = { + tag = tags[rule_screen][6] + } + }, + { + rule = { class = "Deluge" }, + properties = { + tag = tags[rule_screen][7] + } + }, + { + rule = { class = "Cellwriter" }, + properties = { + tag = tags[rule_screen][1], + ontop = true, + size_hints_honor = true, + float = true, + sticky = true, + fullscreen = true + } + }, + { + rule = { class = "Xhtop" }, + properties = { + tag = tags[rule_screen][22] + } + }, + { + rule = { class = "URxvt" }, + properties = { + opacity = 0.9 + } + }, + { + rule = { class = "Gvim" }, + properties = { + opacity = 0.9 + } + }, + { + rule = { instance = "Awesomelog" }, + properties = { + tag = tags[rule_screen][14] + } + }, + { + rule = { class = "GLSlideshow" }, + properties = { + + } + } + } +end + +rules.setup = setup + +rules.mt.__call = setup + +return setmetatable(rules, rules.mt) diff --git a/teardrop.lua b/scratch/drop.lua similarity index 71% rename from teardrop.lua rename to scratch/drop.lua index f9ce7bb..4690e65 100644 --- a/teardrop.lua +++ b/scratch/drop.lua @@ -1,26 +1,27 @@ ----------------------------------------------------------------- +------------------------------------------------------------------- -- Drop-down applications manager for the awesome window manager ----------------------------------------------------------------- --- Adrian C. +------------------------------------------------------------------- +-- Coded by: * Lucas de Vries +-- Hacked by: * Adrian C. (anrxc) -- Licensed under the WTFPL version 2 -- * http://sam.zoy.org/wtfpl/COPYING ----------------------------------------------------------------- +------------------------------------------------------------------- -- To use this module add: --- require("teardrop") +-- local scratch = require("scratch") -- to the top of your rc.lua, and call it from a keybinding: --- teardrop(prog, vert, horiz, width, height, sticky, screen) +-- scratch.drop(prog, vert, horiz, width, height, sticky, screen) -- -- Parameters: -- prog - Program to run; "urxvt", "gmrun", "thunderbird" -- vert - Vertical; "bottom", "center" or "top" (default) -- horiz - Horizontal; "left", "right" or "center" (default) -- width - Width in absolute pixels, or width percentage --- when < 1 (0.9999 (99.9% of the screen) by default) +-- when <= 1 (1 (100% of the screen) by default) -- height - Height in absolute pixels, or height percentage --- when < 1 (0.25 (25% of the screen) by default) +-- when <= 1 (0.25 (25% of the screen) by default) -- sticky - Visible on all tags, false by default -- screen - Screen (optional), mouse.screen by default ----------------------------------------------------------------- +------------------------------------------------------------------- -- Grab environment local pairs = pairs @@ -32,26 +33,31 @@ local capi = { screen = screen } --- Teardrop: Drop-down applications manager for the awesome window manager -module("teardrop") +-- Scratchdrop: drop-down applications manager for the awesome window manager +local drop = {} -- module scratch.drop + local dropdown = {} -- Create a new window for the drop-down application when it doesn't -- exist, or toggle between hidden and visible states when it does function toggle(prog, vert, horiz, width, height, sticky, screen) - local vert = vert or "top" - local horiz = horiz or "center" - local width = width or 0.9999 - local height = height or 0.25 - local sticky = sticky or false - local screen = screen or capi.mouse.screen + vert = vert or "top" + horiz = horiz or "center" + width = width or 1 + height = height or 0.25 + sticky = sticky or false + screen = screen or capi.mouse.screen + + -- Determine signal usage in this version of awesome + local attach_signal = client.connect_signal or client.add_signal + local detach_signal = client.disconnect_signal or client.remove_signal if not dropdown[prog] then dropdown[prog] = {} - -- Add unmanage signal for teardrop programs - capi.client.add_signal("unmanage", function (c) + -- Add unmanage signal for scratchdrop programs + attach_signal("unmanage", function (c) for scr, cl in pairs(dropdown[prog]) do if cl == c then dropdown[prog][scr] = nil @@ -64,14 +70,14 @@ function toggle(prog, vert, horiz, width, height, sticky, screen) spawnw = function (c) dropdown[prog][screen] = c - -- Teardrop clients are floaters + -- Scratchdrop clients are floaters awful.client.floating.set(c, true) -- Client 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 + if width <= 1 then width = screengeom.width * width end + if height <= 1 then height = screengeom.height * height end if horiz == "left" then x = screengeom.x elseif horiz == "right" then x = screengeom.width - width @@ -91,18 +97,18 @@ function toggle(prog, vert, horiz, width, height, sticky, screen) c:raise() capi.client.focus = c - capi.client.remove_signal("manage", spawnw) + detach_signal("manage", spawnw) end -- Add manage signal and spawn the program - capi.client.add_signal("manage", spawnw) + attach_signal("manage", spawnw) awful.util.spawn(prog, false) else -- Get a running client c = dropdown[prog][screen] -- Switch the client to the current workspace - if c:isvisible() == false then c.hidden = true; + if c:isvisible() == false then c.hidden = true awful.client.movetotag(awful.tag.selected(screen), c) end @@ -117,7 +123,7 @@ function toggle(prog, vert, horiz, width, height, sticky, screen) else -- Hide and detach tags if not c.hidden = true local ctags = c:tags() - for i, v in pairs(ctags) do + for i, t in pairs(ctags) do ctags[i] = nil end c:tags(ctags) @@ -125,4 +131,4 @@ function toggle(prog, vert, horiz, width, height, sticky, screen) end end -setmetatable(_M, { __call = function(_, ...) return toggle(...) end }) +return setmetatable(drop, { __call = function(_, ...) return toggle(...) end }) diff --git a/scratch/init.lua b/scratch/init.lua new file mode 100644 index 0000000..f3b3e7e --- /dev/null +++ b/scratch/init.lua @@ -0,0 +1,14 @@ +--------------------------------------------------------------- +-- Drop-down applications and scratchpad manager for awesome wm +--------------------------------------------------------------- +-- Coded by: * Adrian C. (anrxc) +-- Licensed under the WTFPL version 2 +-- * http://sam.zoy.org/wtfpl/COPYING +--------------------------------------------------------------- + +local scratch = {} -- module scratch + +scratch.pad = require("scratch.pad") +scratch.drop = require("scratch.drop") + +return scratch diff --git a/scratch/pad.lua b/scratch/pad.lua new file mode 100644 index 0000000..1208aab --- /dev/null +++ b/scratch/pad.lua @@ -0,0 +1,137 @@ +--------------------------------------------------------------- +-- Basic scratchpad manager for the awesome window manager +--------------------------------------------------------------- +-- Coded by: * Adrian C. (anrxc) +-- Licensed under the WTFPL version 2 +-- * http://sam.zoy.org/wtfpl/COPYING +--------------------------------------------------------------- +-- To use this module add: +-- local scratch = require("scratch") +-- to the top of your rc.lua, and call: +-- scratch.pad.set(c, width, height, sticky, screen) +-- from a clientkeys binding, and: +-- scratch.pad.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 pairs = pairs +local awful = require("awful") +local capi = { + mouse = mouse, + client = client, + screen = screen +} + +-- Scratchpad: basic scratchpad manager for the awesome window manager +local pad = {} -- module scratch.pad + + +local scratchpad = {} + +-- Toggle a set of properties on a client. +local function toggleprop(c, prop) + c.ontop = prop.ontop or false + c.above = prop.above or false + c.hidden = prop.hidden or false + c.sticky = prop.stick or false + c.skip_taskbar = prop.task or false +end + +-- Scratch the focused client, or un-scratch and tile it. If another +-- client is already scratched, replace it with the focused client. +function pad.set(c, width, height, sticky, screen) + width = width or 0.50 + height = height or 0.50 + sticky = sticky or false + screen = screen or capi.mouse.screen + + -- Determine signal usage in this version of awesome + local attach_signal = capi.client.add_signal or capi.client.connect_signal + local detach_signal = capi.client.remove_signal or capi.client.disconnect_signal + + local function setscratch(c) + -- Scratchpad is floating and has no titlebar + awful.client.floating.set(c, true); awful.titlebar.remove(c) + + -- Scratchpad client properties + toggleprop(c, {ontop=true, above=true, task=true, stick=sticky}) + + -- 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({ -- Scratchpad is always centered on screen + x = screengeom.x + (screengeom.width - width) / 2, + y = screengeom.y + (screengeom.height - height) / 2, + width = width, height = height + }) + + -- Scratchpad should not loose focus + c:raise(); capi.client.focus = c + end + + -- Prepare a table for storing clients, + if not scratchpad.pad then scratchpad.pad = {} + -- add unmanage signal for scratchpad clients + attach_signal("unmanage", function (c) + for scr, cl in pairs(scratchpad.pad) do + if cl == c then scratchpad.pad[scr] = nil end + end + end) + end + + -- If the scratcphad is emtpy, store the client, + if not scratchpad.pad[screen] then + scratchpad.pad[screen] = c + -- then apply geometry and properties + setscratch(c) + else -- If a client is already scratched, + local oc = scratchpad.pad[screen] + -- unscratch, and compare it with the focused client + awful.client.floating.toggle(oc); toggleprop(oc, {}) + -- If it matches clear the table, if not replace it + if oc == c then scratchpad.pad[screen] = nil + else scratchpad.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 pad.toggle(screen) + screen = screen or capi.mouse.screen + + -- Check if we have a client on storage, + if scratchpad.pad and + scratchpad.pad[screen] ~= nil + then -- and get it out, to play + local c = scratchpad.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 + +return pad diff --git a/signals.lua b/signals.lua index 8f5f0c2..8c599de 100644 --- a/signals.lua +++ b/signals.lua @@ -1,12 +1,9 @@ +local awful = awful +local beautiful = beautiful --- {{{ 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 }) - +client.connect_signal("manage", function (c, startup) -- Enable sloppy focus - c:add_signal("mouse::enter", function(c) + c:connect_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 @@ -24,8 +21,45 @@ client.add_signal("manage", function (c, startup) awful.placement.no_offscreen(c) end end + + local titlebars_enabled = false + if titlebars_enabled and (c.type == "normal" or c.type == "dialog") then + -- Widgets that are aligned to the left + local left_layout = wibox.layout.fixed.horizontal() + left_layout:add(awful.titlebar.widget.iconwidget(c)) + + -- Widgets that are aligned to the right + local right_layout = wibox.layout.fixed.horizontal() + right_layout:add(awful.titlebar.widget.floatingbutton(c)) + right_layout:add(awful.titlebar.widget.maximizedbutton(c)) + right_layout:add(awful.titlebar.widget.stickybutton(c)) + right_layout:add(awful.titlebar.widget.ontopbutton(c)) + right_layout:add(awful.titlebar.widget.closebutton(c)) + + -- The title goes in the middle + local title = awful.titlebar.widget.titlewidget(c) + title:buttons(awful.util.table.join( + awful.button({ }, 1, function() + client.focus = c + c:raise() + awful.mouse.client.move(c) + end), + awful.button({ }, 3, function() + client.focus = c + c:raise() + awful.mouse.client.resize(c) + end) + )) + + -- Now bring it all together + local layout = wibox.layout.align.horizontal() + layout:set_left(left_layout) + layout:set_right(right_layout) + layout:set_middle(title) + + awful.titlebar(c):set_widget(layout) + 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) --- }}} +client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end) +client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end) diff --git a/tags.lua b/tags.lua index 643730e..d6a8d37 100644 --- a/tags.lua +++ b/tags.lua @@ -1,21 +1,60 @@ +-- tags and layouts +local awful = awful +local conf = conf +local modkey = conf.modkey or "Mod4" --- {{{ Tags -tags={} -tags.setup = { - { name = "1:⚙", layout = layouts[1] }, +local tags={ mt={} } +local layouts = layouts + +local function funcViewOnly(i) + return function () + local screen = mouse.screen + if tags[screen][i] then + awful.tag.viewonly(tags[screen][i]) + end + end +end + +local function funcViewToggle(i) + return function () + local screen = mouse.screen + if tags[screen][i] then + awful.tag.viewtoggle(tags[screen][i]) + end + end +end + +local function funcMoveTo(i) + return function () + if client.focus and tags[client.focus.screen][i] then + awful.client.movetotag(tags[client.focus.screen][i]) + end + end +end + +local function funcToggle(i) + return function () + if client.focus and tags[client.focus.screen][i] then + awful.client.toggletag(tags[client.focus.screen][i]) + end + end +end + +local defaultsetup = { + {"1:⚙"}, { name = "2:⌘", layout = layouts[5] }, { name = "3:☻", layout = layouts[3], mwfact = 0.20 }, { 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] }, - { 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] }--, + {"5:☑"}, + {"6:♫"}, + {"7:☣"}, + {"8:☕"}, + {"9:⚂"}, + {"0:☠"}, + {"F1:☭"}, + {"F2:♚"}, + {"F3:♛"}, + {"F4:♜"}--, -- { name = "F5:♝", layout = layouts[1] }, -- { name = "F6:♞", layout = layouts[1] }, -- { name = "F7:♟", layout = layouts[1] }, @@ -26,15 +65,54 @@ tags.setup = { -- { 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 +local list = {} + +function tags.setup(setuptable) + local setup = setuptable or defaultsetup + for s = 1, screen.count() do + list[s] = {} + for i, t in ipairs(setup) do + local layout = t.layout or layouts[1] + local name = t.name or t[1] + list[s][i] = awful.tag.new({name}, s, layout)[1]; + list[s][i].selected = false + if(t.mwfact) then + awful.tag.setmwfact(t.mwfact,list[s][i]) + end + end + list[s][1].selected = true + end end --- }}} + +function tags.extend_key_table(globalkeys) + -- Compute the maximum number of digit we need, limited to 22 + keynumber = 0 + for s = 1, screen.count() do + keynumber = math.min(22, math.max(#(list[s]), keynumber)); + end + + local inspect = require("inspect") + local tagkeys = globalkeys or {} + + -- Bind all key numbers to tags, using keycodes + for i = 1, keynumber do + if i < 10 then + k = "#" .. i + 9 -- number keys 1-9 + elseif i == 10 then + k = "#19" -- zero + elseif i > 10 then + k = "F" .. i - 10 -- F keys + end + tagkeys = awful.util.table.join(tagkeys, + awful.key( { modkey }, k, funcViewOnly(i)), + awful.key( { modkey, "Control" }, k, funcViewToggle(i)), + awful.key( { modkey, "Shift" }, k, funcMoveTo(i)), + awful.key( { modkey, "Control", "Shift" }, k, funcToggle(i)) + ) + end + return tagkeys; +end + +tags.mt.__index = list +tags.mt.__newindex = list +return setmetatable(tags, tags.mt) diff --git a/zenburn/theme.lua b/theme.lua similarity index 78% rename from zenburn/theme.lua rename to theme.lua index a567a08..8f1580c 100644 --- a/zenburn/theme.lua +++ b/theme.lua @@ -1,16 +1,7 @@ -------------------------------- --- "Zenburn" awesome theme -- --- By Adrian C. (anrxc) -- -------------------------------- - --- Alternative icon sets and widget icons: --- * http://awesome.naquadah.org/wiki/Nice_Icons - -- {{{ Main theme = {} -theme.wallpaper_cmd = { "awsetbg -l" } +theme.wallpaper = "~/.wallpaper" -- }}} - -- {{{ Styles theme.font = "dejavu 7" @@ -35,40 +26,6 @@ theme.titlebar_bg_focus = "#3F3F3F" theme.titlebar_bg_normal = "#3F3F3F" -- }}} --- There are other variable sets --- overriding the default one when --- defined, the sets are: --- [taglist|tasklist]_[bg|fg]_[focus|urgent] --- titlebar_[normal|focus] --- tooltip_[font|opacity|fg_color|bg_color|border_width|border_color] --- Example: ---theme.taglist_bg_focus = "#CC9393" --- }}} - --- {{{ Widgets --- You can add as many variables as --- you wish and access them by using --- beautiful.variable in your rc.lua ---theme.fg_widget = "#AECF96" ---theme.fg_center_widget = "#88A175" ---theme.fg_end_widget = "#FF5656" ---theme.bg_widget = "#494B4F" ---theme.border_widget = "#3F3F3F" --- }}} - --- {{{ Mouse finder -theme.mouse_finder_color = "#CC9393" --- mouse_finder_[timeout|animate_timeout|radius|factor] --- }}} - --- {{{ Menu --- Variables set for theming the menu: --- menu_[bg|fg]_[normal|focus] --- menu_[border_color|border_width] -theme.menu_height = "15" -theme.menu_width = "100" --- }}} - -- {{{ Icons -- {{{ Taglist theme.taglist_squares_sel = "/usr/share/awesome/themes/zenburn/taglist/squarefz.png" diff --git a/vicious b/vicious index dcc2b60..c316528 160000 --- a/vicious +++ b/vicious @@ -1 +1 @@ -Subproject commit dcc2b60cd85dabd716e2bb8c49d9703f050eaff5 +Subproject commit c316528698906fe5ce92a20b4de5863b1c1ab31b diff --git a/wibox.lua b/wibox.lua deleted file mode 100644 index 607aec7..0000000 --- a/wibox.lua +++ /dev/null @@ -1,201 +0,0 @@ -function exists(filename) - local file = io.open(filename) - if file then - io.close(file) - return true - else - return false - end -end - - --- {{{ Reusable separators -spacer = widget({ type = "textbox", name = "spacer" }) -spacer.text = " " - -nullwidget = widget({ type = "textbox", name = "nullwidget" }) --- }}} - --- {{{ 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) - - --- music widget {{{ -mpdwidget = widget({ type = "textbox" }) -vicious.register(mpdwidget, vicious.widgets.mpd, - function(widget, args) - if args["{state}"] == "N/A" then - return "" - else - return "[ ♫ "..args["{Artist}"].." - "..args["{Title}"].." ]" - end - end, 3, {nil, os.getenv("MPD_HOST"), os.getenv("MPD_PORT")}) -mpdwidget:buttons(awful.util.table.join( - awful.button({ }, 1, function () teardrop("urxvtc -e ncmpcpp","top","center", 0.99, 0.4)end ) - )) - -mpdnext = widget({ type = "textbox" }) -mpdnext.text = "▲" -mpdnext:buttons(awful.util.table.join( - awful.button({ }, 1, function () awful.util.spawn("mpc next") end) - )) -mpdprev = widget({ type = "textbox" }) -mpdprev.text = "▼" -mpdprev:buttons(awful.util.table.join( - awful.button({ }, 1, function () awful.util.spawn("mpc prev") end) - )) --- }}} - --- mail widget {{{ -mailwidget = widget({ type = "textbox" }) -vicious.register(mailwidget, vicious.widgets.mdir, - function(widget, args) - if args[1] > 0 then - naughty.notify({ - title = "New mail arrived", - text = "Unread "..args[2].." / New "..args[1], - position = "top_left" - - }) - widget.bg = theme.bg_urgent - widget.fg = theme.fg_urgent - elseif args[2] > 0 then - widget.bg = theme.bg_focus - widget.fg = theme.fg_focus - else - widget.bg = theme.bg_normal - widget.fg = theme.fg_normal - end - return "⬓⬓ Unread "..args[2].." / New "..args[1].. " " - end, 181, {os.getenv("HOME") .. "/.maildir/"}) ---}}} - --- battery {{{ -if exists("/sys/class/power_supply/BAT0") then - batwidget0 = widget({ type = "textbox" }) - vicious.register(batwidget0, vicious.widgets.bat, - function (widget, args) - if args[2] == 0 then return "" - else - if args[2] < 15 then - widget.bg = theme.bg_urgent - widget.fg = theme.fg_urgent - else - widget.bg = theme.bg_normal - widget.fg = theme.fg_normal - end - return "( BAT0: "..args[1]..args[2].."% - "..args[3].." )" - end - end, 61, "BAT0") -else batwidget0 = nullwidget end - -if exists("/sys/class/power_supply/BAT1") then - batwidget1 = widget({ type = "textbox" }) - vicious.register(batwidget1, vicious.widgets.bat, - function (widget, args) - if args[2] == 0 then return "" - else - if args[2] < 15 then - widget.bg = theme.bg_urgent - widget.fg = theme.fg_urgent - else - widget.bg = theme.bg_normal - widget.fg = theme.fg_normal - end - return "( BAT1: "..args[1]..args[2].."% - "..args[3].." )" - end - end, 61, "BAT1") -else batwidget1 = nullwidget end - -if exists("/sys/class/power_supply/BAT2") then - batwidget2 = widget({ type = "textbox" }) - vicious.register(batwidget2, vicious.widgets.bat, - function (widget, args) - if args[2] == 0 then return "" - else - if args[2] < 15 then - widget.bg = theme.bg_urgent - widget.fg = theme.fg_urgent - else - widget.bg = theme.bg_normal - widget.fg = theme.fg_normal - end - return "( BAT2: "..args[1]..args[2].."% - "..args[3].." )" - end - end, 61, "BAT2") -else batwidget2 = nullwidget end - ---}}} - -cpulabel = widget({ type = "textbox" }) -vicious.register(cpulabel, vicious.widgets.cpu, "CPU: $1%") - -if exists("/sys/class/net/wlan0") then - wlanwidget = widget({ type = "textbox" }) - vicious.register(wlanwidget, vicious.widgets.wifi, " )( WLAN ${ssid} @ ${sign}, Q:${link}/70", 31, "wlan0") -else wlanwidget = nullwidget end - --- 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 - 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, width = 18 }) - rightwibox[s] = awful.wibox({ position = "right", screen = s , width = 18}) - -- Add widgets to the wibox - order matters - leftwibox[s].widgets = { - mytaglist[s], - mylayoutbox[s], - mailwidget, - spacer, - layout = awful.widget.layout.horizontal.rightleft - } - rightwibox[s].widgets = { - { - clock, spacer, - batwidget0, - batwidget1, - batwidget2, - wlanwidget, - spacer, cpulabel, cpuwidget, - spacer, mpdwidget, mpdnext, spacer, mpdprev, - spacer, - layout = awful.widget.layout.horizontal.leftright - }, - separator, spacer, mysystray, - layout = awful.widget.layout.horizontal.leftright - } -end --- }}} --- --- vim:foldmethod=marker diff --git a/widgets.lua b/widgets.lua new file mode 100644 index 0000000..23638ea --- /dev/null +++ b/widgets.lua @@ -0,0 +1,266 @@ +local wibox = require("wibox") +local vicious = require("vicious") +local modkey = conf.modkey or "Mod4" + +local widgets = { add = {} } + +-------------------------------------------------------------------------------- +-- table declarations {{{ +-------------------------------------------------------------------------------- +local wlist = {} +local bars = {} +local leftwibox = {} +local rightwibox = {} + +local 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, function(t) awful.tag.viewnext(awful.tag.getscreen(t)) end), +awful.button({ }, 5, function(t) awful.tag.viewprev(awful.tag.getscreen(t)) end) +) +-- }}} +-------------------------------------------------------------------------------- + +-------------------------------------------------------------------------------- +-- setup {{{ +-------------------------------------------------------------------------------- +local function setup() -- {{{ + for s = 1, screen.count() do + wlist[s]={} + bars[s]={} + + + + -- Create the wibox + leftwibox[s] = awful.wibox({ + position = "left", + screen = s, + width = 18 + }) + rightwibox[s] = awful.wibox({ + position = "right", + screen = s, + width = 18 + }) + + -- {{{ create layouts + local left_bottom_layout = wibox.layout.fixed.horizontal() + local left_top_layout = wibox.layout.fixed.horizontal() + + local left_layout = wibox.layout.align.horizontal() + left_layout:set_left(left_bottom_layout) + left_layout:set_right(left_top_layout) + + local right_bottom_layout = wibox.layout.fixed.horizontal() + local right_top_layout = wibox.layout.fixed.horizontal() + + local right_layout = wibox.layout.align.horizontal() + right_layout:set_left(right_top_layout) + right_layout:set_right(right_bottom_layout) + --}}} + + + -- {{{ rotate layouts and add to wibox + local leftrotate = wibox.layout.rotate() + leftrotate:set_direction('east') + leftrotate:set_widget(left_layout) + leftwibox[s]:set_widget(leftrotate) + + local rightrotate = wibox.layout.rotate() + rightrotate:set_direction('west') + rightrotate:set_widget(right_layout) + rightwibox[s]:set_widget(rightrotate) + --}}} + + + bars[s] = {} + bars[s].left = {} + bars[s].left.bottom = left_bottom_layout + bars[s].left.top = left_top_layout + bars[s].right = {} + bars[s].right.bottom = right_bottom_layout + bars[s].right.top = right_top_layout + end +end -- }}} +widgets.setup = setup + +-- }}} +-------------------------------------------------------------------------------- + +-------------------------------------------------------------------------------- +-- Utility {{{ +-------------------------------------------------------------------------------- + +-- force update of a widget +local function update(widgetname, index) -- {{{ + for s = 1, screen.count() do + if wlist[s] ~= nil and wlist[s][widgetname] ~= nil then + if index ~= nil then + vicious.force({ wlist[s][widgetname][index] }) + else + vicious.force({ wlist[s][widgetname] }) + end + end + end +end +--}}} +widgets.update = update + +-- get layout for adding widgets +local function get_layout(screen, bar, align) --{{{ + if bars[screen][bar] == nil then return nil end + + return bars[screen][bar][align] +end --}}} +widgets.layout = get_layout + +-- }}} +-------------------------------------------------------------------------------- + +-------------------------------------------------------------------------------- +-- widget creators {{{ +-------------------------------------------------------------------------------- + +-- mail widget +local function mailwidget(screen, parent_layout, mailboxes) --{{{ + local widget = wibox.widget.textbox() + local bg = wibox.widget.background() + bg:set_widget(widget) + vicious.register(widget, vicious.widgets.mdir, function(widget, args) + if args[1] > 0 then + naughty.notify({ + title = "New mail arrived", + text = "Unread "..args[2].." / New "..args[1], + position = "top_left" + + }) + bg:set_bg(theme.bg_urgent) + bg:set_fg(theme.fg_urgent) + elseif args[2] > 0 then + bg:set_bg(theme.bg_focus) + bg:set_fg(theme.fg_focus) + else + bg:set_bg(theme.bg_normal) + bg:set_fg(theme.fg_normal) + end + return "⬓⬓ Unread "..args[2].." / New "..args[1].. " " + end, 0, mailboxes) + wlist[screen]["mail"] = widget + parent_layout:add(bg) + widgets.update("mail") +end +--}}} +widgets.add.mail = mailwidget + +-- text clock +local function clockwidget(screen, parent_layout) -- {{{ + wlist[screen]["clock"] = awful.widget.textclock() + parent_layout:add(wlist[screen]["clock"]) +end +--}}} +widgets.add.clock = clockwidget + +-- layoutbox +local function layoutwidget(screen, parent_layout) -- {{{ + wlist[screen]["layout"] = awful.widget.layoutbox(s) + parent_layout:add(wlist[screen]["layout"]) +end +--}}} +widgets.add.layout = layoutwidget + +-- taglist +local function taglistwidget(screen, parent_layout) --{{{ + -- Create a taglist widget + wlist[screen]["taglist"] = awful.widget.taglist(screen, + awful.widget.taglist.filter.all, + mytaglist.buttons) + parent_layout:add(wlist[screen]["taglist"]) +end --}}} +widgets.add.taglist = taglistwidget + +-- system tray +local function systraywidget(screen, parent_layout) --{{{ + if (wlist["systray"] ~= nil) then + return + end + wlist["systray"] = wibox.widget.systray() + parent_layout:add(wlist["systray"]) +end --}}} +widgets.add.systray = systraywidget + +-- cpu usage +local function cpuwidget(screen, parent_layout) --{{{ + wlist[screen]["cpu"] = wibox.widget.textbox() + vicious.register(wlist[screen]["cpu"], vicious.widgets.cpu, "CPU: $1%") + parent_layout:add(wlist[screen]["cpu"]) +end --}}} +widgets.add.cpu = cpuwidget + +-- battery +local function batterywidget(screen, parent_layout, batname) --{{{ + if(wlist[screen]["bat"] == nil) then + wlist[screen]["bat"] = {} + end + -- more than one batwidget is possible + local batwidget = wibox.widget.textbox() + local bg = wibox.widget.background() + bg:set_widget(batwidget) + table.insert(wlist[screen]["bat"], batwidget) + vicious.register(batwidget, vicious.widgets.bat, function (widget, args) + if args[2] == 0 then return "" + else + if args[2] < 15 then + bg:set_bg(theme.bg_urgent) + bg:set_fg(theme.fg_urgent) + else + bg:set_bg(theme.bg_normal) + bg:set_fg(theme.fg_normal) + end + return batname .. ": " .. + args[1]..args[2].."% - "..args[3] + end + end, 61, batname) + parent_layout:add(bg) +end --}}} +widgets.add.battery = batterywidget + +-- wireless status +local function wifiwidget(screen, parent_layout, interface) --{{{ + wlist[screen]["wifi"] = wibox.widget.textbox() + vicious.register(wlist[screen]["wifi"], vicious.widgets.wifi, + "WLAN ${ssid} @ ${sign}, Q:${link}/70", 31, interface) + parent_layout:add(wlist[screen]["wifi"]) +end --}}} +widgets.add.wifi = wifiwidget + +-- }}} +-------------------------------------------------------------------------------- + +-------------------------------------------------------------------------------- +-- spacers {{{ +-------------------------------------------------------------------------------- + +local spacer = wibox.widget.textbox() +spacer:set_text(" ") + +-- manual spacing between widgets +local function spacerwidget(parent_layout) --{{{ + parent_layout:add(spacer) +end --}}} +widgets.add.spacer = spacerwidget + +-- change appearance of spacers +local function spacertext(text) --{{{ + spacer:set_text(text) +end --}}} +widgets.set_spacer_text = spacertext + +-- }}} +-------------------------------------------------------------------------------- + +return widgets + +-- vim:foldmethod=marker diff --git a/zenburn/awesome-icon.png b/zenburn/awesome-icon.png deleted file mode 100644 index 70978d3..0000000 Binary files a/zenburn/awesome-icon.png and /dev/null differ diff --git a/zenburn/layouts/dwindle.png b/zenburn/layouts/dwindle.png deleted file mode 100644 index 1aa4bf2..0000000 Binary files a/zenburn/layouts/dwindle.png and /dev/null differ diff --git a/zenburn/layouts/fairh.png b/zenburn/layouts/fairh.png deleted file mode 100644 index e176bb3..0000000 Binary files a/zenburn/layouts/fairh.png and /dev/null differ diff --git a/zenburn/layouts/fairv.png b/zenburn/layouts/fairv.png deleted file mode 100644 index 7c0a92c..0000000 Binary files a/zenburn/layouts/fairv.png and /dev/null differ diff --git a/zenburn/layouts/floating.png b/zenburn/layouts/floating.png deleted file mode 100644 index a399092..0000000 Binary files a/zenburn/layouts/floating.png and /dev/null differ diff --git a/zenburn/layouts/fullscreen.png b/zenburn/layouts/fullscreen.png deleted file mode 100644 index a0c795c..0000000 Binary files a/zenburn/layouts/fullscreen.png and /dev/null differ diff --git a/zenburn/layouts/magnifier.png b/zenburn/layouts/magnifier.png deleted file mode 100644 index bca6db9..0000000 Binary files a/zenburn/layouts/magnifier.png and /dev/null differ diff --git a/zenburn/layouts/max.png b/zenburn/layouts/max.png deleted file mode 100644 index 96a237a..0000000 Binary files a/zenburn/layouts/max.png and /dev/null differ diff --git a/zenburn/layouts/spiral.png b/zenburn/layouts/spiral.png deleted file mode 100644 index 8f5aeed..0000000 Binary files a/zenburn/layouts/spiral.png and /dev/null differ diff --git a/zenburn/layouts/tile.png b/zenburn/layouts/tile.png deleted file mode 100644 index 3fcc904..0000000 Binary files a/zenburn/layouts/tile.png and /dev/null differ diff --git a/zenburn/layouts/tilebottom.png b/zenburn/layouts/tilebottom.png deleted file mode 100644 index dfe7832..0000000 Binary files a/zenburn/layouts/tilebottom.png and /dev/null differ diff --git a/zenburn/layouts/tileleft.png b/zenburn/layouts/tileleft.png deleted file mode 100644 index c5decfd..0000000 Binary files a/zenburn/layouts/tileleft.png and /dev/null differ diff --git a/zenburn/layouts/tiletop.png b/zenburn/layouts/tiletop.png deleted file mode 100644 index b251661..0000000 Binary files a/zenburn/layouts/tiletop.png and /dev/null differ diff --git a/zenburn/taglist/squarefz.png b/zenburn/taglist/squarefz.png deleted file mode 100644 index 0927720..0000000 Binary files a/zenburn/taglist/squarefz.png and /dev/null differ diff --git a/zenburn/taglist/squarez.png b/zenburn/taglist/squarez.png deleted file mode 100644 index 9b41c26..0000000 Binary files a/zenburn/taglist/squarez.png and /dev/null differ diff --git a/zenburn/titlebar/close_focus.png b/zenburn/titlebar/close_focus.png deleted file mode 100644 index 02565b9..0000000 Binary files a/zenburn/titlebar/close_focus.png and /dev/null differ diff --git a/zenburn/titlebar/close_normal.png b/zenburn/titlebar/close_normal.png deleted file mode 100644 index bc97b7c..0000000 Binary files a/zenburn/titlebar/close_normal.png and /dev/null differ diff --git a/zenburn/titlebar/floating_focus_active.png b/zenburn/titlebar/floating_focus_active.png deleted file mode 100644 index 63d900b..0000000 Binary files a/zenburn/titlebar/floating_focus_active.png and /dev/null differ diff --git a/zenburn/titlebar/floating_focus_inactive.png b/zenburn/titlebar/floating_focus_inactive.png deleted file mode 100644 index f442d78..0000000 Binary files a/zenburn/titlebar/floating_focus_inactive.png and /dev/null differ diff --git a/zenburn/titlebar/floating_normal_active.png b/zenburn/titlebar/floating_normal_active.png deleted file mode 100644 index 1355a55..0000000 Binary files a/zenburn/titlebar/floating_normal_active.png and /dev/null differ diff --git a/zenburn/titlebar/floating_normal_inactive.png b/zenburn/titlebar/floating_normal_inactive.png deleted file mode 100644 index e6731a3..0000000 Binary files a/zenburn/titlebar/floating_normal_inactive.png and /dev/null differ diff --git a/zenburn/titlebar/maximized_focus_active.png b/zenburn/titlebar/maximized_focus_active.png deleted file mode 100644 index 834f106..0000000 Binary files a/zenburn/titlebar/maximized_focus_active.png and /dev/null differ diff --git a/zenburn/titlebar/maximized_focus_inactive.png b/zenburn/titlebar/maximized_focus_inactive.png deleted file mode 100644 index 61cb93b..0000000 Binary files a/zenburn/titlebar/maximized_focus_inactive.png and /dev/null differ diff --git a/zenburn/titlebar/maximized_normal_active.png b/zenburn/titlebar/maximized_normal_active.png deleted file mode 100644 index ba5139a..0000000 Binary files a/zenburn/titlebar/maximized_normal_active.png and /dev/null differ diff --git a/zenburn/titlebar/maximized_normal_inactive.png b/zenburn/titlebar/maximized_normal_inactive.png deleted file mode 100644 index debd21f..0000000 Binary files a/zenburn/titlebar/maximized_normal_inactive.png and /dev/null differ diff --git a/zenburn/titlebar/ontop_focus_active.png b/zenburn/titlebar/ontop_focus_active.png deleted file mode 100644 index 776d586..0000000 Binary files a/zenburn/titlebar/ontop_focus_active.png and /dev/null differ diff --git a/zenburn/titlebar/ontop_focus_inactive.png b/zenburn/titlebar/ontop_focus_inactive.png deleted file mode 100644 index 3b8b5c3..0000000 Binary files a/zenburn/titlebar/ontop_focus_inactive.png and /dev/null differ diff --git a/zenburn/titlebar/ontop_normal_active.png b/zenburn/titlebar/ontop_normal_active.png deleted file mode 100644 index 70c0540..0000000 Binary files a/zenburn/titlebar/ontop_normal_active.png and /dev/null differ diff --git a/zenburn/titlebar/ontop_normal_inactive.png b/zenburn/titlebar/ontop_normal_inactive.png deleted file mode 100644 index 136f3f0..0000000 Binary files a/zenburn/titlebar/ontop_normal_inactive.png and /dev/null differ diff --git a/zenburn/titlebar/sticky_focus_active.png b/zenburn/titlebar/sticky_focus_active.png deleted file mode 100644 index 1726f90..0000000 Binary files a/zenburn/titlebar/sticky_focus_active.png and /dev/null differ diff --git a/zenburn/titlebar/sticky_focus_inactive.png b/zenburn/titlebar/sticky_focus_inactive.png deleted file mode 100644 index b83ceff..0000000 Binary files a/zenburn/titlebar/sticky_focus_inactive.png and /dev/null differ diff --git a/zenburn/titlebar/sticky_normal_active.png b/zenburn/titlebar/sticky_normal_active.png deleted file mode 100644 index 9b74056..0000000 Binary files a/zenburn/titlebar/sticky_normal_active.png and /dev/null differ diff --git a/zenburn/titlebar/sticky_normal_inactive.png b/zenburn/titlebar/sticky_normal_inactive.png deleted file mode 100644 index 0e29780..0000000 Binary files a/zenburn/titlebar/sticky_normal_inactive.png and /dev/null differ diff --git a/zenburn/zenburn-background.png b/zenburn/zenburn-background.png deleted file mode 100644 index 1eb9437..0000000 Binary files a/zenburn/zenburn-background.png and /dev/null differ