Skip to content

Commit

Permalink
Simplied and formatted the rc.lua.
Browse files Browse the repository at this point in the history
  • Loading branch information
coswind committed Jan 4, 2013
1 parent ad3e0f2 commit d581813
Showing 1 changed file with 46 additions and 52 deletions.
98 changes: 46 additions & 52 deletions rc.lua
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
-----------------------------
-- AwesomeWM configuration --
-- version 3.5 --
-- <[email protected]> --
-----------------------------

-- {{{ Standard Awesome Libraries
local gears = require("gears")
local awful = require("awful")
awful.rules = require("awful.rules")
require("awful.autofocus")
-- Widget and Layout library
local wibox = require("wibox")
-- Theme hanling library
local beautiful = require("beautiful")
beautiful.init(awful.util.getdir("config") .. "/themes/dust/theme.lua")
-- Naughty & Menubar & Vicious
local naughty = require("naughty")
local menubar = require("menubar")
local vicious = require("vicious")
-- Widgets
local wi = require("wi")
-- }}}

-- {{{ Error handling
-- Startup
Expand All @@ -40,13 +40,17 @@ end
-- }}}

-- {{{ Variables
local terminal = "urxvt"
local editor = os.getenv("EDITOR") or "vim"
local altkey = "Mod1"
local modkey = "Mod4"

local terminal = "urxvt"
local editor = os.getenv("EDITOR") or "vim"
local editor_cmd = terminal .. " -e " .. editor
local exec = awful.util.spawn
local sexec = awful.util.spawn_with_shell
local modkey = "Mod4"
local altkey = "Mod1"

local home = os.getenv("HOME")
local exec = awful.util.spawn
local sexec = awful.util.spawn_with_shell
local scount = screen.count()
-- }}}

-- {{{ Layouts
Expand All @@ -55,32 +59,32 @@ local layouts =
awful.layout.suit.floating,
awful.layout.suit.tile,
awful.layout.suit.tile.left,
awful.layout.suit.tile.bottom,
awful.layout.suit.tile.top,
awful.layout.suit.fair,
awful.layout.suit.fair.horizontal,
awful.layout.suit.spiral,
awful.layout.suit.spiral.dwindle,
awful.layout.suit.max,
awful.layout.suit.max.fullscreen,
awful.layout.suit.magnifier
-- awful.layout.suit.tile.bottom,
-- awful.layout.suit.tile.top,
-- awful.layout.suit.fair,
-- awful.layout.suit.fair.horizontal,
-- awful.layout.suit.spiral,
-- awful.layout.suit.spiral.dwindle,
-- awful.layout.suit.max,
-- awful.layout.suit.max.fullscreen,
-- awful.layout.suit.magnifier
}
-- }}}

-- {{{ Naughty presets
naughty.config.defaults.timeout = 5
naughty.config.defaults.screen = 1
naughty.config.defaults.position = "top_right"
naughty.config.defaults.margin = 8
naughty.config.defaults.gap = 1
naughty.config.defaults.ontop = true
naughty.config.defaults.font = "Terminus 12"
naughty.config.defaults.icon = nil
naughty.config.defaults.icon_size = 256
naughty.config.defaults.fg = beautiful.fg_tooltip
naughty.config.defaults.bg = beautiful.bg_tooltip
naughty.config.defaults.border_color = beautiful.border_tooltip
naughty.config.defaults.border_width = 2
naughty.config.defaults.timeout = 5
naughty.config.defaults.screen = 1
naughty.config.defaults.position = "top_right"
naughty.config.defaults.margin = 8
naughty.config.defaults.gap = 1
naughty.config.defaults.ontop = true
naughty.config.defaults.font = "Terminus 12"
naughty.config.defaults.icon = nil
naughty.config.defaults.icon_size = 256
naughty.config.defaults.fg = beautiful.fg_tooltip
naughty.config.defaults.bg = beautiful.bg_tooltip
naughty.config.defaults.border_color = beautiful.border_tooltip
naughty.config.defaults.border_width = 2
naughty.config.defaults.hover_timeout = nil
-- }}}

Expand Down Expand Up @@ -118,9 +122,7 @@ 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)
awful.button({ modkey }, 3, awful.client.toggletag)
)

for s = 1, screen.count() do
Expand All @@ -130,9 +132,7 @@ 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)))
awful.button({ }, 3, function() awful.layout.inc(layouts, -1) end)))

-- Taglist
mytaglist[s] = awful.widget.taglist(s, awful.widget.taglist.filter.all, mytaglist.buttons)
Expand Down Expand Up @@ -184,19 +184,13 @@ end

-- {{{ Key bindings
globalkeys = awful.util.table.join(
awful.key({ modkey, }, "Left", awful.tag.viewprev ),
awful.key({ modkey, }, "Right", awful.tag.viewnext ),
awful.key({ modkey, }, "Escape", awful.tag.history.restore),

awful.key({ altkey, }, "Tab",
function()
awful.client.focus.byidx( 1)
if client.focus then client.focus:raise() end
awful.key({ modkey }, "j", function()
awful.client.focus.byidx( 1)
if client.focus then client.focus:raise() end
end),
awful.key({ modkey, "Shift" }, "Tab",
function()
awful.client.focus.byidx(-1)
if client.focus then client.focus:raise() end
awful.key({ modkey }, "k", function()
awful.client.focus.byidx(-1)
if client.focus then client.focus:raise() end
end),

-- Layout manipulation
Expand Down

0 comments on commit d581813

Please sign in to comment.