Compare commits

..

No commits in common. "e992db6c07247d375db1aaecfb0bb73671076fac" and "952d12d56012ee01dafd679bba8089b594d07752" have entirely different histories.

11 changed files with 213 additions and 255 deletions

View file

@ -11,7 +11,7 @@ local themes_path = gfs.get_themes_dir()
local theme = {} local theme = {}
theme.font = "Fantasque Sans Mono 8" theme.font = "Liberation Sans 8"
theme.bg_normal = "#222222" theme.bg_normal = "#222222"
theme.bg_focus = "#535d6c" theme.bg_focus = "#535d6c"

View file

@ -25,8 +25,8 @@ require("awful.hotkeys_popup.keys")
-- another config (This code will only ever execute for the fallback config) -- another config (This code will only ever execute for the fallback config)
if awesome.startup_errors then if awesome.startup_errors then
naughty.notify({ preset = naughty.config.presets.critical, naughty.notify({ preset = naughty.config.presets.critical,
title = "Oops, there were errors during startup!", title = "Oops, there were errors during startup!",
text = awesome.startup_errors }) text = awesome.startup_errors })
end end
-- Handle runtime errors after startup -- Handle runtime errors after startup
@ -38,8 +38,8 @@ do
in_error = true in_error = true
naughty.notify({ preset = naughty.config.presets.critical, naughty.notify({ preset = naughty.config.presets.critical,
title = "Oops, an error happened!", title = "Oops, an error happened!",
text = tostring(err) }) text = tostring(err) })
in_error = false in_error = false
end) end)
end end
@ -53,12 +53,12 @@ beautiful.init(gears.filesystem.get_configuration_dir() .. "mytheme.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 = "alacritty" -- terminal = "alacritty"
terminal = function() terminal = function()
local is_running = os.execute("pgrep alacritty") local is_running = os.execute("pgrep alacritty")
if is_running == nil then if is_running == nil then
return "/usr/sbin/alacritty --socket /run/user/1000/alacritty-main.sock" return "/usr/sbin/alacritty --socket /run/user/1000/alacritty-main.sock"
else else
return "/usr/sbin/alacritty msg --socket /run/user/1000/alacritty-main.sock create-window" return "/usr/sbin/alacritty msg --socket /run/user/1000/alacritty-main.sock create-window"
end end
end end
editor = os.getenv("EDITOR") or "nano" editor = os.getenv("EDITOR") or "nano"
editor_cmd = terminal() .. " -e " .. editor editor_cmd = terminal() .. " -e " .. editor
@ -94,21 +94,21 @@ awful.layout.layouts = {
-- {{{ Menu -- {{{ Menu
-- Create a launcher widget and a main menu -- Create a launcher widget and a main menu
myawesomemenu = { myawesomemenu = {
{ "hotkeys", function() hotkeys_popup.show_help(nil, awful.screen.focused()) end }, { "hotkeys", function() hotkeys_popup.show_help(nil, awful.screen.focused()) end },
{ "manual", terminal() .. " -e man awesome" }, { "manual", terminal() .. " -e man awesome" },
{ "edit config", editor_cmd .. " " .. awesome.conffile }, { "edit config", editor_cmd .. " " .. awesome.conffile },
{ "restart", awesome.restart }, { "restart", awesome.restart },
-- { "quit", function() awesome.quit() end }, -- { "quit", function() awesome.quit() end },
{ "quit", "xfce4-session-logout &" }, { "quit", "xfce4-session-logout &" },
} }
mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon }, mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon },
{ "open terminal", terminal() } { "open terminal", terminal() }
} }
}) })
mylauncher = awful.widget.launcher({ image = beautiful.awesome_icon, mylauncher = awful.widget.launcher({ image = beautiful.awesome_icon,
menu = mymainmenu }) menu = mymainmenu })
-- Menubar configuration -- Menubar configuration
menubar.utils.terminal = terminal() -- Set the terminal for applications that require it menubar.utils.terminal = terminal() -- Set the terminal for applications that require it
@ -123,43 +123,43 @@ mytextclock = wibox.widget.textclock()
-- Create a wibox for each screen and add it -- Create a wibox for each screen and add it
local taglist_buttons = gears.table.join( local taglist_buttons = gears.table.join(
awful.button({ }, 1, function(t) t:view_only() end), awful.button({ }, 1, function(t) t:view_only() end),
awful.button({ modkey }, 1, function(t) awful.button({ modkey }, 1, function(t)
if client.focus then if client.focus then
client.focus:move_to_tag(t) client.focus:move_to_tag(t)
end end
end), end),
awful.button({ }, 3, awful.tag.viewtoggle), awful.button({ }, 3, awful.tag.viewtoggle),
awful.button({ modkey }, 3, function(t) awful.button({ modkey }, 3, function(t)
if client.focus then if client.focus then
client.focus:toggle_tag(t) client.focus:toggle_tag(t)
end end
end), end),
awful.button({ }, 4, function(t) awful.tag.viewnext(t.screen) end), awful.button({ }, 4, function(t) awful.tag.viewnext(t.screen) end),
awful.button({ }, 5, function(t) awful.tag.viewprev(t.screen) end) awful.button({ }, 5, function(t) awful.tag.viewprev(t.screen) end)
) )
local tasklist_buttons = gears.table.join( local tasklist_buttons = gears.table.join(
awful.button({ }, 1, function (c) awful.button({ }, 1, function (c)
if c == client.focus then if c == client.focus then
c.minimized = true c.minimized = true
else else
c:emit_signal( c:emit_signal(
"request::activate", "request::activate",
"tasklist", "tasklist",
{raise = true} {raise = true}
) )
end end
end), end),
awful.button({ }, 3, function() awful.button({ }, 3, function()
awful.menu.client_list({ theme = { width = 250 } }) awful.menu.client_list({ theme = { width = 250 } })
end), end),
awful.button({ }, 4, function () awful.button({ }, 4, function ()
awful.client.focus.byidx(1) awful.client.focus.byidx(1)
end), end),
awful.button({ }, 5, function () awful.button({ }, 5, function ()
awful.client.focus.byidx(-1) awful.client.focus.byidx(-1)
end)) end))
local function set_wallpaper(s) local function set_wallpaper(s)
-- Wallpaper -- Wallpaper
@ -199,45 +199,32 @@ end)
screen.connect_signal("property::geometry", set_wallpaper) screen.connect_signal("property::geometry", set_wallpaper)
local mymem = lain.widget.mem { local mymem = lain.widget.mem {
settings = function() settings = function()
local mem_spacer = "" widget:set_markup(" mem " .. mem_now.perc .. " swp " .. math.floor((mem_now.swapused / mem_now.swap) * 100))
local swp_spacer = "" end
local swp_display = math.floor((mem_now.swapused / mem_now.swap) * 100)
if mem_now.perc < 10 then
mem_spacer = " "
end
if swp_display < 10 then
swp_spacer = " "
end
widget:set_markup(" mem " .. mem_spacer .. mem_now.perc .. " swp " .. swp_spacer .. swp_display .. " ")
end
} }
local mycpu = lain.widget.cpu { local mycpu = lain.widget.cpu {
settings = function() settings = function()
local cpu_spacer = "" widget:set_markup(" cpu " .. cpu_now.usage)
if cpu_now.usage < 10 then
cpu_spacer = " "
end
widget:set_markup(" cpu " .. cpu_spacer .. cpu_now.usage)
end end
} }
local myweather = lain.widget.weather({ local myweather = lain.widget.weather({
APPID = "f6497dd133dd22b541abc8bbe8360f3b", APPID = "f6497dd133dd22b541abc8bbe8360f3b",
lat = 40.651, lat = 40.651,
lon = -73.949, lon = -73.949,
units = 'imperial', units = 'imperial',
notification_text_fun = function (wn) notification_text_fun = function (wn)
local day = os.date("%a %d", wn["dt"]) local day = os.date("%a %d", wn["dt"])
local temp = math.floor(wn["main"]["temp"]) local temp = math.floor(wn["main"]["temp"])
local desc = wn["weather"][1]["description"] local desc = wn["weather"][1]["description"]
return string.format("<b>%s</b>: %s, %d ", day, desc, temp) return string.format("<b>%s</b>: %s, %d ", day, desc, temp)
end, end,
settings = function() settings = function()
units = math.floor(weather_now["main"]["temp"]) units = math.floor(weather_now["main"]["temp"])
widget:set_markup(" " .. units .. " ") widget:set_markup(" " .. units .. " ")
end end
}) })
awful.screen.connect_for_each_screen(function(s) awful.screen.connect_for_each_screen(function(s)
@ -253,10 +240,10 @@ awful.screen.connect_for_each_screen(function(s)
-- We need one layoutbox per screen. -- We need one layoutbox per screen.
s.mylayoutbox = awful.widget.layoutbox(s) s.mylayoutbox = awful.widget.layoutbox(s)
s.mylayoutbox:buttons(gears.table.join( s.mylayoutbox:buttons(gears.table.join(
awful.button({ }, 1, function () awful.layout.inc( 1) end), awful.button({ }, 1, function () awful.layout.inc( 1) end),
awful.button({ }, 3, function () awful.layout.inc(-1) end), awful.button({ }, 3, function () awful.layout.inc(-1) end),
awful.button({ }, 4, function () awful.layout.inc( 1) end), awful.button({ }, 4, function () awful.layout.inc( 1) end),
awful.button({ }, 5, function () awful.layout.inc(-1) end))) awful.button({ }, 5, function () awful.layout.inc(-1) end)))
-- Create a taglist widget -- Create a taglist widget
s.mytaglist = awful.widget.taglist { s.mytaglist = awful.widget.taglist {
screen = s, screen = s,
@ -309,13 +296,13 @@ root.buttons(gears.table.join(
-- {{{ Key bindings -- {{{ Key bindings
globalkeys = gears.table.join( globalkeys = gears.table.join(
awful.key({ modkey, }, "s", hotkeys_popup.show_help, awful.key({ modkey, }, "s", hotkeys_popup.show_help,
{description="show help", 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,
{description = "view next", group = "tag"}), {description = "view next", group = "tag"}),
awful.key({ modkey, }, "Escape", awful.tag.history.restore, awful.key({ modkey, }, "Escape", awful.tag.history.restore,
{description = "go back", group = "tag"}), {description = "go back", group = "tag"}),
awful.key({ modkey, }, "j", awful.key({ modkey, }, "j",
function () function ()
@ -330,19 +317,19 @@ globalkeys = gears.table.join(
{description = "focus previous by index", group = "client"} {description = "focus previous by index", group = "client"}
), ),
awful.key({ modkey, }, "w", function () mymainmenu:show() end, awful.key({ modkey, }, "w", function () mymainmenu:show() end,
{description = "show main menu", 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,
{description = "swap with next client by index", group = "client"}), {description = "swap with next client by index", group = "client"}),
awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end, awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end,
{description = "swap with previous client by index", group = "client"}), {description = "swap with previous client by index", group = "client"}),
awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end, awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end,
{description = "focus the next screen", group = "screen"}), {description = "focus the next screen", group = "screen"}),
awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end, awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end,
{description = "focus the previous screen", group = "screen"}), {description = "focus the previous screen", group = "screen"}),
awful.key({ modkey, }, "u", awful.client.urgent.jumpto, awful.key({ modkey, }, "u", awful.client.urgent.jumpto,
{description = "jump to urgent client", group = "client"}), {description = "jump to urgent client", group = "client"}),
awful.key({ modkey, }, "Tab", awful.key({ modkey, }, "Tab",
function () function ()
awful.client.focus.history.previous() awful.client.focus.history.previous()
@ -354,58 +341,58 @@ 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 = "open a terminal", group = "launcher"}), {description = "open a terminal", group = "launcher"}),
awful.key({ modkey, "Control" }, "r", awesome.restart, awful.key({ modkey, "Control" }, "r", awesome.restart,
{description = "reload awesome", group = "awesome"}), {description = "reload awesome", group = "awesome"}),
awful.key({ modkey, "Shift" }, "q", awesome.quit, awful.key({ modkey, "Shift" }, "q", awesome.quit,
{description = "quit 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"}),
awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end, awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end,
{description = "decrease master width factor", group = "layout"}), {description = "decrease master width factor", group = "layout"}),
awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1, nil, true) end, awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1, nil, true) end,
{description = "increase the number of master clients", group = "layout"}), {description = "increase the number of master clients", group = "layout"}),
awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1, nil, true) end, awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1, nil, true) end,
{description = "decrease the number of master clients", group = "layout"}), {description = "decrease the number of master clients", group = "layout"}),
awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1, nil, true) end, awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1, nil, true) end,
{description = "increase the number of columns", group = "layout"}), {description = "increase the number of columns", group = "layout"}),
awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1, nil, true) end, awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1, nil, true) end,
{description = "decrease the number of columns", group = "layout"}), {description = "decrease the number of columns", group = "layout"}),
awful.key({ modkey, }, "space", function () awful.layout.inc( 1) end, awful.key({ modkey, }, "space", function () awful.layout.inc( 1) end,
{description = "select next", group = "layout"}), {description = "select next", group = "layout"}),
awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(-1) end, awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(-1) end,
{description = "select previous", group = "layout"}), {description = "select previous", group = "layout"}),
awful.key({ modkey, "Control" }, "n", awful.key({ modkey, "Control" }, "n",
function () function ()
local c = awful.client.restore() local c = awful.client.restore()
-- Focus restored client -- Focus restored client
if c then if c then
c:emit_signal( c:emit_signal(
"request::activate", "key.unminimize", {raise = true} "request::activate", "key.unminimize", {raise = true}
) )
end end
end, end,
{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 ()
awful.prompt.run { awful.prompt.run {
prompt = "Run Lua code: ", prompt = "Run Lua code: ",
textbox = awful.screen.focused().mypromptbox.widget, textbox = awful.screen.focused().mypromptbox.widget,
exe_callback = awful.util.eval, exe_callback = awful.util.eval,
history_path = awful.util.get_cache_dir() .. "/history_eval" history_path = awful.util.get_cache_dir() .. "/history_eval"
} }
end, end,
{description = "lua execute prompt", group = "awesome"}), {description = "lua execute prompt", group = "awesome"}),
-- Menubar -- Menubar
awful.key({ modkey }, "p", function() os.execute("dmenu_run") end, awful.key({ modkey }, "p", function() os.execute("dmenu_run") end,
{description = "show the menubar", group = "launcher"}) {description = "show the menubar", group = "launcher"})
) )
clientkeys = gears.table.join( clientkeys = gears.table.join(
@ -416,15 +403,15 @@ clientkeys = gears.table.join(
end, end,
{description = "toggle fullscreen", group = "client"}), {description = "toggle fullscreen", group = "client"}),
awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end, awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end,
{description = "close", group = "client"}), {description = "close", group = "client"}),
awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle , awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle ,
{description = "toggle floating", group = "client"}), {description = "toggle floating", group = "client"}),
awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end, awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end,
{description = "move to master", group = "client"}), {description = "move to master", group = "client"}),
awful.key({ modkey, }, "o", function (c) c:move_to_screen() end, awful.key({ modkey, }, "o", function (c) c:move_to_screen() end,
{description = "move to screen", group = "client"}), {description = "move to screen", group = "client"}),
awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end, awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end,
{description = "toggle keep on top", group = "client"}), {description = "toggle keep on top", group = "client"}),
awful.key({ modkey, }, "n", awful.key({ modkey, }, "n",
function (c) function (c)
-- The client currently has the input focus, so it cannot be -- The client currently has the input focus, so it cannot be
@ -459,46 +446,46 @@ for i = 1, 9 do
globalkeys = gears.table.join(globalkeys, globalkeys = gears.table.join(globalkeys,
-- View tag only. -- View tag only.
awful.key({ modkey }, "#" .. i + 9, awful.key({ modkey }, "#" .. i + 9,
function () function ()
local screen = awful.screen.focused() local screen = awful.screen.focused()
local tag = screen.tags[i] local tag = screen.tags[i]
if tag then if tag then
tag:view_only() tag:view_only()
end end
end, end,
{description = "view tag #"..i, group = "tag"}), {description = "view tag #"..i, group = "tag"}),
-- Toggle tag display. -- Toggle tag display.
awful.key({ modkey, "Control" }, "#" .. i + 9, awful.key({ modkey, "Control" }, "#" .. i + 9,
function () function ()
local screen = awful.screen.focused() local screen = awful.screen.focused()
local tag = screen.tags[i] local tag = screen.tags[i]
if tag then if tag then
awful.tag.viewtoggle(tag) awful.tag.viewtoggle(tag)
end end
end, end,
{description = "toggle tag #" .. i, group = "tag"}), {description = "toggle tag #" .. i, group = "tag"}),
-- Move client to tag. -- Move client to tag.
awful.key({ modkey, "Shift" }, "#" .. i + 9, awful.key({ modkey, "Shift" }, "#" .. i + 9,
function () function ()
if client.focus then if client.focus then
local tag = client.focus.screen.tags[i] local tag = client.focus.screen.tags[i]
if tag then if tag then
client.focus:move_to_tag(tag) client.focus:move_to_tag(tag)
end end
end end
end, end,
{description = "move focused client to tag #"..i, group = "tag"}), {description = "move focused client to tag #"..i, group = "tag"}),
-- Toggle tag on focused client. -- Toggle tag on focused client.
awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9, awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9,
function () function ()
if client.focus then if client.focus then
local tag = client.focus.screen.tags[i] local tag = client.focus.screen.tags[i]
if tag then if tag then
client.focus:toggle_tag(tag) client.focus:toggle_tag(tag)
end end
end end
end, end,
{description = "toggle focused client on tag #" .. i, group = "tag"}) {description = "toggle focused client on tag #" .. i, group = "tag"})
) )
end end
@ -525,51 +512,51 @@ root.keys(globalkeys)
awful.rules.rules = { awful.rules.rules = {
-- All clients will match this rule. -- All clients will match this rule.
{ rule = { }, { rule = { },
properties = { border_width = beautiful.border_width, properties = { border_width = beautiful.border_width,
border_color = beautiful.border_normal, border_color = beautiful.border_normal,
focus = awful.client.focus.filter, focus = awful.client.focus.filter,
raise = true, raise = true,
keys = clientkeys, keys = clientkeys,
buttons = clientbuttons, buttons = clientbuttons,
screen = awful.screen.preferred, screen = awful.screen.preferred,
placement = awful.placement.no_overlap+awful.placement.no_offscreen placement = awful.placement.no_overlap+awful.placement.no_offscreen
} }
}, },
-- Floating clients. -- Floating clients.
{ rule_any = { { rule_any = {
instance = { instance = {
"DTA", -- Firefox addon DownThemAll. "DTA", -- Firefox addon DownThemAll.
"copyq", -- Includes session name in class. "copyq", -- Includes session name in class.
"pinentry", "pinentry",
}, },
class = { class = {
"Arandr", "Arandr",
"Blueman-manager", "Blueman-manager",
"Gpick", "Gpick",
"Kruler", "Kruler",
"MessageWin", -- kalarm. "MessageWin", -- kalarm.
"Sxiv", "Sxiv",
"Tor Browser", -- Needs a fixed window size to avoid fingerprinting by screen size. "Tor Browser", -- Needs a fixed window size to avoid fingerprinting by screen size.
"Wpa_gui", "Wpa_gui",
"veromix", "veromix",
"xtightvncviewer"}, "xtightvncviewer"},
-- Note that the name property shown in xprop might be set slightly after creation of the client -- Note that the name property shown in xprop might be set slightly after creation of the client
-- and the name shown there might not match defined rules here. -- and the name shown there might not match defined rules here.
name = { name = {
"Event Tester", -- xev. "Event Tester", -- xev.
}, },
role = { role = {
"AlarmWindow", -- Thunderbird's calendar. "AlarmWindow", -- Thunderbird's calendar.
"ConfigManager", -- Thunderbird's about:config. "ConfigManager", -- Thunderbird's about:config.
"pop-up", -- e.g. Google Chrome's (detached) Developer Tools. "pop-up", -- e.g. Google Chrome's (detached) Developer Tools.
} }
}, properties = { floating = true }}, }, properties = { floating = true }},
-- Add titlebars to normal clients and dialogs -- Add titlebars to normal clients and dialogs
{ rule_any = {type = { "normal", "dialog" } { rule_any = {type = { "normal", "dialog" }
}, properties = { titlebars_enabled = true } }, properties = { titlebars_enabled = true }
}, },
-- Set Firefox to always map on the tag named "2" on screen 1. -- Set Firefox to always map on the tag named "2" on screen 1.
@ -590,8 +577,8 @@ client.connect_signal("manage", function (c)
-- if not awesome.startup then awful.client.setslave(c) end -- if not awesome.startup then awful.client.setslave(c) end
if awesome.startup if awesome.startup
and not c.size_hints.user_position and not c.size_hints.user_position
and not c.size_hints.program_position then and not c.size_hints.program_position then
-- Prevent clients from being unreachable after screen count changes. -- Prevent clients from being unreachable after screen count changes.
awful.placement.no_offscreen(c) awful.placement.no_offscreen(c)
end end

View file

@ -4,13 +4,15 @@
# #
# This script sends a canned email response to those who've errone- # This script sends a canned email response to those who've errone-
# ously emailed me at <amcooper@gmail.com>. Once I've manually # ously emailed me at <amcooper@gmail.com>. Once I've manually
# tagged those emails `misdirected`, it iterates over those emails and # moved those emails into the `misdirected` folder, it iterates
# responds. # over those emails and responds.
set -euo pipefail set -euo pipefail
if [[ -z "$(notmuch search tag:misdirected)" ]] ; then MISDIRECTED_DIR=/home/adam/Maildir/misdirected
echo "[autoreply.sh] Currently no emails are tagged 'misdirected'. Exiting..."
if [[ -z "$(ls -A "$MISDIRECTED_DIR/cur")" ]] && [[ -z "$(ls -A "$MISDIRECTED_DIR/new")" ]]; then
echo "[autoreply.sh] The misdirected folders are currently empty. Exiting..."
exit 1 exit 1
fi fi
@ -20,24 +22,20 @@ while IFS= read -r -d '' file ; do
echo "[loop] Preparing the email..." echo "[loop] Preparing the email..."
# Make a temporary file # Make a temporary file
temporary_file=$(mktemp /tmp/autoreply-XXXXX) temporary_file=$(mktemp /tmp/autoreplyXXXXX)
echo "[debug] Temporary file: $temporary_file" # debug
# Pull sender (i.e. recipient of my email), subject, and date from email # Pull sender (i.e. recipient of my email) and subject from email
recipient="$(perl -lane 'print if /^From:/' "$file" | cut -d' ' -f2-)" ### "Frantz Fanon <ffanon@riseup.net>" recipient="$(perl -lane 'print if /^From:/' "$file" | cut -d' ' -f2-)" ### "Frantz Fanon <ffanon@riseup.net>"
subject="Re: $(perl -lane 'print if /^Subject:/' "$file" | cut -d' ' -f2-)" ### "Re: Lorem ipsum baby" subject="Re: $(perl -lane 'print if /^Subject:/' "$file" | cut -d' ' -f2-)" ### "Re: Lorem ipsum baby"
date="$(perl -lane 'print if /^Date:/' "$file" | cut -d' ' -f2-)"
# Copy canned message to temporary file # Copy canned message to temporary file
printf "To: $recipient\nFrom: adam@theadamcooper.com\nCc: amcooper@gmail.com\nDate: $(date +'%a, %d %b %Y %R %z')\nSubject: $subject\n\n" > "$temporary_file" cp /home/adam/dotfiles/arch/bin/autoreply/misdirected_email_autoreply.txt "$temporary_file"
cat /home/adam/dotfiles/bin/autoreply/misdirected_email_autoreply.txt >> "$temporary_file"
printf "\n\nOn $date, $recipient wrote:\n" >> "$temporary_file"
# Append email body to temporary file # Append email body to temporary file
discard="0" discard="0"
while IFS= read -r line ; do while IFS= read -r line ; do
if [[ $discard = "1" ]]; then if [[ $discard = "1" ]]; then
echo "> $line" >> "$temporary_file" echo "$line" >> "$temporary_file"
else else
if [[ -z "$line" ]]; then if [[ -z "$line" ]]; then
discard="1" discard="1"
@ -46,16 +44,15 @@ while IFS= read -r -d '' file ; do
done < "$file" done < "$file"
# Send the email! # Send the email!
printf "[debug] Outgoing email:\n$(cat "$temporary_file")\n" # debug
echo "[loop] Sending reply to $recipient ... " echo "[loop] Sending reply to $recipient ... "
cat "$temporary_file" | msmtp --read-envelope-from --read-recipients neomutt -s "$subject" -c amcooper@gmail.com "$recipient" < "$temporary_file"
cat "$temporary_file" | notmuch insert --folder=Sent -inbox -unread +sent +misdirected-reply
# Move the misdirected email into `INBOX/cur`
# Remove the misdirected tag echo "[loop] Moving the emails..."
notmuch tag -misdirected -- tag:misdirected mv "$file" /home/adam/Maildir/INBOX/cur
echo "[loop] Done." echo "[loop] Done."
done < <(notmuch search --output=files --format=text0 tag:misdirected) done < <(find "$MISDIRECTED_DIR" -path "$MISDIRECTED_DIR/tmp" -prune -o -type f -print0)
echo "[autoreply.sh] All done!" echo "[autoreply.sh] All done!"

View file

@ -4,6 +4,6 @@
# #
# Convenience script to start up my usual TUIs # Convenience script to start up my usual TUIs
alacritty msg create-window --title joplin --command /home/adam/.config/nvm/versions/node/v20.11.1/bin/joplin alacritty msg create-window --title joplin --command $NVM_BIN/joplin
alacritty msg create-window --title newsboat --command newsboat alacritty msg create-window --title newsboat --command newsboat
alacritty msg create-window --title aerc --command aerc alacritty msg create-window --title aerc --command aerc

View file

@ -1,2 +0,0 @@
#! /bin/bash
QT_SCALE_FACTOR=0.8 /usr/bin/zoom &

View file

@ -107,7 +107,6 @@ require("lazy").setup({
}, },
"nvim-lualine/lualine.nvim", "nvim-lualine/lualine.nvim",
"nvim-tree/nvim-web-devicons", "nvim-tree/nvim-web-devicons",
{ "echasnovski/mini.nvim", version = false },
{ "nvim-treesitter/nvim-treesitter", build = ":TSUpdate" }, { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate" },
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
{ {
@ -129,19 +128,10 @@ require("lazy").setup({
vim.o.timeoutlen = 300 -- 0? 500? 300? vim.o.timeoutlen = 300 -- 0? 500? 300?
end, end,
opts = { opts = {
win = { window = {
border = "single", border = "single",
}, },
}, },
keys = {
{
"<leader>?",
function()
require("which-key").show({ global = false })
end,
desc = "Buffer Local Keymaps (which-key)",
},
},
}, },
{ {
"ray-x/lsp_signature.nvim", "ray-x/lsp_signature.nvim",
@ -406,17 +396,6 @@ require("lazy").setup({
{ "kovisoft/paredit" }, { "kovisoft/paredit" },
--{ "monkoose/parsley", event = "VeryLazy" }, --{ "monkoose/parsley", event = "VeryLazy" },
{ "monkoose/nvlime", ft = { "lisp" }, dependencies = { "monkoose/parsley" } }, { "monkoose/nvlime", ft = { "lisp" }, dependencies = { "monkoose/parsley" } },
{
'MeanderingProgrammer/markdown.nvim',
-- name = 'render-markdown', -- Only needed if you have another plugin named markdown.nvim
dependencies = {
'nvim-treesitter/nvim-treesitter', -- Mandatory
'nvim-tree/nvim-web-devicons', -- Optional but recommended
},
config = function()
require('render-markdown').setup({})
end,
},
}) })
--[[ mason --[[ mason
@ -789,8 +768,6 @@ require('nvim-treesitter.configs').setup({
vim.treesitter.language.register("html", "handlebars") vim.treesitter.language.register("html", "handlebars")
require('mini.icons').setup()
-- Tweak GitSigns blame color -- Tweak GitSigns blame color
-- This differentiates the cursorline from the git blame text -- This differentiates the cursorline from the git blame text
vim.cmd("highlight GitSignsCurrentLineBlame gui=bold guifg=#339944") vim.cmd("highlight GitSignsCurrentLineBlame gui=bold guifg=#339944")

View file

@ -28,6 +28,7 @@ color listfocus_unread color238 color47 standout
color info color141 color236 color info color141 color236
confirm-exit yes confirm-exit yes
define-filter "nitter feeds" "tags !# \"nitter_personal\" and tags !# \"nitter_institutional\" and tags !# \"nitter_noise\""
feed-sort-order firsttag feed-sort-order firsttag
# Dracula highlights # Dracula highlights
@ -43,7 +44,7 @@ highlight article ":.*\\(image\\)$" blue default
highlight article ":.*\\(embedded flash\\)$" magenta default highlight article ":.*\\(embedded flash\\)$" magenta default
keep-articles-days 45 keep-articles-days 45
macro p set browser "mpv --player-operation-mode=pseudo-gui -- %u &"; one; set browser w3m -- "Play media file in mpv" macro p set browser "mpv --player-operation-mode=pseudo-gui -- %u &"; one; set browser w3m
max-items 4096 max-items 4096
notify-program "/usr/bin/notify-send" notify-program "/usr/bin/notify-send"
urls-source "freshrss" urls-source "freshrss"

View file

@ -1 +0,0 @@
https://s.france24.com/media/display/1b3b9962-45d6-11ef-856d-005056a90284/w:1024/p:16x9/2024-07-12T013153Z_1056985909_RC26T8AZ5PZ7_RTRMADP_3_NATO-SUMMIT-BIDEN.JPG "/home/adam/2024-07-12T013153Z_1056985909_RC26T8AZ5PZ7_RTRMADP_3_NATO-SUMMIT-BIDEN.JPG"

View file

@ -1,4 +1,7 @@
"query:miscellany Articles:tags # \"miscellany\"" "query:miscellany Articles:tags # \"miscellany\""
"query:nitter_personal Articles:tags # \"nitter_personal\""
"query:nitter_institutional Articles:tags # \"nitter_institutional\""
"query:nitter_noise Articles:tags # \"nitter_noise\""
"query:nuggets Articles:tags # \"nuggets\"" "query:nuggets Articles:tags # \"nuggets\""
"query:podcasts Articles:tags # \"podcasts\"" "query:podcasts Articles:tags # \"podcasts\""
"query:release_notes Articles:tags # \"release_notes\"" "query:release_notes Articles:tags # \"release_notes\""

View file

@ -2,7 +2,6 @@
export XDG_CONFIG_HOME="$HOME/.config" export XDG_CONFIG_HOME="$HOME/.config"
export XDG_DATA_HOME="$HOME/.config/local/share" export XDG_DATA_HOME="$HOME/.config/local/share"
export XDG_CACHE_HOME="$HOME/.config/cache" export XDG_CACHE_HOME="$HOME/.config/cache"
export XDG_STATE_HOME="$HOME/.config/local/state"
export ZDOTDIR="$XDG_CONFIG_HOME/zsh" export ZDOTDIR="$XDG_CONFIG_HOME/zsh"
export HISTSIZE=9998 export HISTSIZE=9998

View file

@ -140,9 +140,6 @@ source /home/adam/.config/broot/launcher/bash/br
# tea # tea
PROG=tea _CLI_ZSH_AUTOCOMPLETE_HACK=1 source "/home/adam/.config/tea/autocomplete.zsh" PROG=tea _CLI_ZSH_AUTOCOMPLETE_HACK=1 source "/home/adam/.config/tea/autocomplete.zsh"
# leetcode
eval "$(leetcode completions)"
# ripgrep-all # ripgrep-all
rga-fzf() { rga-fzf() {
RG_PREFIX="rga --files-with-matches" RG_PREFIX="rga --files-with-matches"