+-- 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")
+
-- Standard awesome library
local gears = require("gears")
local awful = require("awful")
-- Notification library
local naughty = require("naughty")
local menubar = require("menubar")
- local hotkeys_popup = require("awful.hotkeys_popup").widget
+ local hotkeys_popup = require("awful.hotkeys_popup")
+ -- Enable hotkeys help widget for VIM and other apps
+ -- 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
- require("debian.menu")
+ local debian = require("debian.menu")
+ local has_fdo, freedesktop = pcall(require, "freedesktop")
-- {{{ Error handling
-- Check if awesome encountered an error during startup and fell back to
-- {{{ Variable definitions
-- Themes define colours, icons, font and wallpapers.
- -- beautiful.init(awful.util.get_themes_dir() .. "default/theme.lua")
-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"
-- {{{ 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 = awful.util.table.join(
+ local taglist_buttons = gears.table.join(
awful.button({ }, 1, function(t) t:view_only() end),
awful.button({ modkey }, 1, function(t)
if client.focus then
end)
-- }}}
+-- right_layout:add(volumecfg.widget)
+
-- {{{ Mouse bindings
- root.buttons(awful.util.table.join(
+ root.buttons(gears.table.join(
awful.button({ }, 3, function () mymainmenu:toggle() end),
awful.button({ }, 4, awful.tag.viewnext),
awful.button({ }, 5, awful.tag.viewprev)