renew config

This commit is contained in:
Jeff Lance 2023-05-08 23:05:04 +02:00
parent a557801b56
commit de01388d0d
2 changed files with 63 additions and 41 deletions

View File

@ -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
-- }}}

View File

@ -2,54 +2,48 @@
-- found (e.g. lgi). If LuaRocks is not installed, do nothing. -- found (e.g. lgi). If LuaRocks is not installed, do nothing.
pcall(require, "luarocks.loader") pcall(require, "luarocks.loader")
-- Standard awesome library
-- {{{ Standard awesome library
local gears = require("gears") local gears = require("gears")
local awful = require("awful") local awful = require("awful")
require("awful.autofocus") require("awful.autofocus")
-- Widget and layout library -- }}}
-- {{{ Widget and layout library
local wibox = require("wibox") local wibox = require("wibox")
-- Theme handling library -- }}}
-- {{{ Theme handling library
local beautiful = require("beautiful") local beautiful = require("beautiful")
-- Notification library -- }}}
-- {{{ Notification library
local naughty = require("naughty") local naughty = require("naughty")
local menubar = require("menubar") local menubar = require("menubar")
local hotkeys_popup = require("awful.hotkeys_popup") 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: -- when client with a matching name is opened:
require("awful.hotkeys_popup.keys") require("awful.hotkeys_popup.keys")
-- }}}
-- {{{ Error handling -- {{{ Error handling
-- Check if awesome encountered an error during startup and fell back to require("main.error-handling")
-- 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
-- }}}
-- {{{ Variable definitions -- {{{ Variable definitions
-- Themes define colours, icons, font and wallpapers. -- Themes define colours, icons, font and wallpapers.
-- beautiful.init(gears.filesystem.get_themes_dir() .. "default/theme.lua") beautiful.init(gears.filesystem.get_themes_dir() .. "default/theme.lua")
beautiful.init(gears.filesystem.get_xdg_config_home() .. "awesome/themes/zatichi/theme.lua")
-- This is used later as the default terminal and editor to run. -- This is used later as the default terminal and editor to run.
terminal = "termite" terminal = "xterm"
editor = os.getenv("EDITOR") or "nano" editor = os.getenv("EDITOR") or "nano"
editor_cmd = terminal .. " -e " .. editor editor_cmd = terminal .. " -e " .. editor
@ -230,8 +224,8 @@ root.buttons(gears.table.join(
-- {{{ Key bindings -- {{{ Key bindings
globalkeys = gears.table.join( globalkeys = gears.table.join(
awful.key({ modkey, }, "h", hotkeys_popup.show_help, awful.key({ modkey, }, "s", hotkeys_popup.show_help,
{description ="Montrer l'aide", group="awesome"}), {description="show help", group="awesome"}),
awful.key({ modkey, }, "Left", awful.tag.viewprev, awful.key({ modkey, }, "Left", awful.tag.viewprev,
{description = "view previous", group = "tag"}), {description = "view previous", group = "tag"}),
awful.key({ modkey, }, "Right", awful.tag.viewnext, awful.key({ modkey, }, "Right", awful.tag.viewnext,
@ -251,8 +245,8 @@ globalkeys = gears.table.join(
end, end,
{description = "focus previous by index", group = "client"} {description = "focus previous by index", group = "client"}
), ),
awful.key({ modkey, }, "a", function () mymainmenu:show() end, awful.key({ modkey, }, "w", function () mymainmenu:show() end,
{description = "Montrer menu principal", group = "awesome"}), {description = "show main menu", group = "awesome"}),
-- Layout manipulation -- Layout manipulation
awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end, awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end,
@ -276,11 +270,11 @@ globalkeys = gears.table.join(
-- Standard program -- Standard program
awful.key({ modkey, }, "Return", function () awful.spawn(terminal) end, awful.key({ modkey, }, "Return", function () awful.spawn(terminal) end,
{description = "Ouvrir un terminal", group = "launcher"}), {description = "open a terminal", group = "launcher"}),
awful.key({ modkey, }, "r", awesome.restart, awful.key({ modkey, "Control" }, "r", awesome.restart,
{description = "Recharger awesome", group = "awesome"}), {description = "reload awesome", group = "awesome"}),
awful.key({ modkey, }, "q", awesome.quit, awful.key({ modkey, "Shift" }, "q", awesome.quit,
{description = "Quitter awesome", group = "awesome"}), {description = "quit awesome", group = "awesome"}),
awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end, awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end,
{description = "increase master width factor", group = "layout"}), {description = "increase master width factor", group = "layout"}),
@ -312,8 +306,8 @@ globalkeys = gears.table.join(
{description = "restore minimized", group = "client"}), {description = "restore minimized", group = "client"}),
-- Prompt -- Prompt
-- awful.key({ modkey }, "r", function () awful.screen.focused().mypromptbox:run() end, awful.key({ modkey }, "r", function () awful.screen.focused().mypromptbox:run() end,
-- {description = "run prompt", group = "launcher"}), {description = "run prompt", group = "launcher"}),
awful.key({ modkey }, "x", awful.key({ modkey }, "x",
function () function ()