merge in the latest version of the default rc.lua
authorBenjamin Mako Hill <mako@atdot.cc>
Fri, 9 Oct 2020 17:23:21 +0000 (10:23 -0700)
committerBenjamin Mako Hill <mako@atdot.cc>
Fri, 9 Oct 2020 17:23:21 +0000 (10:23 -0700)
1  2 
rc.lua

diff --cc rc.lua
index c2c26c452d52c7a9c5a9b141846263bfc2f3ef51,9458979455685d0f79157c387f1be7eca7e99f26..2289a1217c81303dbae248c34bf3132e0bc189e4
--- 1/rc.lua
--- 2/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)

Benjamin Mako Hill || Want to submit a patch?