From: Benjamin Mako Hill Date: Fri, 9 Oct 2020 17:23:21 +0000 (-0700) Subject: merge in the latest version of the default rc.lua X-Git-Url: https://projects.mako.cc/source/awesome-config/commitdiff_plain/4f2d7dde644098f6ff5a6bf23cfe906dc7b191c2 merge in the latest version of the default rc.lua --- 4f2d7dde644098f6ff5a6bf23cfe906dc7b191c2 diff --cc rc.lua index c2c26c4,9458979..2289a12 --- a/rc.lua +++ b/rc.lua @@@ -1,16 -1,7 +1,20 @@@ +-- 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") @@@ -22,14 -13,14 +26,18 @@@ local beautiful = require("beautiful" -- 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 @@@ -58,9 -49,7 +66,8 @@@ en -- {{{ 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" @@@ -125,10 -125,10 +130,10 @@@ mykeyboardlayout = awful.widget.keyboar -- {{{ 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 @@@ -233,10 -237,8 +243,10 @@@ awful.screen.connect_for_each_screen(fu 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)