Awesome improvements

This commit is contained in:
Augusto Gunsch 2022-01-24 14:06:29 -03:00
parent 66e4c5a88b
commit 71a7fe2b72
No known key found for this signature in database
GPG Key ID: F7EEFE29825C72DC
2 changed files with 29 additions and 39 deletions

View File

@ -24,10 +24,11 @@ end
local function worker(user_args) local function worker(user_args)
local args = user_args or {} 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 path_to_icons = args.path_to_icons or "/usr/share/icons/Arc/actions/symbolic/"
local timeout = args.timeout or 10 local timeout = args.timeout or 10
local space = args.space or 3
cmus_widget.widget = wibox.widget { cmus_widget.widget = wibox.widget {
{ {
@ -43,6 +44,7 @@ local function worker(user_args)
font = font, font = font,
widget = wibox.widget.textbox widget = wibox.widget.textbox
}, },
spacing = space,
layout = wibox.layout.fixed.horizontal, layout = wibox.layout.fixed.horizontal,
update_icon = function(self, name) update_icon = function(self, name)
self:get_children_by_id("playback_icon")[1]:set_image(path_to_icons .. 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() function cmus_widget:play_pause()
spawn("cmus-remote -u") spawn("cmus-remote -u")
spawn.easy_async("cmus-remote -Q", spawn.easy_async_with_shell("cmus-remote -Q",
function(stdout, _, _, code) function(stdout, _, _, code)
update_widget(cmus_widget.widget, stdout, _, _, code) update_widget(cmus_widget.widget, stdout, _, _, code)
end) end)

View File

@ -65,41 +65,34 @@ if not beautiful.init(theme) then
beautiful.init(gears.filesystem.get_themes_dir() .. "default/theme.lua") -- Fallback to default themes beautiful.init(gears.filesystem.get_themes_dir() .. "default/theme.lua") -- Fallback to default themes
end end
-- This is used later as the default terminal and editor to run. -- Default apps
terminal = "alacritty" terminal = "alacritty"
editor = os.getenv("EDITOR") or "nvim" editor = os.getenv("EDITOR") or "nvim"
editor_cmd = terminal .. " -e " .. editor editor_cmd = terminal .. " -e " .. editor
-- Screen locker command
scrlocker = "cinnamon-screensaver-command -l" scrlocker = "cinnamon-screensaver-command -l"
-- Default modkey. -- Default modkey
-- Usually, Mod4 is the key with a logo between Control and Alt. modkey = "Mod1"
-- 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. -- Commands
-- However, you can use another modifier like Mod1, but it may interact with others. local background_processes = {
modkey = "Mod1" "compton",
"flameshot",
"nm-applet",
"lxpolkit",
"unclutter"
}
local reload_programs = {
"customkeys"
}
-- Table of layouts to cover with awful.layout.inc, order matters. -- Table of layouts to cover with awful.layout.inc, order matters.
awful.layout.layouts = { awful.layout.layouts = {
awful.layout.suit.floating, awful.layout.suit.floating,
awful.layout.suit.tile, awful.layout.suit.tile,
-- awful.layout.suit.tile.left, awful.layout.suit.max
-- 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,
} }
-- }}}
-- {{{ Menu -- {{{ Menu
-- Create a launcher widget and a main menu -- Create a launcher widget and a main menu
@ -271,8 +264,9 @@ awful.screen.connect_for_each_screen(function(s)
{ {
cmus_widget(), cmus_widget(),
widget = wibox.container.margin, widget = wibox.container.margin,
right = 7, right = 10,
left = 7, left = 7,
space = 5,
draw_empty = false draw_empty = false
}, },
{ {
@ -670,17 +664,11 @@ local function trim(s)
return s:find'^%s*$' and '' or s:match'^%s*(.*%S)' return s:find'^%s*$' and '' or s:match'^%s*(.*%S)'
end end
-- Debian packages for these apps:
-- - flameshot
-- - compton
-- - unclutter
-- Autostart applications -- Autostart applications
run_once({"compton", for _, cmd in ipairs(background_processes) do
"flameshot", awful.spawn.single_instance(cmd)
"nm-applet", end
"lxpolkit",
"unclutter"})
awful.spawn("customkeys") for _, cmd in ipairs(reload_programs) do
awful.spawn(cmd)
end