From df229f65dc5bd03bac52603e9f4d8e0aa5125374 Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Wed, 24 Jul 2019 11:32:27 +0200 Subject: [PATCH] Update config & theme lifecycle --- README.md | 1 - config.lua | 1 + default_config.lua | 3 +++ rc.lua | 31 ++++++++++++++++++------------- 4 files changed, 22 insertions(+), 14 deletions(-) create mode 100644 config.lua diff --git a/README.md b/README.md index f173238..7c621de 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,6 @@ By default, Simple Awesome uses - `playerctl` - enables global media control. If not present on your system, only Spotify will work. - `network-manager-applet` (`nm-applet`) - network control "widget" **for `NetworkManager` only**. If present on your system, we will automatically run it. - ## To do - Add a media control widget diff --git a/config.lua b/config.lua new file mode 100644 index 0000000..efe5aa6 --- /dev/null +++ b/config.lua @@ -0,0 +1 @@ +return require("default_config") \ No newline at end of file diff --git a/default_config.lua b/default_config.lua index 27957d7..de33da4 100644 --- a/default_config.lua +++ b/default_config.lua @@ -5,6 +5,9 @@ local awful = require("awful") local config = {} +-- General +config.modkey = "Mod4" + -- Terminal config.terminal = "terminator" diff --git a/rc.lua b/rc.lua index 7b0dc1e..3894904 100644 --- a/rc.lua +++ b/rc.lua @@ -21,18 +21,6 @@ local hotkeys_popup = require("awful.hotkeys_popup") -- when client with a matching name is opened: require("awful.hotkeys_popup.keys") --- Simple awesome -local config = require("default_config") -local tiling = require("tiling") -local media_control = require("media_control") - --- Network widget -if os.execute("nm-applet --help") == true then - os.execute("nm-applet &") -else - -- Support for more network managers should be requested via issues -end - -- {{{ Error handling -- Check if awesome encountered an error during startup and fell back to @@ -60,10 +48,27 @@ do end -- }}} + +-- Simple awesome start +local config = require("config") + -- {{{ Variable definitions -- Themes define colours, icons, font and wallpapers. beautiful.init(config.theme) +-- Media control +local media_control = require("media_control") + +-- Tiling +local tiling = require("tiling") + +-- Network widget +if os.execute("nm-applet --help") == true then + os.execute("nm-applet &") +else + -- Support for more network managers should be requested via issues +end + -- This is used later as the default terminal and editor to run. editor = os.getenv("EDITOR") or "nano" editor_cmd = config.terminal .. " -e " .. editor @@ -73,7 +78,7 @@ editor_cmd = config.terminal .. " -e " .. editor -- If you do not like this or do not have such a key, -- I suggest you to remap Mod4 to another key using xmodmap or other tools. -- However, you can use another modifier like Mod1, but it may interact with others. -modkey = "Mod4" +modkey = config.modkey -- Table of layouts to cover with awful.layout.inc, order matters. awful.layout.layouts = {