+-- read the timezone from /etc/timezone (this doesn't work, somehow)
+local function read_tz_file(path)
+ local file = io.open(path, "r") -- r read mode and b binary mode
+ if not file then return nil end
+ local content = file:read "*a" -- *a or *all reads the whole file
+ file:close()
+ content = content:gsub("^%s*", "")
+ content = content:gsub("%s*$", "")
+ return content
+end
+
+local tz_string = read_tz_file("/etc/timezone")
+
-- If LuaRocks is installed, make sure that packages installed through it are
-- found (e.g. lgi). If LuaRocks is not installed, do nothing.
pcall(require, "luarocks.loader")
-- when client with a matching name is opened:
require("awful.hotkeys_popup.keys")
+-- load the volume widget code and set settings
+local volume_control = require("volume-control")
+volumecfg = volume_control({})
+
-- Load Debian menu entries
local debian = require("debian.menu")
local has_fdo, freedesktop = pcall(require, "freedesktop")
-- {{{ Variable definitions
-- Themes define colours, icons, font and wallpapers.
-beautiful.init(gears.filesystem.get_themes_dir() .. "default/theme.lua")
+beautiful.init(awful.util.get_themes_dir() .. "sky/theme.lua")
+beautiful.wallpaper = "/home/mako/images/Flag_of_Cascadia.png"
-- This is used later as the default terminal and editor to run.
terminal = "x-terminal-emulator"
-- Table of layouts to cover with awful.layout.inc, order matters.
awful.layout.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.corner.nw,
- -- awful.layout.suit.corner.ne,
- -- awful.layout.suit.corner.sw,
- -- awful.layout.suit.corner.se,
+ awful.layout.suit.floating
}
-- }}}
-- {{{ Wibar
-- Create a textclock widget
-mytextclock = wibox.widget.textclock()
+mytextclock = wibox.widget.textclock("%a %m %d %H:%M", 60, tz_string)
-- Create a wibox for each screen and add it
local taglist_buttons = gears.table.join(
layout = wibox.layout.fixed.horizontal,
mykeyboardlayout,
wibox.widget.systray(),
+ -- volumecfg.widget,
mytextclock,
s.mylayoutbox,
},
end)
-- }}}
+-- right_layout:add(volumecfg.widget)
+
-- {{{ Mouse bindings
root.buttons(gears.table.join(
awful.button({ }, 3, function () mymainmenu:toggle() end),
-- Prompt
awful.key({ modkey }, "r", function () awful.screen.focused().mypromptbox:run() end,
{description = "run prompt", group = "launcher"}),
+
+ awful.key({ modkey, }, "x",
+ function ()
+ awful.prompt.run {
+ prompt = "Run in terminal: ",
+ textbox = awful.screen.focused().mypromptbox.widget,
+ exe_callback = function (prog) awful.util.spawn_with_shell(terminal .. " -title " .. prog .. " -e " .. prog) end
+ }
+ end,
+ {description = "terminal execute prompt", group = "awesome"}),
- awful.key({ modkey }, "x",
+ -- Mako's additional keybindings
+ --- {{{
+ awful.key({ modkey, "Shift", }, "x",
function ()
awful.prompt.run {
prompt = "Run Lua code: ",
}
end,
{description = "lua execute prompt", group = "awesome"}),
+
+ awful.key({ modkey }, "q",
+ function ()
+ awful.tag.incnmaster(-1)
+ awful.tag.incncol(3)
+ end),
+
+ awful.key({ modkey, "Shift" }, "t", awful.titlebar.toggle),
+
+ --- }}}
+
-- Menubar
awful.key({ modkey }, "p", function() menubar.show() end,
{description = "show the menubar", group = "launcher"})
end
end
end,
- {description = "toggle focused client on tag #" .. i, group = "tag"})
+ {description = "toggle focused client on tag #" .. i, group = "tag"}),
+ awful.key({}, "XF86AudioRaiseVolume", function() volumecfg:up() end),
+ awful.key({}, "XF86AudioLowerVolume", function() volumecfg:down() end),
+ awful.key({}, "XF86AudioMute", function() volumecfg:toggle() end)
)
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)
--- }}}
\ No newline at end of file
+-- }}}