-- 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 = "Mod4"
+altkey = "Mod1"
--- {{{1 Mouse bindings
+-- Mouse bindings {{{1
root.buttons(awful.util.table.join(
awful.button({ }, 3, function () mymainmenu:toggle() end),
awful.button({ }, 4, awful.tag.viewnext),
awful.button({ modkey }, 1, awful.mouse.client.move),
awful.button({ modkey }, 3, awful.mouse.client.resize))
--- {{{1 Global Keys
+-- Global Keys {{{1
globalkeys = awful.util.table.join(globalkeys,
- -- {{{2 Awesome Keys
+ -- Awesome Keys {{{2
awful.key({ modkey, }, "Left", awful.tag.viewprev ),
awful.key({ modkey, }, "Right", awful.tag.viewnext ),
-- Menubar
awful.key({ modkey }, "p", function() menubar.show() end),
- -- {{{2 My Keys
+ -- My Keys {{{2
-- Menu
awful.key({ modkey }, "w", function () mymainmenu:show({ coords = { x = 0, y = 0}}) end),
-- Prompt
awful.key({ }, "XF86AudioMute", function () awful.util.spawn("ponymix toggle") end)
)
--- {{{1 Client keys
+-- Client keys {{{1
clientkeys = awful.util.table.join(
- -- {{{2 Awesome Client Keys
+ -- Awesome Client Keys {{{2
awful.key({ modkey, }, "f", function (c) c.fullscreen = not c.fullscreen end),
awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end),
awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle ),
c.maximized_vertical = not c.maximized_vertical
end),
- -- {{{2 My Client Keys
+ -- My Client Keys {{{2
-- Move client to screen
awful.key({ modkey, "Shift" }, "#94", awful.client.movetoscreen ),
awful.key({ modkey, "Shift" }, "#49", awful.client.movetoscreen ),
-- }}}
)
--- {{{1 Tags
+-- Tags {{{1
-- 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.
local utils = require("utils")
local function get_conky()
- local clients = client.get()
- local conky = nil
- local i = 1
- while clients[i]
- do
- if clients[i].class == "Conky"
- then
- conky = clients[i]
- end
- i = i + 1
+ local clients = client.get()
+ local conky = nil
+ local i = 1
+ while clients[i] do
+ if clients[i].class == "Conky" then
+ conky = clients[i]
end
- return conky
+ i = i + 1
+ end
+ return conky
end
local function raise_conky()
- local conky = get_conky()
- if conky
- then
- conky.ontop = true
- conky.hidden = false
- end
+ local conky = get_conky()
+ if conky then
+ conky.ontop = true
+ conky.hidden = false
+ end
end
local function lower_conky()
- local conky = get_conky()
- if conky
- then
- conky.ontop = false
- conky.hidden = true
- end
+ local conky = get_conky()
+ if conky then
+ conky.ontop = false
+ conky.hidden = true
+ end
end
local function toggle_conky()
- local conky = get_conky()
- if conky
- then
- if conky.ontop
- then
- conky.ontop = false
- else
- conky.ontop = true
- end
+ local conky = get_conky()
+ if conky then
+ if conky.ontop then
+ conky.ontop = false
+ else
+ conky.ontop = true
end
+ end
end
utils.rules.append({
- { rule = { class = "Conky" },
- properties = { floating = true,
- sticky = true,
- ontop = false,
- hidden = true,
- focusable = true,
- size_hints = {"program_position", "program_size"}
- } },
+ { rule = { class = "Conky" },
+ properties = { floating = true,
+ sticky = true,
+ ontop = false,
+ hidden = true,
+ focusable = true,
+ size_hints = {"program_position", "program_size"} } },
})
-- add global key
freedesktopmenu = freedesktop.menu.new()
--- {{{ Menu
-- Setup global menu keys
awful.menu.menu_keys.up = { "k", "Up"}
awful.menu.menu_keys.down = { "j", "Down"}
-- Menubar configuration
menubar.utils.terminal = terminal -- Set the terminal for applications that require it
--- }}}
--- Standard awesome library
+-- Standard awesome library {{{1
gears = require("gears")
awful = require("awful")
awful.rules = require("awful.rules")
require("awful.autofocus")
--- Theme handling library
beautiful = require("beautiful")
--- Notification library
naughty = require("naughty")
menubar = require("menubar")
--- {{{ Error handling
+-- Error handling {{{1
-- 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
in_error = false
end)
end
--- }}}
--- {{{ Variable definitions
+-- Variable definitions {{{1
-- Themes define colours, icons, and wallpapers
beautiful.init(awful.util.getdir("config").."/themes/mlp/theme.lua")
editor = os.getenv("EDITOR") or "vim"
editor_cmd = terminal .. " -e " .. editor
--- Tags
-require("tags")
--- }}}
-
--- {{{ Wallpaper
+-- Wallpaper {{{1
if beautiful.wallpaper then
for s = 1, screen.count() do
gears.wallpaper.maximized(beautiful.wallpaper, s, true)
end
end
--- }}}
---Menu
+-- Require files {{{1
+require("tags")
require("menu")
-
--- Topbar
require("topbar")
-
--- Mouse/Key Bindings
require("bindings")
-
--- Rules
require("rules")
-
--- conky
require("conky")
+require("autostart")
--- {{{ Signals
+-- Signals {{{1
-- Signal function to execute when a new client appears.
client.connect_signal("manage", function (c, startup)
-- Enable sloppy focus
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)
--- }}}
-- Set keys
root.keys(globalkeys)
-
--- Autostart applications
-require("autostart")
local utils = require("utils")
--- {{{ Rules
if utils.host == "shada" then mediatag = tags[2][3] end
if utils.host == "chronos" then mediatag = tags[1][4] end
skip_taskbar = true,
ontop = true,
x = 1920 - 310, y = mywibox[mouse.screen].height,
- height = 100, width = 100 } },
+ width = 100, height = 100 } },
{ rule = { class = "URxvt", instance = "mutt" },
properties = { tag = wwwtag,
function (c) awful.client.setslave(c) end } },
{ rule = { class = "Steam" },
properties = { tag = tags[1][9] } },
}
--- }}}
--- {{{ Layouts
+-- Layouts {{{1
-- Table of layouts to cover with awful.layout.inc, order matters.
layouts =
{
awful.layout.suit.max.fullscreen,
--awful.layout.suit.magnifier
}
--- }}}
--- {{{ Tags
+-- Tags {{{1
local mytags = {}
local path = beautiful.path
local icon_only = true
--- {{{ single screen
+-- single screen {{{2
mytags[1] = {}
mytags[1][1] = {
{ name = "1", layout = awful.layout.suit.tile.left, mwfact=0.50, icon = path.."/cutiemarks/pinkie_pie.png"},
{ name = "8", layout = awful.layout.suit.max, mwfact=0.50, icon = path.."/cutiemarks/princess_celestia.png"},
{ name = "9", layout = awful.layout.suit.floating, mwfact=0.50, icon = path.."/cutiemarks/princess_luna.png"},
}
--- }}}
--- {{{ Dual screen
+-- Dual screen {{{2
mytags[2] = {}
mytags[2][1] = {
{ name = "1", layout = awful.layout.suit.tile.left, mwfact=0.50, icon = path.."/cutiemarks/pinkie_pie.png"},
{ name = "8", layout = awful.layout.suit.tile, mwfact=0.50, icon = path.."/cutiemarks/thunderlane.png"},
{ name = "9", layout = awful.layout.suit.max, mwfact=0.50, icon = path.."/cutiemarks/bon_bon.png"},
}
--- }}}
+-- Tags {{{2
tags = {}
local sc = screen.count()
for s = 1, sc do
end
tags[s][1].selected = true
end
--- }}}
separator = wibox.widget.textbox()
separator:set_markup('<span font="Symbola 10" color="#404040">│</span>')
--- {{{ Wibox
+-- Wibox {{{1
-- Create a wibox for each screen and add it
mywibox = {}
mypromptbox = {}
mywibox[s]:set_widget(layout)
end
--- }}}
prefix = "Bat:"
if charge <= nextlim then
naughty.notify({title = "⚡ Warning! ⚡",
- text = "Battery has leaked most of its power ( ⚡ "
- ..charge.."%)!",
+ text = "Battery has leaked most of its power ( ⚡ "..charge.."%)!",
timeout = 7,
position = "top_right",
fg = beautiful.fg_focus,
end
batterywidget = wibox.widget.textbox()
-vicious.register(batterywidget, vicious.widgets.bat, batclosure(),
- 31, "BAT0")
+vicious.register(batterywidget, vicious.widgets.bat, batclosure(), 31, "BAT0")
return batterywidget
local utils = require("utils")
local volwidget = { }
---{{{ Volume progressbar
+-- Volume Widget {{{1
-- Select device
local device = ""
if utils.host == "chronos" then device = "alsa_output.pci-0000_00_1b.0.analog-stereo" end