From de01388d0d24c7b35820072fd216c0d7bbd35171 Mon Sep 17 00:00:00 2001 From: Jeff LANCE Date: Mon, 8 May 2023 23:05:04 +0200 Subject: [PATCH] renew config --- conf.d/awesome/main/error-handling.lua | 28 ++++++++++ conf.d/awesome/rc.lua | 76 ++++++++++++-------------- 2 files changed, 63 insertions(+), 41 deletions(-) create mode 100644 conf.d/awesome/main/error-handling.lua diff --git a/conf.d/awesome/main/error-handling.lua b/conf.d/awesome/main/error-handling.lua new file mode 100644 index 0000000..67a4964 --- /dev/null +++ b/conf.d/awesome/main/error-handling.lua @@ -0,0 +1,28 @@ +-- Notification library +local naughty = require("naughty") + +-- {{{ Error handling +-- 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 + naughty.notify({ preset = naughty.config.presets.critical, + title = "Oops, there were errors during startup!", + text = awesome.startup_errors }) +end + +-- Handle runtime errors after startup +do + local in_error = false + awesome.connect_signal("debug::error", function (err) + -- Make sure we don't go into an endless error loop + if in_error then return end + in_error = true + + naughty.notify({ preset = naughty.config.presets.critical, + title = "Oops, an error happened!", + text = tostring(err) }) + in_error = false + end) +end +-- }}} + diff --git a/conf.d/awesome/rc.lua b/conf.d/awesome/rc.lua index b2839a9..a709da6 100644 --- a/conf.d/awesome/rc.lua +++ b/conf.d/awesome/rc.lua @@ -2,54 +2,48 @@ -- found (e.g. lgi). If LuaRocks is not installed, do nothing. pcall(require, "luarocks.loader") --- Standard awesome library + +-- {{{ Standard awesome library local gears = require("gears") local awful = require("awful") require("awful.autofocus") --- Widget and layout library +-- }}} + + +-- {{{ Widget and layout library local wibox = require("wibox") --- Theme handling library +-- }}} + + +-- {{{ Theme handling library local beautiful = require("beautiful") --- Notification library +-- }}} + + +-- {{{ Notification library local naughty = require("naughty") local menubar = require("menubar") local hotkeys_popup = require("awful.hotkeys_popup") --- Enable hotkeys help widget for VIM and other apps +-- }}} + + +-- {{{ Enable hotkeys help widget for VIM and other apps -- when client with a matching name is opened: require("awful.hotkeys_popup.keys") +-- }}} + -- {{{ Error handling --- 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 - naughty.notify({ preset = naughty.config.presets.critical, - title = "Oops, there were errors during startup!", - text = awesome.startup_errors }) -end +require("main.error-handling") +-- }} --- Handle runtime errors after startup -do - local in_error = false - awesome.connect_signal("debug::error", function (err) - -- Make sure we don't go into an endless error loop - if in_error then return end - in_error = true - - naughty.notify({ preset = naughty.config.presets.critical, - title = "Oops, an error happened!", - text = tostring(err) }) - in_error = false - end) -end --- }}} -- {{{ Variable definitions -- Themes define colours, icons, font and wallpapers. --- beautiful.init(gears.filesystem.get_themes_dir() .. "default/theme.lua") -beautiful.init(gears.filesystem.get_xdg_config_home() .. "awesome/themes/zatichi/theme.lua") +beautiful.init(gears.filesystem.get_themes_dir() .. "default/theme.lua") -- This is used later as the default terminal and editor to run. -terminal = "termite" +terminal = "xterm" editor = os.getenv("EDITOR") or "nano" editor_cmd = terminal .. " -e " .. editor @@ -230,8 +224,8 @@ root.buttons(gears.table.join( -- {{{ Key bindings globalkeys = gears.table.join( - awful.key({ modkey, }, "h", hotkeys_popup.show_help, - {description ="Montrer l'aide", group="awesome"}), + awful.key({ modkey, }, "s", hotkeys_popup.show_help, + {description="show help", group="awesome"}), awful.key({ modkey, }, "Left", awful.tag.viewprev, {description = "view previous", group = "tag"}), awful.key({ modkey, }, "Right", awful.tag.viewnext, @@ -251,8 +245,8 @@ globalkeys = gears.table.join( end, {description = "focus previous by index", group = "client"} ), - awful.key({ modkey, }, "a", function () mymainmenu:show() end, - {description = "Montrer menu principal", group = "awesome"}), + awful.key({ modkey, }, "w", function () mymainmenu:show() end, + {description = "show main menu", group = "awesome"}), -- Layout manipulation awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end, @@ -276,11 +270,11 @@ globalkeys = gears.table.join( -- Standard program awful.key({ modkey, }, "Return", function () awful.spawn(terminal) end, - {description = "Ouvrir un terminal", group = "launcher"}), - awful.key({ modkey, }, "r", awesome.restart, - {description = "Recharger awesome", group = "awesome"}), - awful.key({ modkey, }, "q", awesome.quit, - {description = "Quitter awesome", group = "awesome"}), + {description = "open a terminal", group = "launcher"}), + awful.key({ modkey, "Control" }, "r", awesome.restart, + {description = "reload awesome", group = "awesome"}), + awful.key({ modkey, "Shift" }, "q", awesome.quit, + {description = "quit awesome", group = "awesome"}), awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end, {description = "increase master width factor", group = "layout"}), @@ -312,8 +306,8 @@ globalkeys = gears.table.join( {description = "restore minimized", group = "client"}), -- Prompt - -- awful.key({ modkey }, "r", function () awful.screen.focused().mypromptbox:run() end, - -- {description = "run prompt", group = "launcher"}), + awful.key({ modkey }, "r", function () awful.screen.focused().mypromptbox:run() end, + {description = "run prompt", group = "launcher"}), awful.key({ modkey }, "x", function ()