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 These are the messy dotfiles for my Arch Linux system. They're useful for
- restoring my system after a catastrophe - restoring my system after a catastrophe
- almost nothing else :) - 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. Please feel free to contact me with any questions; I'll be glad to help.

View file

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

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

@ -14,7 +14,6 @@ local beautiful = require("beautiful")
local naughty = require("naughty") local naughty = require("naughty")
local menubar = require("menubar") local menubar = require("menubar")
local lain = require("lain") local lain = require("lain")
-- local ruled = require("ruled")
local hotkeys_popup = require("awful.hotkeys_popup") local hotkeys_popup = require("awful.hotkeys_popup")
-- Enable hotkeys help widget for VIM and other apps -- Enable hotkeys help widget for VIM and other apps
-- when client with a matching name is opened: -- 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) -- 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 +37,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 +52,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"
else else
return "/usr/sbin/alacritty msg --socket /run/user/1000/alacritty-main.sock create-window" return "/usr/sbin/alacritty msg 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 +93,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,49 +122,49 @@ 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
if beautiful.wallpaper then if beautiful.wallpaper then
-- local wallpaper = beautiful.wallpaper -- 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 wallpaper is a function, call it with the screen
if type(wallpaper) == "function" then if type(wallpaper) == "function" then
wallpaper = wallpaper(s) wallpaper = wallpaper(s)
@ -174,70 +173,36 @@ local function set_wallpaper(s)
end end
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) -- Re-set wallpaper when a screen's geometry changes (e.g. different resolution)
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 +218,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 +274,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 +295,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 +319,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 +381,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 +424,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 +490,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 +555,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,74 +4,55 @@
# #
# 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..."
exit 1
fi
# Handle option(s) if [[ -z "$(ls -A "$MISDIRECTED_DIR/cur")" ]] && [[ -z "$(ls -A "$MISDIRECTED_DIR/new")" ]]; then
dry_run= echo "[autoreply.sh] The misdirected folders are currently empty. Exiting..."
while getopts n opt ; do exit 1
printf "[debug] opt: %s\n\n" $opt fi
case $opt in
n) dry_run=1;;
?) echo "Usage: /path/to/autoreply.sh/ [ -n ]"
exit 2;;
esac
done
# This weird feed-find-output-into-while-loop comes from # This weird feed-find-output-into-while-loop comes from
# https://github.com/koalaman/shellcheck/wiki/SC2044#correct-code # https://github.com/koalaman/shellcheck/wiki/SC2044#correct-code
while IFS= read -r -d '' thread ; do 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"
# Parse out the thread-id # Pull sender (i.e. recipient of my email) and subject from email
thread_id=$(echo "$thread" | cut -f2 -d':') recipient="$(perl -lane 'print if /^From:/' "$file" | cut -d' ' -f2-)" ### "Frantz Fanon <ffanon@riseup.net>"
echo "[debug] thread_id: $thread_id" subject="Re: $(perl -lane 'print if /^Subject:/' "$file" | cut -d' ' -f2-)" ### "Re: Lorem ipsum baby"
# Parse out the reply headers and original message body # Copy canned message to temporary file
temporary_reply=$(mktemp /tmp/notmuch-reply-XXXXX) cp /home/adam/dotfiles/arch/bin/autoreply/misdirected_email_autoreply.txt "$temporary_file"
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 # Append email body 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" discard="0"
cat /home/adam/dotfiles/bin/autoreply/misdirected_email_autoreply.txt >> "$temporary_file" while IFS= read -r line ; do
printf "\n\nOn %s, %s wrote:\n" "$date" "$orig_sender" >> "$temporary_file" 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 # Send the email!
printf "%s\n" "$orig_body" >> "$temporary_file" echo "[loop] Sending reply to $recipient ... "
neomutt -s "$subject" -c amcooper@gmail.com "$recipient" < "$temporary_file"
# Send the email! # Move the misdirected email into `INBOX/cur`
printf "[debug] Outgoing mail:\n%s\n" "$(cat $temporary_file)" echo "[loop] Moving the emails..."
if [[ -z "$dry_run" ]] ; then mv "$file" /home/adam/Maildir/INBOX/cur
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"
# Remove the misdirected tag echo "[loop] Done."
notmuch tag -misdirected -- thread:"$thread_id"
fi
printf "%s\n\n" "[loop] Done." done < <(find "$MISDIRECTED_DIR" -path "$MISDIRECTED_DIR/tmp" -prune -o -type f -print0)
done < <(notmuch search --output=threads --format=text0 tag:misdirected)
echo "[autoreply.sh] All done!" 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 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 c set browser "xterm -e mpv --vid=no -- %u &"; one; set browser qutebrowser
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

@ -10,4 +10,3 @@ leak
leak leak
wolff wolff
baffler 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: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
@ -43,12 +42,5 @@ export DDGR_COLORS="MBdexy"
export NAVI_TAG_COLOR=6 export NAVI_TAG_COLOR=6
export NAVI_COMMENT_COLOR=3 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 # Consolidate PATH
# export PATH="$(consolidate-path "$PATH")" # export PATH="$(consolidate-path "$PATH")"

View file

@ -140,8 +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 # gomphotherium
eval "$(leetcode completions)" export GOMPHOTHERIUM_SERVER='https://toot.cat'
export GOMPHOTHERIUM_ACCESS_TOKEN='qqscVpLBugWAv6cFUqu1vBm0QMbgsWTiafg7TwZsTec'
# ripgrep-all # ripgrep-all
rga-fzf() { rga-fzf() {