Compare commits

..

2 commits

Author SHA1 Message Date
e992db6c07 bin: Significant refactor of the autoreply script 2024-07-27 01:00:02 -04:00
b49716c6f1 Various changes
awesome
- Change font of top bar
- Fix indentation
bin
- start-tuis.sh
neovim
- Some new plugins
newsboat
- Remove nitter items
zsh
- Minor tweaks
2024-07-27 00:58:33 -04:00
11 changed files with 255 additions and 213 deletions

View file

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

View file

@ -200,13 +200,26 @@ screen.connect_signal("property::geometry", set_wallpaper)
local mymem = lain.widget.mem { local mymem = lain.widget.mem {
settings = function() settings = function()
widget:set_markup(" mem " .. mem_now.perc .. " swp " .. math.floor((mem_now.swapused / mem_now.swap) * 100)) 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 end
} }
local mycpu = lain.widget.cpu { local mycpu = lain.widget.cpu {
settings = function() settings = function()
widget:set_markup(" cpu " .. cpu_now.usage) local cpu_spacer = ""
if cpu_now.usage < 10 then
cpu_spacer = " "
end
widget:set_markup(" cpu " .. cpu_spacer .. cpu_now.usage)
end end
} }

View file

@ -4,15 +4,13 @@
# #
# 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
# moved those emails into the `misdirected` folder, it iterates # tagged those emails `misdirected`, it iterates over those emails and
# over those emails and responds. # responds.
set -euo pipefail set -euo pipefail
MISDIRECTED_DIR=/home/adam/Maildir/misdirected if [[ -z "$(notmuch search tag:misdirected)" ]] ; then
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
@ -22,20 +20,24 @@ 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/autoreplyXXXXX) temporary_file=$(mktemp /tmp/autoreply-XXXXX)
echo "[debug] Temporary file: $temporary_file" # debug
# Pull sender (i.e. recipient of my email) and subject from email # Pull sender (i.e. recipient of my email), subject, and date 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
cp /home/adam/dotfiles/arch/bin/autoreply/misdirected_email_autoreply.txt "$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"
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"
@ -44,15 +46,16 @@ 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 ... "
neomutt -s "$subject" -c amcooper@gmail.com "$recipient" < "$temporary_file" cat "$temporary_file" | msmtp --read-envelope-from --read-recipients
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 < <(find "$MISDIRECTED_DIR" -path "$MISDIRECTED_DIR/tmp" -prune -o -type f -print0) done < <(notmuch search --output=files --format=text0 tag:misdirected)
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 $NVM_BIN/joplin 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 newsboat --command newsboat
alacritty msg create-window --title aerc --command aerc alacritty msg create-window --title aerc --command aerc

2
bin/zoom-scaled.sh Executable file
View file

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

View file

@ -107,6 +107,7 @@ 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",
{ {
@ -128,10 +129,19 @@ require("lazy").setup({
vim.o.timeoutlen = 300 -- 0? 500? 300? vim.o.timeoutlen = 300 -- 0? 500? 300?
end, end,
opts = { opts = {
window = { win = {
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",
@ -396,6 +406,17 @@ 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
@ -768,6 +789,8 @@ 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,7 +28,6 @@ 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
@ -44,7 +43,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 macro p set browser "mpv --player-operation-mode=pseudo-gui -- %u &"; one; set browser w3m -- "Play media file in mpv"
max-items 4096 max-items 4096
notify-program "/usr/bin/notify-send" notify-program "/usr/bin/notify-send"
urls-source "freshrss" urls-source "freshrss"

1
newsboat/.newsboat/queue Normal file
View file

@ -0,0 +1 @@
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,7 +1,4 @@
"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,6 +2,7 @@
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,6 +140,9 @@ 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"