From 71a7fe2b72a6b8917f926a8a49853d288055d006 Mon Sep 17 00:00:00 2001 From: Augusto Gunsch Date: Mon, 24 Jan 2022 14:06:29 -0300 Subject: [PATCH] Awesome improvements --- config/awesome/cmus-widget/cmus.lua | 6 ++- config/awesome/rc.lua | 62 ++++++++++++----------------- 2 files changed, 29 insertions(+), 39 deletions(-) diff --git a/config/awesome/cmus-widget/cmus.lua b/config/awesome/cmus-widget/cmus.lua index dd5f797..0712ef0 100644 --- a/config/awesome/cmus-widget/cmus.lua +++ b/config/awesome/cmus-widget/cmus.lua @@ -24,10 +24,11 @@ end local function worker(user_args) local args = user_args or {} - local font = args.font or "Play 9" + local font = args.font or "Play 8" local path_to_icons = args.path_to_icons or "/usr/share/icons/Arc/actions/symbolic/" local timeout = args.timeout or 10 + local space = args.space or 3 cmus_widget.widget = wibox.widget { { @@ -43,6 +44,7 @@ local function worker(user_args) font = font, widget = wibox.widget.textbox }, + spacing = space, layout = wibox.layout.fixed.horizontal, update_icon = function(self, name) self:get_children_by_id("playback_icon")[1]:set_image(path_to_icons .. name) @@ -104,7 +106,7 @@ local function worker(user_args) function cmus_widget:play_pause() spawn("cmus-remote -u") - spawn.easy_async("cmus-remote -Q", + spawn.easy_async_with_shell("cmus-remote -Q", function(stdout, _, _, code) update_widget(cmus_widget.widget, stdout, _, _, code) end) diff --git a/config/awesome/rc.lua b/config/awesome/rc.lua index f4064ab..5fcdc22 100644 --- a/config/awesome/rc.lua +++ b/config/awesome/rc.lua @@ -65,41 +65,34 @@ if not beautiful.init(theme) then beautiful.init(gears.filesystem.get_themes_dir() .. "default/theme.lua") -- Fallback to default themes end --- This is used later as the default terminal and editor to run. +-- Default apps terminal = "alacritty" editor = os.getenv("EDITOR") or "nvim" editor_cmd = terminal .. " -e " .. editor - --- Screen locker command scrlocker = "cinnamon-screensaver-command -l" --- Default modkey. --- Usually, Mod4 is the key with a logo between Control and Alt. --- 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 = "Mod1" +-- Default modkey +modkey = "Mod1" + +-- Commands +local background_processes = { + "compton", + "flameshot", + "nm-applet", + "lxpolkit", + "unclutter" +} + +local reload_programs = { + "customkeys" +} -- Table of layouts to cover with awful.layout.inc, order matters. awful.layout.layouts = { awful.layout.suit.floating, awful.layout.suit.tile, - -- awful.layout.suit.tile.left, - -- awful.layout.suit.tile.bottom, - -- awful.layout.suit.tile.top, - -- awful.layout.suit.fair, - -- awful.layout.suit.fair.horizontal, - -- awful.layout.suit.spiral, - -- awful.layout.suit.spiral.dwindle, - awful.layout.suit.max, - -- awful.layout.suit.max.fullscreen, - -- awful.layout.suit.magnifier, - -- awful.layout.suit.corner.nw, - -- awful.layout.suit.corner.ne, - -- awful.layout.suit.corner.sw, - -- awful.layout.suit.corner.se, + awful.layout.suit.max } --- }}} -- {{{ Menu -- Create a launcher widget and a main menu @@ -271,8 +264,9 @@ awful.screen.connect_for_each_screen(function(s) { cmus_widget(), widget = wibox.container.margin, - right = 7, + right = 10, left = 7, + space = 5, draw_empty = false }, { @@ -670,17 +664,11 @@ local function trim(s) return s:find'^%s*$' and '' or s:match'^%s*(.*%S)' end - --- Debian packages for these apps: --- - flameshot --- - compton --- - unclutter - -- Autostart applications -run_once({"compton", - "flameshot", - "nm-applet", - "lxpolkit", - "unclutter"}) +for _, cmd in ipairs(background_processes) do + awful.spawn.single_instance(cmd) +end -awful.spawn("customkeys") +for _, cmd in ipairs(reload_programs) do + awful.spawn(cmd) +end