--[[
Awesome WM configuration template
https://github.com/awesomeWM
Freedesktop : https://github.com/lcpz/awesome-freedesktop
Copycats themes : https://github.com/lcpz/awesome-copycats
lain : https://github.com/lcpz/lain
--]]
-- {{{ Required libraries
local awesome, client, mouse, screen, tag = awesome, client, mouse, screen, tag
local ipairs, string, os, table, tostring, tonumber, type = ipairs, string, os, table, tostring, tonumber, type
--https://awesomewm.org/doc/api/documentation/05-awesomerc.md.html
-- Standard awesome library
local gears = require("gears") --Utilities such as color parsing and objects
local awful = require("awful") --Everything related to window managment
require("awful.autofocus")
-- Widget and layout library
local wibox = require("wibox")
-- Theme handling library
local beautiful = require("beautiful")
-- Notification library
local naughty = require("naughty")
naughty.config.defaults['icon_size'] = 100
--local menubar = require("menubar")
local lain = require("lain")
local freedesktop = require("freedesktop")
-- Enable hotkeys help widget for VIM and other apps
-- when client with a matching name is opened:
local hotkeys_popup = require("awful.hotkeys_popup").widget
require("awful.hotkeys_popup.keys")
local my_table = awful.util.table or gears.table -- 4.{0,1} compatibility
local dpi = require("beautiful.xresources").apply_dpi
-- }}}
-- {{{ 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)
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
-- }}}
-- {{{ Autostart windowless processes
local function run_once(cmd_arr)
for _, cmd in ipairs(cmd_arr) do
awful.spawn.with_shell(string.format("pgrep -u $USER -fx '%s' > /dev/null || (%s)", cmd, cmd))
end
end
run_once({ "unclutter -root" }) -- entries must be comma-separated
-- }}}
-- This function implements the XDG autostart specification
--[[
awful.spawn.with_shell(
'if (xrdb -query | grep -q "^awesome\\.started:\\s*true$"); then exit; fi;' ..
'xrdb -merge <<< "awesome.started:true";' ..
-- list each of your autostart commands, followed by ; inside single quotes, followed by ..
'dex --environment Awesome --autostart --search-paths "$XDG_CONFIG_DIRS/autostart:$XDG_CONFIG_HOME/autostart"' -- https://github.com/jceb/dex
)
--]]
-- }}}
-- {{{ Variable definitions
local themes = {
"multicolor", -- 1
"powerarrow", -- 2
"powerarrow-blue", -- 3
"blackburn", -- 4
"copland", -- 5
}
-- choose your theme here
local chosen_theme = themes[1]
local theme_path = string.format("%s/.config/awesome/themes/%s/theme.lua", os.getenv("HOME"), chosen_theme)
beautiful.init(theme_path)
-- modkey or mod4 = super key
local modkey = "Mod4"
local altkey = "Mod1"
local modkey1 = "Control"
-- personal variables
--change these variables if you want
local browser1 = "brave"
local browser2 = "firefox"
local browser3 = "chromium -no-default-browser-check"
local editor = os.getenv("EDITOR") or "nano"
local editorgui = "atom"
local filemanager = "pcmanfm"
local mailclient = "evolution"
local mediaplayer = "spotify"
local terminal = "kitty"
local virtualmachine = "virtualbox"
-- awesome variables
awful.util.terminal = terminal
-- awful.util.tagnames = { "➊", "➋", "➌", "➍", "➎", "➏", "➐", "➑", "➒" }
--awful.util.tagnames = { "⠐", "⠡", "⠲", "⠵", "⠻", "⠿" }
--awful.util.tagnames = { "⌘", "♐", "⌥", "ℵ" }
awful.util.tagnames = { " WWW ", " DEV ", " STUDY ", " MUSIC ", " READING ", " LEISURE " }
-- Use this : https://fontawesome.com/cheatsheet
-- awful.util.tagnames = { "", "", "", "", "" }
awful.layout.suit.tile.left.mirror = true
awful.layout.layouts = {
awful.layout.suit.tile,
awful