From 8775d08c204504ea2015985f6ad7aaf4450f1a61 Mon Sep 17 00:00:00 2001 From: "Adrian C. (anrxc)" Date: Sat, 10 Oct 2009 01:30:21 +0200 Subject: rc.lua: coding style changes --- rc.lua | 98 +++++++++++++++++++++++++++++++++--------------------------------- 1 file changed, 49 insertions(+), 49 deletions(-) (limited to 'rc.lua') diff --git a/rc.lua b/rc.lua index ea009e8..b1cb3c5 100644 --- a/rc.lua +++ b/rc.lua @@ -28,11 +28,11 @@ require("scratchpad") beautiful.init(awful.util.getdir("config") .. "/zenburn.lua") -- Modifier keys -altkey = "Mod1" -- Alt_L -modkey = "Mod4" -- Super_L +local altkey = "Mod1" -- Alt_L +local modkey = "Mod4" -- Super_L -- Window management layouts -layouts = { +local layouts = { awful.layout.suit.tile, -- 1 awful.layout.suit.tile.left, -- 2 awful.layout.suit.tile.bottom, -- 3 @@ -45,8 +45,8 @@ layouts = { -- {{{ Tags -tags = {} -tags.default = { +local tags = {} +tags.setup = { { name = "term", layout = layouts[3] }, { name = "emacs", layout = layouts[1] }, { name = "web", layout = layouts[1] }, @@ -60,7 +60,7 @@ tags.default = { for s = 1, screen.count() do tags[s] = {} - for i, t in ipairs(tags.default) do + 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) @@ -77,19 +77,19 @@ end -- {{{ Widgets configuration -- -- {{{ Reusable separators -spacer = widget({ type = "textbox", name = "spacer" }) -separator = widget({ type = "textbox", name = "separator" }) -spacer.text = " " -separator.text = "|" +local spacer = widget({ type = "textbox", name = "spacer" }) +local separator = widget({ type = "textbox", name = "separator" }) +spacer.text = " " +separator.text = "|" -- }}} -- {{{ CPU usage and temperature -- Widget icon -cpuicon = widget({ type = "imagebox", name = "cpuicon" }) -cpuicon.image = image(beautiful.widget_cpu) +local cpuicon = widget({ type = "imagebox", name = "cpuicon" }) +cpuicon.image = image(beautiful.widget_cpu) -- Initialize widgets -thermalwidget = widget({ type = "textbox", name = "thermalwidget" }) -cpuwidget = awful.widget.graph({ layout = awful.widget.layout.horizontal.rightleft }) +local tempwidget = widget({ type = "textbox", name = "tempwidget" }) +local cpuwidget = awful.widget.graph() -- Graph properties cpuwidget:set_width(50) cpuwidget:set_height(14) @@ -103,25 +103,25 @@ cpuwidget:set_gradient_colors({ beautiful.fg_widget }) -- Register widgets vicious.register(cpuwidget, vicious.widgets.cpu, "$1") -vicious.register(thermalwidget, vicious.widgets.thermal, "$1°C", 19, "TZS0") +vicious.register(tempwidget, vicious.widgets.thermal, "$1°C", 19, "TZS0") -- }}} -- {{{ Battery state -- Widget icon -baticon = widget({ type = "imagebox", name = "baticon" }) +local baticon = widget({ type = "imagebox", name = "baticon" }) baticon.image = image(beautiful.widget_bat) -- Initialize widget -batwidget = widget({ type = "textbox", name = "batwidget" }) +local batwidget = widget({ type = "textbox", name = "batwidget" }) -- Register widget vicious.register(batwidget, vicious.widgets.bat, "$1$2%", 61, "BAT0") -- }}} -- {{{ Memory usage -- Widget icon -memicon = widget({ type = "imagebox", name = "memicon" }) +local memicon = widget({ type = "imagebox", name = "memicon" }) memicon.image = image(beautiful.widget_mem) -- Initialize widget -memwidget = awful.widget.progressbar({ layout = awful.widget.layout.horizontal.rightleft }) +local memwidget = awful.widget.progressbar() -- Pogressbar properties memwidget:set_width(8) memwidget:set_height(10) @@ -140,14 +140,14 @@ vicious.register(memwidget, vicious.widgets.mem, "$1", 13) -- {{{ File system usage -- Widget icon -fsicon = widget({ type = "imagebox", name = "fsicon" }) +local fsicon = widget({ type = "imagebox", name = "fsicon" }) fsicon.image = image(beautiful.widget_fs) -- Initialize widgets -fs = { - root = awful.widget.progressbar({ layout = awful.widget.layout.horizontal.rightleft }), - home = awful.widget.progressbar({ layout = awful.widget.layout.horizontal.rightleft }), - storage = awful.widget.progressbar({ layout = awful.widget.layout.horizontal.rightleft }), - backup = awful.widget.progressbar({ layout = awful.widget.layout.horizontal.rightleft }), +local fs = { + root = awful.widget.progressbar(), + home = awful.widget.progressbar(), + storage = awful.widget.progressbar(), + backup = awful.widget.progressbar(), -- Configure widgets margins = { top = 1, bottom = 1 @@ -194,13 +194,13 @@ vicious.register(fs.backup, vicious.widgets.fs, "${/mnt/backup usep}", 599) -- {{{ Network usage -- Widget icons -neticon = widget({ type = "imagebox", name = "neticon" }) -neticonup = widget({ type = "imagebox", name = "neticonup" }) +local neticon = widget({ type = "imagebox", name = "neticon" }) +local neticonup = widget({ type = "imagebox", name = "neticonup" }) neticon.image = image(beautiful.widget_net) neticonup.image = image(beautiful.widget_netup) -- Initialize widgets -netwidget = widget({ type = "textbox", name = "netwidget" }) -netfiwidget = widget({ type = "textbox", name = "netfiwidget" }) +local netwidget = widget({ type = "textbox", name = "netwidget" }) +local netfiwidget = widget({ type = "textbox", name = "netfiwidget" }) -- Enable caching vicious.enable_caching(vicious.widgets.net) -- Register ethernet widget @@ -215,10 +215,10 @@ vicious.register(netfiwidget, vicious.widgets.net, '