rc.lua: Spare comments removed. Good titles added.
This commit is contained in:
parent
9d38d02e17
commit
6106dbcf23
13
apps.lua
13
apps.lua
|
@ -1,13 +0,0 @@
|
||||||
--floatapps =
|
|
||||||
--{
|
|
||||||
-- ["MPlayer"] = true,
|
|
||||||
-- ["gimp"] = true,
|
|
||||||
-- ["smplayer"] = true,
|
|
||||||
-- ["gnome-mplayer"] = true,
|
|
||||||
--}
|
|
||||||
|
|
||||||
--apptags =
|
|
||||||
--{
|
|
||||||
-- ["pidgin"] = { screen = 1, tag = 7 },
|
|
||||||
-- ["stardict"] = { screen = 1, tag = 5 },
|
|
||||||
--}
|
|
85
rc.lua
85
rc.lua
|
@ -1,18 +1,13 @@
|
||||||
-- Standard awesome library
|
|
||||||
require("awful")
|
require("awful")
|
||||||
require("awful.autofocus")
|
require("awful.autofocus")
|
||||||
require("awful.rules")
|
require("awful.rules")
|
||||||
-- Theme handling library
|
|
||||||
require("beautiful")
|
require("beautiful")
|
||||||
-- Notification library
|
|
||||||
require("naughty")
|
require("naughty")
|
||||||
|
|
||||||
require("autostart")
|
|
||||||
-- require("apps")
|
|
||||||
require("volume")
|
|
||||||
require("vicious")
|
require("vicious")
|
||||||
|
require("volume")
|
||||||
|
require("autostart")
|
||||||
|
|
||||||
-- {{{ Error handling
|
----< Error handling >------------------------------------------------
|
||||||
-- Check if awesome encountered an error during startup and fell back to
|
-- Check if awesome encountered an error during startup and fell back to
|
||||||
-- another config (This code will only ever execute for the fallback config)
|
-- another config (This code will only ever execute for the fallback config)
|
||||||
if awesome.startup_errors then
|
if awesome.startup_errors then
|
||||||
|
@ -35,24 +30,19 @@ do
|
||||||
in_error = false
|
in_error = false
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
-- }}}
|
|
||||||
|
|
||||||
-- {{{ Variable definitions
|
----< Theme >---------------------------------------------------------
|
||||||
-- Themes define colours, icons, and wallpapers
|
-- Themes define colours, icons, and wallpapers
|
||||||
beautiful.init(".config/awesome/theme.lua")
|
beautiful.init(".config/awesome/theme.lua")
|
||||||
|
|
||||||
|
----< Variables >-----------------------------------------------------
|
||||||
-- This is used later as the default terminal and editor to run.
|
-- This is used later as the default terminal and editor to run.
|
||||||
terminal = "urxvt -tr +sb"
|
terminal = "urxvt -tr +sb"
|
||||||
editor = os.getenv("EDITOR") or "nano"
|
editor = os.getenv("EDITOR") or "nano"
|
||||||
editor_cmd = terminal .. " -e " .. editor
|
editor_cmd = terminal .. " -e " .. editor
|
||||||
|
|
||||||
-- Default modkey.
|
|
||||||
-- Usually, Mod4 is the key with a logo between Control and Alt.
|
|
||||||
-- If you do not like this or do not have such a key,
|
|
||||||
-- I suggest you to remap Mod4 to another key using xmodmap or other tools.
|
|
||||||
-- However, you can use another modifier like Mod1, but it may interact with others.
|
|
||||||
modkey = "Mod1"
|
modkey = "Mod1"
|
||||||
|
|
||||||
|
----< Table of layouts >----------------------------------------------
|
||||||
-- Table of layouts to cover with awful.layout.inc, order matters.
|
-- Table of layouts to cover with awful.layout.inc, order matters.
|
||||||
layouts =
|
layouts =
|
||||||
{
|
{
|
||||||
|
@ -69,45 +59,34 @@ layouts =
|
||||||
-- awful.layout.suit.spiral.dwindle,
|
-- awful.layout.suit.spiral.dwindle,
|
||||||
-- awful.layout.suit.magnifier
|
-- awful.layout.suit.magnifier
|
||||||
}
|
}
|
||||||
-- }}}
|
|
||||||
|
|
||||||
-- -- {{{ Tags
|
----< Tags >----------------------------------------------------------
|
||||||
-- -- Define a tag table which hold all screen tags.
|
tags = {
|
||||||
-- tags = {}
|
names = { "term", "web", "vm", "office", "note",
|
||||||
-- for s = 1, screen.count() do
|
"game", "gimp", "dict", "im" },
|
||||||
-- -- Each screen has its own tag table.
|
layout = { layouts[3], layouts[1], layouts[1], layouts[1], layouts[1],
|
||||||
-- tags[s] = awful.tag({ 1, 2, 3, 4, 5, 6, 7, 8, 9 }, s, layouts[1])
|
layouts[1], layouts[1], layouts[1], layouts[2]}
|
||||||
-- end
|
}
|
||||||
-- -- }}}
|
|
||||||
-- {{{ Tags
|
|
||||||
-- Define a tag table which will hold all screen tags.
|
|
||||||
tags = {
|
|
||||||
names = { "term", "web", "vm", "office", "note",
|
|
||||||
"game", "gimp", "dict", "im" },
|
|
||||||
layout = { layouts[3], layouts[1], layouts[1], layouts[1], layouts[1],
|
|
||||||
layouts[1], layouts[1], layouts[1], layouts[2]
|
|
||||||
}}
|
|
||||||
for s = 1, screen.count() do
|
for s = 1, screen.count() do
|
||||||
-- Each screen has its own tag table.
|
-- Each screen has its own tag table.
|
||||||
tags[s] = awful.tag(tags.names, s, tags.layout)
|
tags[s] = awful.tag(tags.names, s, tags.layout)
|
||||||
end
|
end
|
||||||
-- }}}
|
|
||||||
|
|
||||||
-- {{{ Menu
|
require("apprules")
|
||||||
|
|
||||||
|
----< Menu >----------------------------------------------------------
|
||||||
-- Create a laucher widget and a main menu
|
-- Create a laucher widget and a main menu
|
||||||
myawesomemenu = {
|
myawesomemenu = {
|
||||||
{ "manual", terminal .. " -e man awesome" },
|
|
||||||
{ "edit config", editor_cmd .. " " .. awesome.conffile },
|
{ "edit config", editor_cmd .. " " .. awesome.conffile },
|
||||||
{ "xscreensaver", "xscreensaver-demo" },
|
{ "hibernate", "gksudo hibernate" },
|
||||||
{ "restart", awesome.restart },
|
|
||||||
{ "lock", "xscreensaver-command --lock" },
|
{ "lock", "xscreensaver-command --lock" },
|
||||||
{ "quit", awesome.quit }
|
{ "manual", terminal .. " -e man awesome" },
|
||||||
|
{ "quit", awesome.quit },
|
||||||
|
{ "restart", awesome.restart },
|
||||||
|
{ "reboot", "gksudo reboot" },
|
||||||
|
{ "xscreensaver", "xscreensaver-demo" },
|
||||||
}
|
}
|
||||||
|
|
||||||
function lock_screen ()
|
|
||||||
os.execute ("xscreensaver-command --lock")
|
|
||||||
end
|
|
||||||
|
|
||||||
mywebmenu = {
|
mywebmenu = {
|
||||||
{ "Evernote", "nixnote.sh" },
|
{ "Evernote", "nixnote.sh" },
|
||||||
{ "Firefox", "firefox" },
|
{ "Firefox", "firefox" },
|
||||||
|
@ -209,10 +188,8 @@ mymainmenu = awful.menu({ items = {
|
||||||
|
|
||||||
mylauncher = awful.widget.launcher({ image = image(beautiful.awesome_icon),
|
mylauncher = awful.widget.launcher({ image = image(beautiful.awesome_icon),
|
||||||
menu = mymainmenu })
|
menu = mymainmenu })
|
||||||
-- }}}
|
|
||||||
|
|
||||||
-- {{{ Wibox
|
----< Wibox >----------------------------------------------------------
|
||||||
-- My widgets
|
|
||||||
wifi_widget_down = widget({ type = "textbox" })
|
wifi_widget_down = widget({ type = "textbox" })
|
||||||
wifi_widget_up = widget({ type = "textbox" })
|
wifi_widget_up = widget({ type = "textbox" })
|
||||||
icon_wifi = widget({ type = "imagebox" })
|
icon_wifi = widget({ type = "imagebox" })
|
||||||
|
@ -349,17 +326,16 @@ for s = 1, screen.count() do
|
||||||
layout = awful.widget.layout.horizontal.rightleft
|
layout = awful.widget.layout.horizontal.rightleft
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
-- }}}
|
|
||||||
|
|
||||||
-- {{{ Mouse bindings
|
----< Mouse bindings >------------------------------------------------
|
||||||
|
|
||||||
root.buttons(awful.util.table.join(
|
root.buttons(awful.util.table.join(
|
||||||
awful.button({ }, 3, function () mymainmenu:toggle() end),
|
awful.button({ }, 3, function () mymainmenu:toggle() end),
|
||||||
awful.button({ }, 4, awful.tag.viewnext),
|
awful.button({ }, 4, awful.tag.viewnext),
|
||||||
awful.button({ }, 5, awful.tag.viewprev)
|
awful.button({ }, 5, awful.tag.viewprev)
|
||||||
))
|
))
|
||||||
-- }}}
|
|
||||||
|
|
||||||
-- {{{ Key bindings
|
----< Key bindings >--------------------------------------------------
|
||||||
globalkeys = awful.util.table.join(
|
globalkeys = awful.util.table.join(
|
||||||
-- Volume control --
|
-- Volume control --
|
||||||
awful.key({ modkey }, ".", function ()
|
awful.key({ modkey }, ".", function ()
|
||||||
|
@ -411,7 +387,7 @@ globalkeys = awful.util.table.join(
|
||||||
awful.key({ modkey, }, "Return", function () awful.util.spawn(terminal) end),
|
awful.key({ modkey, }, "Return", function () awful.util.spawn(terminal) end),
|
||||||
awful.key({ modkey, "Control" }, "r", awesome.restart),
|
awful.key({ modkey, "Control" }, "r", awesome.restart),
|
||||||
-- awful.key({ modkey, "Shift" }, "q", awesome.quit),
|
-- awful.key({ modkey, "Shift" }, "q", awesome.quit),
|
||||||
awful.key({ modkey, "Control" }, "l", lock_screen),
|
awful.key({ modkey, "Control" }, "l", function () os.execute ("xscreensaver-command --lock") end),
|
||||||
|
|
||||||
awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) 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, }, "h", function () awful.tag.incmwfact(-0.05) end),
|
||||||
|
@ -507,11 +483,8 @@ clientbuttons = awful.util.table.join(
|
||||||
|
|
||||||
-- Set keys
|
-- Set keys
|
||||||
root.keys(globalkeys)
|
root.keys(globalkeys)
|
||||||
-- }}}
|
|
||||||
|
|
||||||
require("apprules")
|
----< Signals >------------------------------------------------------
|
||||||
|
|
||||||
-- {{{ Signals
|
|
||||||
-- Signal function to execute when a new client appears.
|
-- Signal function to execute when a new client appears.
|
||||||
client.add_signal("manage", function (c, startup)
|
client.add_signal("manage", function (c, startup)
|
||||||
-- Add a titlebar
|
-- Add a titlebar
|
||||||
|
@ -540,5 +513,3 @@ end)
|
||||||
|
|
||||||
client.add_signal("focus", function(c) c.border_color = beautiful.border_focus 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.add_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
|
||||||
-- }}}
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue