Compare commits

..

No commits in common. "main" and "neovim-welcome" have entirely different histories.

15 changed files with 511 additions and 1266 deletions

View file

@ -1,16 +1,5 @@
### dotfiles
These are the messy dotfiles for my Arch Linux system. They're useful for
- restoring my system after a catastrophe
- almost nothing else :)
#### dracula/vim
I am using my own fork of dracula/vim. Specifically, I changed the color of the virtual text so it doesn't conflict with the cursor line. When updates in upstream come through, we run the following:
- `git switch master`
- `git pull upstream`
- `git switch adamc-main`
- `git merge master`
- `git add . && git commit`
- `git push origin`
Please feel free to contact me with any questions; I'll be glad to help.

View file

@ -7,8 +7,10 @@ run() {
fi
}
/usr/sbin/alacritty --socket "$XDG_RUNTIME_DIR/alacritty-main.sock" --title awesome-startup &
/usr/sbin/alacritty --title bottom --option font.size=6.5 --command btm --battery &
# Currently not working
# run "(pgrep alacritty && alacritty msg create-window --title bottom -e btm --battery || alacritty --title bottom -e btm --battery)"
/usr/sbin/alacritty --title bottom --command btm --battery &
/usr/sbin/alacritty --title awesome-startup &
run "cbatticon"
run "blueman-applet"
@ -19,3 +21,4 @@ run "xscreensaver -no-splash"
run "sleep 4"
run "wmctrl -r bottom -t 8"
run "keepassxc"

View file

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

View file

@ -14,7 +14,6 @@ local beautiful = require("beautiful")
local naughty = require("naughty")
local menubar = require("menubar")
local lain = require("lain")
-- local ruled = require("ruled")
local hotkeys_popup = require("awful.hotkeys_popup")
-- Enable hotkeys help widget for VIM and other apps
-- when client with a matching name is opened:
@ -25,8 +24,8 @@ require("awful.hotkeys_popup.keys")
-- 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 })
title = "Oops, there were errors during startup!",
text = awesome.startup_errors })
end
-- Handle runtime errors after startup
@ -38,8 +37,8 @@ do
in_error = true
naughty.notify({ preset = naughty.config.presets.critical,
title = "Oops, an error happened!",
text = tostring(err) })
title = "Oops, an error happened!",
text = tostring(err) })
in_error = false
end)
end
@ -53,12 +52,12 @@ beautiful.init(gears.filesystem.get_configuration_dir() .. "mytheme.lua")
-- This is used later as the default terminal and editor to run.
-- terminal = "alacritty"
terminal = function()
local is_running = os.execute("pgrep alacritty")
if is_running == nil then
return "/usr/sbin/alacritty --socket /run/user/1000/alacritty-main.sock"
else
return "/usr/sbin/alacritty msg --socket /run/user/1000/alacritty-main.sock create-window"
end
local is_running = os.execute("pgrep alacritty")
if is_running == nil then
return "/usr/sbin/alacritty"
else
return "/usr/sbin/alacritty msg create-window"
end
end
editor = os.getenv("EDITOR") or "nano"
editor_cmd = terminal() .. " -e " .. editor
@ -94,21 +93,21 @@ awful.layout.layouts = {
-- {{{ Menu
-- Create a launcher widget and a main menu
myawesomemenu = {
{ "hotkeys", function() hotkeys_popup.show_help(nil, awful.screen.focused()) end },
{ "manual", terminal() .. " -e man awesome" },
{ "edit config", editor_cmd .. " " .. awesome.conffile },
{ "restart", awesome.restart },
-- { "quit", function() awesome.quit() end },
{ "quit", "xfce4-session-logout &" },
{ "hotkeys", function() hotkeys_popup.show_help(nil, awful.screen.focused()) end },
{ "manual", terminal() .. " -e man awesome" },
{ "edit config", editor_cmd .. " " .. awesome.conffile },
{ "restart", awesome.restart },
-- { "quit", function() awesome.quit() end },
{ "quit", "xfce4-session-logout &" },
}
mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon },
{ "open terminal", terminal() }
}
})
{ "open terminal", terminal() }
}
})
mylauncher = awful.widget.launcher({ image = beautiful.awesome_icon,
menu = mymainmenu })
menu = mymainmenu })
-- Menubar configuration
menubar.utils.terminal = terminal() -- Set the terminal for applications that require it
@ -123,49 +122,49 @@ mytextclock = wibox.widget.textclock()
-- Create a wibox for each screen and add it
local taglist_buttons = gears.table.join(
awful.button({ }, 1, function(t) t:view_only() end),
awful.button({ modkey }, 1, function(t)
if client.focus then
client.focus:move_to_tag(t)
end
end),
awful.button({ }, 3, awful.tag.viewtoggle),
awful.button({ modkey }, 3, function(t)
if client.focus then
client.focus:toggle_tag(t)
end
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({ }, 1, function(t) t:view_only() end),
awful.button({ modkey }, 1, function(t)
if client.focus then
client.focus:move_to_tag(t)
end
end),
awful.button({ }, 3, awful.tag.viewtoggle),
awful.button({ modkey }, 3, function(t)
if client.focus then
client.focus:toggle_tag(t)
end
end),
awful.button({ }, 4, function(t) awful.tag.viewnext(t.screen) end),
awful.button({ }, 5, function(t) awful.tag.viewprev(t.screen) end)
)
local tasklist_buttons = gears.table.join(
awful.button({ }, 1, function (c)
if c == client.focus then
c.minimized = true
else
c:emit_signal(
"request::activate",
"tasklist",
{raise = true}
)
end
end),
awful.button({ }, 3, function()
awful.menu.client_list({ theme = { width = 250 } })
end),
awful.button({ }, 4, function ()
awful.client.focus.byidx(1)
end),
awful.button({ }, 5, function ()
awful.client.focus.byidx(-1)
end))
awful.button({ }, 1, function (c)
if c == client.focus then
c.minimized = true
else
c:emit_signal(
"request::activate",
"tasklist",
{raise = true}
)
end
end),
awful.button({ }, 3, function()
awful.menu.client_list({ theme = { width = 250 } })
end),
awful.button({ }, 4, function ()
awful.client.focus.byidx(1)
end),
awful.button({ }, 5, function ()
awful.client.focus.byidx(-1)
end))
local function set_wallpaper(s)
-- Wallpaper
if beautiful.wallpaper then
-- local wallpaper = beautiful.wallpaper
local wallpaper = "/home/adam/Pictures/wallpapers/shared/montauk-light-01.jpg"
local wallpaper = "/home/adam/Pictures/wallpapers/shared/cemetery_sunray.jpeg"
-- If wallpaper is a function, call it with the screen
if type(wallpaper) == "function" then
wallpaper = wallpaper(s)
@ -174,70 +173,36 @@ local function set_wallpaper(s)
end
end
-- Notifications
--[[
ruled.notification.connect_signal("request::rules", function()
-- Add a red background for urgent notifications.
ruled.notification.append_rule {
rule = { urgency = "critical" },
properties = { bg = "#ff0000", fg = "#32cd32", timeout = 0 }
}
-- Or green background for normal ones.
ruled.notification.append_rule {
rule = { urgency = "normal" },
properties = { bg = "#32cd32", fg = "#800080"}
}
ruled.notification.append_rule {
rule = { urgency = "low" },
properties = { bg = "#bbccff", fg = "#191970"}
}
end)
--]]
-- Re-set wallpaper when a screen's geometry changes (e.g. different resolution)
screen.connect_signal("property::geometry", set_wallpaper)
local mymem = lain.widget.mem {
settings = function()
local mem_spacer = ""
local swp_spacer = ""
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
settings = function()
widget:set_markup(" mem " .. mem_now.perc .. " swp " .. math.floor((mem_now.swapused / mem_now.swap) * 100))
end
}
local mycpu = lain.widget.cpu {
settings = function()
local cpu_spacer = ""
if cpu_now.usage < 10 then
cpu_spacer = " "
end
widget:set_markup(" cpu " .. cpu_spacer .. cpu_now.usage)
widget:set_markup(" cpu " .. cpu_now.usage)
end
}
local myweather = lain.widget.weather({
APPID = "f6497dd133dd22b541abc8bbe8360f3b",
lat = 40.651,
lon = -73.949,
units = 'imperial',
notification_text_fun = function (wn)
local day = os.date("%a %d", wn["dt"])
local temp = math.floor(wn["main"]["temp"])
local desc = wn["weather"][1]["description"]
return string.format("<b>%s</b>: %s, %d ", day, desc, temp)
end,
settings = function()
units = math.floor(weather_now["main"]["temp"])
widget:set_markup(" " .. units .. " ")
end
APPID = "f6497dd133dd22b541abc8bbe8360f3b",
lat = 40.651,
lon = -73.949,
units = 'imperial',
notification_text_fun = function (wn)
local day = os.date("%a %d", wn["dt"])
local temp = math.floor(wn["main"]["temp"])
local desc = wn["weather"][1]["description"]
return string.format("<b>%s</b>: %s, %d ", day, desc, temp)
end,
settings = function()
units = math.floor(weather_now["main"]["temp"])
widget:set_markup(" " .. units .. " ")
end
})
awful.screen.connect_for_each_screen(function(s)
@ -253,10 +218,10 @@ awful.screen.connect_for_each_screen(function(s)
-- We need one layoutbox per screen.
s.mylayoutbox = awful.widget.layoutbox(s)
s.mylayoutbox:buttons(gears.table.join(
awful.button({ }, 1, 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({ }, 5, 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({ }, 4, function () awful.layout.inc( 1) end),
awful.button({ }, 5, function () awful.layout.inc(-1) end)))
-- Create a taglist widget
s.mytaglist = awful.widget.taglist {
screen = s,
@ -309,13 +274,13 @@ root.buttons(gears.table.join(
-- {{{ Key bindings
globalkeys = gears.table.join(
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,
{description = "view previous", group = "tag"}),
{description = "view previous", group = "tag"}),
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,
{description = "go back", group = "tag"}),
{description = "go back", group = "tag"}),
awful.key({ modkey, }, "j",
function ()
@ -330,19 +295,19 @@ globalkeys = gears.table.join(
{description = "focus previous by index", group = "client"}
),
awful.key({ modkey, }, "w", function () mymainmenu:show() end,
{description = "show main menu", group = "awesome"}),
{description = "show main menu", group = "awesome"}),
-- Layout manipulation
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,
{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,
{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,
{description = "focus the previous screen", group = "screen"}),
{description = "focus the previous screen", group = "screen"}),
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",
function ()
awful.client.focus.history.previous()
@ -354,58 +319,58 @@ globalkeys = gears.table.join(
-- Standard program
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,
{description = "reload awesome", group = "awesome"}),
{description = "reload awesome", group = "awesome"}),
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,
{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,
{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,
{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,
{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,
{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,
{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,
{description = "select next", group = "layout"}),
{description = "select next", group = "layout"}),
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",
function ()
local c = awful.client.restore()
-- Focus restored client
if c then
c:emit_signal(
"request::activate", "key.unminimize", {raise = true}
)
end
end,
{description = "restore minimized", group = "client"}),
function ()
local c = awful.client.restore()
-- Focus restored client
if c then
c:emit_signal(
"request::activate", "key.unminimize", {raise = true}
)
end
end,
{description = "restore minimized", group = "client"}),
-- Prompt
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",
function ()
awful.prompt.run {
prompt = "Run Lua code: ",
textbox = awful.screen.focused().mypromptbox.widget,
exe_callback = awful.util.eval,
history_path = awful.util.get_cache_dir() .. "/history_eval"
}
end,
{description = "lua execute prompt", group = "awesome"}),
function ()
awful.prompt.run {
prompt = "Run Lua code: ",
textbox = awful.screen.focused().mypromptbox.widget,
exe_callback = awful.util.eval,
history_path = awful.util.get_cache_dir() .. "/history_eval"
}
end,
{description = "lua execute prompt", group = "awesome"}),
-- Menubar
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(
@ -416,15 +381,15 @@ clientkeys = gears.table.join(
end,
{description = "toggle fullscreen", group = "client"}),
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 ,
{description = "toggle floating", group = "client"}),
{description = "toggle floating", group = "client"}),
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,
{description = "move to screen", group = "client"}),
{description = "move to screen", group = "client"}),
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",
function (c)
-- The client currently has the input focus, so it cannot be
@ -459,46 +424,46 @@ for i = 1, 9 do
globalkeys = gears.table.join(globalkeys,
-- View tag only.
awful.key({ modkey }, "#" .. i + 9,
function ()
local screen = awful.screen.focused()
local tag = screen.tags[i]
if tag then
tag:view_only()
end
end,
{description = "view tag #"..i, group = "tag"}),
function ()
local screen = awful.screen.focused()
local tag = screen.tags[i]
if tag then
tag:view_only()
end
end,
{description = "view tag #"..i, group = "tag"}),
-- Toggle tag display.
awful.key({ modkey, "Control" }, "#" .. i + 9,
function ()
local screen = awful.screen.focused()
local tag = screen.tags[i]
if tag then
awful.tag.viewtoggle(tag)
end
end,
{description = "toggle tag #" .. i, group = "tag"}),
function ()
local screen = awful.screen.focused()
local tag = screen.tags[i]
if tag then
awful.tag.viewtoggle(tag)
end
end,
{description = "toggle tag #" .. i, group = "tag"}),
-- Move client to tag.
awful.key({ modkey, "Shift" }, "#" .. i + 9,
function ()
if client.focus then
local tag = client.focus.screen.tags[i]
if tag then
client.focus:move_to_tag(tag)
end
end
end,
{description = "move focused client to tag #"..i, group = "tag"}),
function ()
if client.focus then
local tag = client.focus.screen.tags[i]
if tag then
client.focus:move_to_tag(tag)
end
end
end,
{description = "move focused client to tag #"..i, group = "tag"}),
-- Toggle tag on focused client.
awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9,
function ()
if client.focus then
local tag = client.focus.screen.tags[i]
if tag then
client.focus:toggle_tag(tag)
end
end
end,
{description = "toggle focused client on tag #" .. i, group = "tag"})
function ()
if client.focus then
local tag = client.focus.screen.tags[i]
if tag then
client.focus:toggle_tag(tag)
end
end
end,
{description = "toggle focused client on tag #" .. i, group = "tag"})
)
end
@ -525,51 +490,51 @@ root.keys(globalkeys)
awful.rules.rules = {
-- All clients will match this rule.
{ rule = { },
properties = { border_width = beautiful.border_width,
border_color = beautiful.border_normal,
focus = awful.client.focus.filter,
raise = true,
keys = clientkeys,
buttons = clientbuttons,
screen = awful.screen.preferred,
placement = awful.placement.no_overlap+awful.placement.no_offscreen
}
properties = { border_width = beautiful.border_width,
border_color = beautiful.border_normal,
focus = awful.client.focus.filter,
raise = true,
keys = clientkeys,
buttons = clientbuttons,
screen = awful.screen.preferred,
placement = awful.placement.no_overlap+awful.placement.no_offscreen
}
},
-- Floating clients.
{ rule_any = {
instance = {
"DTA", -- Firefox addon DownThemAll.
"copyq", -- Includes session name in class.
"pinentry",
"DTA", -- Firefox addon DownThemAll.
"copyq", -- Includes session name in class.
"pinentry",
},
class = {
"Arandr",
"Blueman-manager",
"Gpick",
"Kruler",
"MessageWin", -- kalarm.
"Sxiv",
"Tor Browser", -- Needs a fixed window size to avoid fingerprinting by screen size.
"Wpa_gui",
"veromix",
"xtightvncviewer"},
"Arandr",
"Blueman-manager",
"Gpick",
"Kruler",
"MessageWin", -- kalarm.
"Sxiv",
"Tor Browser", -- Needs a fixed window size to avoid fingerprinting by screen size.
"Wpa_gui",
"veromix",
"xtightvncviewer"},
-- 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.
name = {
"Event Tester", -- xev.
"Event Tester", -- xev.
},
role = {
"AlarmWindow", -- Thunderbird's calendar.
"ConfigManager", -- Thunderbird's about:config.
"pop-up", -- e.g. Google Chrome's (detached) Developer Tools.
"AlarmWindow", -- Thunderbird's calendar.
"ConfigManager", -- Thunderbird's about:config.
"pop-up", -- e.g. Google Chrome's (detached) Developer Tools.
}
}, properties = { floating = true }},
}, properties = { floating = true }},
-- Add titlebars to normal clients and dialogs
{ 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.
@ -590,8 +555,8 @@ client.connect_signal("manage", function (c)
-- if not awesome.startup then awful.client.setslave(c) end
if awesome.startup
and not c.size_hints.user_position
and not c.size_hints.program_position then
and not c.size_hints.user_position
and not c.size_hints.program_position then
-- Prevent clients from being unreachable after screen count changes.
awful.placement.no_offscreen(c)
end

View file

@ -4,74 +4,55 @@
#
# This script sends a canned email response to those who've errone-
# ously emailed me at <amcooper@gmail.com>. Once I've manually
# tagged those emails `misdirected`, it iterates over those emails and
# responds.
# moved those emails into the `misdirected` folder, it iterates
# over those emails and responds.
set -euo pipefail
if [[ -z "$(notmuch search tag:misdirected)" ]] ; then
echo "[autoreply.sh] Currently no emails are tagged 'misdirected'. Exiting..."
exit 1
fi
MISDIRECTED_DIR=/home/adam/Maildir/misdirected
# Handle option(s)
dry_run=
while getopts n opt ; do
printf "[debug] opt: %s\n\n" $opt
case $opt in
n) dry_run=1;;
?) echo "Usage: /path/to/autoreply.sh/ [ -n ]"
exit 2;;
esac
done
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
fi
# This weird feed-find-output-into-while-loop comes from
# https://github.com/koalaman/shellcheck/wiki/SC2044#correct-code
while IFS= read -r -d '' thread ; do
echo "[loop] Preparing the email..."
while IFS= read -r -d '' file ; do
echo "[loop] Preparing the email..."
# Make a temporary file
temporary_file=$(mktemp /tmp/autoreply-XXXXX)
echo "[debug] Temporary file: $temporary_file"
# Make a temporary file
temporary_file=$(mktemp /tmp/autoreplyXXXXX)
# Parse out the thread-id
thread_id=$(echo "$thread" | cut -f2 -d':')
echo "[debug] thread_id: $thread_id"
# 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>"
subject="Re: $(perl -lane 'print if /^Subject:/' "$file" | cut -d' ' -f2-)" ### "Re: Lorem ipsum baby"
# Parse out the reply headers and original message body
temporary_reply=$(mktemp /tmp/notmuch-reply-XXXXX)
echo "[debug] Temporary reply: $temporary_reply"
notmuch reply --format=json thread:$thread_id > $temporary_reply
subject="$(jq -r '."reply-headers".Subject' $temporary_reply)"
sender="$(jq -r '."reply-headers".From' $temporary_reply)"
recipient="$(jq -r '."reply-headers".To' $temporary_reply)"
in_reply_to="$(jq -r '."reply-headers"."In-reply-to"' $temporary_reply)"
references="$(jq -r '."reply-headers".References' $temporary_reply)"
orig_sender="$(jq -r '.original.headers.From' $temporary_reply)"
date="$(jq -r '.original.headers.Date' $temporary_reply)"
orig_body="$(jq -r '.original.body[0].content[] | select(."content-type" == "text/plain") | .content' $temporary_reply)"
# Copy canned message to temporary file
cp /home/adam/dotfiles/arch/bin/autoreply/misdirected_email_autoreply.txt "$temporary_file"
# Copy canned message to temporary file
printf "From: %s\nSubject: %s\nTo: %s\nDate: $(date +'%a, %d %b %Y %R %z')\nIn-Reply-To: %s\nReferences: %s\n\n" "$sender" "$subject" "$recipient" "$in_reply_to" "$references" >> "$temporary_file"
cat /home/adam/dotfiles/bin/autoreply/misdirected_email_autoreply.txt >> "$temporary_file"
printf "\n\nOn %s, %s wrote:\n" "$date" "$orig_sender" >> "$temporary_file"
# Append email body to temporary file
discard="0"
while IFS= read -r line ; do
if [[ $discard = "1" ]]; then
echo "$line" >> "$temporary_file"
else
if [[ -z "$line" ]]; then
discard="1"
fi
fi
done < "$file"
# Append email body to temporary file
printf "%s\n" "$orig_body" >> "$temporary_file"
# Send the email!
echo "[loop] Sending reply to $recipient ... "
neomutt -s "$subject" -c amcooper@gmail.com "$recipient" < "$temporary_file"
# Send the email!
printf "[debug] Outgoing mail:\n%s\n" "$(cat $temporary_file)"
if [[ -z "$dry_run" ]] ; then
echo "[loop] Sending reply to $recipient ... "
msmtp --read-envelope-from --read-recipients <"$temporary_file"
notmuch insert --folder=Sent -inbox -unread +sent +misdirected-reply <"$temporary_file"
# Move the misdirected email into `INBOX/cur`
echo "[loop] Moving the emails..."
mv "$file" /home/adam/Maildir/INBOX/cur
# Remove the misdirected tag
notmuch tag -misdirected -- thread:"$thread_id"
fi
echo "[loop] Done."
printf "%s\n\n" "[loop] Done."
done < <(notmuch search --output=threads --format=text0 tag:misdirected)
done < <(find "$MISDIRECTED_DIR" -path "$MISDIRECTED_DIR/tmp" -prune -o -type f -print0)
echo "[autoreply.sh] All done!"

View file

@ -1,9 +0,0 @@
#!/bin/sh
#
# start-tuis.sh
#
# 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 newsboat --command newsboat
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

@ -1,193 +0,0 @@
local js_based_languages = { "javascript", "typescript" }
-- lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup({
{
"rcarriga/nvim-dap-ui",
event = "VeryLazy",
requires = "mfussenegger/nvim-dap"
},
{
"mfussenegger/nvim-dap",
event = "VeryLazy",
config = function()
local dap = require("dap")
-- local Config = require("lazyvim.config")
vim.api.nvim_set_hl(0, "DapStoppedLine", { default = true, link = "Visual" })
--[[
for name, sign in pairs(Config.icons.dap) do
sign = type(sign) == "table" and sign or { sign }
vim.fn.sign_define(
"Dap" .. name,
{ text = sign[1], texthl = sign[2] or "DiagnosticInfo", linehl = sign[3], numhl = sign[3] }
)
end
--]]
for _, language in ipairs({ "javascript", "typescript" }) do
dap.configurations[language] = {
-- Debug single nodejs files
{
type = "pwa-node",
request = "launch",
name = "Launch file",
program = "${file}",
cwd = vim.fn.getcwd(),
sourceMaps = true,
},
-- Debug nodejs processes (make sure to add --inspect when you run the process)
{
type = "pwa-node",
request = "attach",
name = "Attach",
processId = require("dap.utils").pick_process,
cwd = vim.fn.getcwd(),
sourceMaps = true,
},
-- Debug web applications (client side)
{
type = "pwa-chrome",
request = "launch",
name = "Launch & Debug Chrome",
url = function()
local co = coroutine.running()
return coroutine.create(function()
vim.ui.input({
prompt = "Enter URL: ",
default = "http://localhost:3000",
}, function(url)
if url == nil or url == "" then
return
else
coroutine.resume(co, url)
end
end)
end)
end,
webRoot = vim.fn.getcwd(),
protocol = "inspector",
sourceMaps = true,
userDataDir = false,
},
-- Divider for the launch.json derived configs
{
name = "----- ↓ launch.json configs ↓ -----",
type = "",
request = "launch",
},
}
end
end,
keys = {
{
"<leader>da",
function()
if vim.fn.filereadable(".vscode/launch.json") then
local dap_vscode = require("dap.ext.vscode")
dap_vscode.load_launchjs(nil, {
["pwa-node"] = js_based_languages,
["chrome"] = js_based_languages,
["pwa-chrome"] = js_based_languages,
})
end
require("dap").continue()
end,
desc = "DAP: Run with Args",
},
},
dependencies = {
-- Install the vscode-js-debug adapter
{
"microsoft/vscode-js-debug",
-- After install, build it and rename the dist directory to out
build = "npm install --legacy-peer-deps --no-save && npx gulp vsDebugServerBundle && rm -rf out && mv dist out",
version = "1.*",
},
{
"mxsdev/nvim-dap-vscode-js",
config = function()
---@diagnostic disable-next-line: missing-fields
require("dap-vscode-js").setup({
-- Path of node executable. Defaults to $NODE_PATH, and then "node"
-- node_path = "node",
-- Path to vscode-js-debug installation.
debugger_path = vim.fn.resolve(vim.fn.stdpath("data") .. "/lazy/vscode-js-debug"),
-- Command to use to launch the debug server. Takes precedence over "node_path" and "debugger_path"
-- debugger_cmd = { "js-debug-adapter" },
-- which adapters to register in nvim-dap
adapters = {
"chrome",
"pwa-node",
"pwa-chrome",
"pwa-msedge",
"pwa-extensionHost",
"node-terminal",
},
-- Path for file logging
-- log_file_path = "(stdpath cache)/dap_vscode_js.log",
-- Logging level for output to file. Set to false to disable logging.
-- log_file_level = false,
-- Logging level for output to console. Set to false to disable console output.
-- log_console_level = vim.log.levels.ERROR,
})
end,
},
{
"Joakker/lua-json5",
build = "./install.sh",
},
},
},
{ "leoluz/nvim-dap-go", event = "VeryLazy" },
{ "williamboman/mason.nvim", event = "VeryLazy" },
{ "williamboman/mason-lspconfig.nvim", event = "VeryLazy" },
})
--[[ mason
Mason manages external editor plugins such as LSP servers, DAP servers,
linters, and formatters. There are further recommended plugins for better
integration.
--]]
require('mason').setup()
require('mason-lspconfig').setup()
require('dap-go').setup()
local dap, dapui = require("dap"), require("dapui")
dapui.setup()
dap.listeners.after.event_initialized["dapui_config"] = function()
dapui.open()
end
dap.listeners.before.event_terminated["dapui_config"] = function()
dapui.close()
end
dap.listeners.before.event_exited["dapui_config"] = function()
dapui.close()
end
-- Switch syntax highlighting on
vim.cmd("syntax enable")

File diff suppressed because it is too large Load diff

View file

@ -28,6 +28,7 @@ color listfocus_unread color238 color47 standout
color info color141 color236
confirm-exit yes
define-filter "nitter feeds" "tags !# \"nitter_personal\" and tags !# \"nitter_institutional\" and tags !# \"nitter_noise\""
feed-sort-order firsttag
# Dracula highlights
@ -43,7 +44,7 @@ highlight article ":.*\\(image\\)$" blue default
highlight article ":.*\\(embedded flash\\)$" magenta default
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 c set browser "xterm -e mpv --vid=no -- %u &"; one; set browser qutebrowser
max-items 4096
notify-program "/usr/bin/notify-send"
urls-source "freshrss"

View file

@ -10,4 +10,3 @@ leak
leak
wolff
baffler
Assange

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: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:podcasts Articles:tags # \"podcasts\""
"query:release_notes Articles:tags # \"release_notes\""

View file

@ -2,7 +2,6 @@
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_DATA_HOME="$HOME/.config/local/share"
export XDG_CACHE_HOME="$HOME/.config/cache"
export XDG_STATE_HOME="$HOME/.config/local/state"
export ZDOTDIR="$XDG_CONFIG_HOME/zsh"
export HISTSIZE=9998
@ -43,12 +42,5 @@ export DDGR_COLORS="MBdexy"
export NAVI_TAG_COLOR=6
export NAVI_COMMENT_COLOR=3
# gomphotherium
export GOMPHOTHERIUM_SERVER='https://toot.cat'
export GOMPHOTHERIUM_ACCESS_TOKEN='qqscVpLBugWAv6cFUqu1vBm0QMbgsWTiafg7TwZsTec'
# roswell
export ROSWELL_HOME="/home/adam/.config/roswell"
# Consolidate PATH
# export PATH="$(consolidate-path "$PATH")"

View file

@ -140,8 +140,9 @@ source /home/adam/.config/broot/launcher/bash/br
# tea
PROG=tea _CLI_ZSH_AUTOCOMPLETE_HACK=1 source "/home/adam/.config/tea/autocomplete.zsh"
# leetcode
eval "$(leetcode completions)"
# gomphotherium
export GOMPHOTHERIUM_SERVER='https://toot.cat'
export GOMPHOTHERIUM_ACCESS_TOKEN='qqscVpLBugWAv6cFUqu1vBm0QMbgsWTiafg7TwZsTec'
# ripgrep-all
rga-fzf() {