From ae5454a5465969e97d105b014960821899e3073f Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Tue, 12 Mar 2024 12:32:40 +0000 Subject: [PATCH 01/16] zsh: gpo/gpfo aliases for git push origin (--force-with-lease) --- zsh/aliases/git.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/zsh/aliases/git.zsh b/zsh/aliases/git.zsh index 15e5df1..afb1671 100644 --- a/zsh/aliases/git.zsh +++ b/zsh/aliases/git.zsh @@ -9,6 +9,8 @@ alias gup='git pull --rebase' alias gp='git push' alias gpf='git push --force-with-lease' +alias gpo='gp origin' +alias gpfo='gpf origin' alias gd='git diff' alias gdc='git diff --cached' -- 2.49.0 From d85412fdb152d5a8fd57542fb370506808a31493 Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Thu, 14 Mar 2024 12:35:40 +0000 Subject: [PATCH 02/16] ranger: open gmeet and slack huddles in new windows --- ranger/rifle.conf | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ranger/rifle.conf b/ranger/rifle.conf index 1334d56..182e53d 100644 --- a/ranger/rifle.conf +++ b/ranger/rifle.conf @@ -54,6 +54,11 @@ match ^https?://(www|m).youtube.com/watch\?, has mpv, X, flag f = mpv --quiet match ^https?://youtu.be/, has mpv, X, terminal = mpv --quiet -- $1 match ^https?://youtu.be/, has mpv, X, flag f = mpv --quiet -- $1 +# Open meet and slack huddles in new windows +match ^https?://meet.google.com/, has qutebrowser, X, flag f = qutebrowser --target window -- "$@" +# the url is actually open=start_huddle, but rifle cannot match = (https://github.com/ranger/ranger/issues/2111) +match ^https?://app.slack.com/.*[?&]open.start_huddle, has qutebrowser, X, flag f = qutebrowser --target window -- "$@" + # open web url with BROWSER match ^https?://, X, flag f = $BROWSER -- "$@" -- 2.49.0 From 20a4cdc797771c896c97c9acab6a0799904a2b98 Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Mon, 25 Mar 2024 23:33:41 +0000 Subject: [PATCH 03/16] make: separate systemd-user and systemd-system targets --- Makefile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 7e69147..5eb60a3 100644 --- a/Makefile +++ b/Makefile @@ -125,9 +125,16 @@ ssh: /etc/systemd/system/%: systemd/system/% sudo cp $(APATH)/$< $@ -systemd_system_units := $(patsubst %,/etc/%,$(wildcard systemd/system/*)) -systemd: $(XDG_CONFIG_HOME) $(systemd_system_units) +systemd-system: $(patsubst %,/etc/%,$(wildcard systemd/system/*)) + sudo systemctl daemon-reload +.PHONY: systemd-system + +systemd-user: $(XDG_CONFIG_HOME) ln -sfT $(APATH)/$@ $(XDG_CONFIG_HOME)/$@ +.PHONY: systemd-user + +systemd: systemd-user systemd-system + systemctl --user daemon-reload .PHONY: systemd task: $(XDG_CONFIG_HOME) -- 2.49.0 From 09dbec97941647cf1a83ba5898b3ab3b2e1d86a9 Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Tue, 26 Mar 2024 00:28:31 +0000 Subject: [PATCH 04/16] task: case insensitive search --- task/taskrc | 1 + 1 file changed, 1 insertion(+) diff --git a/task/taskrc b/task/taskrc index d6bfcf6..e5fa60a 100644 --- a/task/taskrc +++ b/task/taskrc @@ -22,6 +22,7 @@ weekstart=monday # Behaviour confirmation = 0 # do not ask when deleting tasks +search.case.sensitive = 0 # Terminal reserved.lines=2 # reserve two lines for prompt -- 2.49.0 From 6ba2d1c27c670d2a72194f307f4f2a4a894099a7 Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Tue, 26 Mar 2024 00:28:54 +0000 Subject: [PATCH 05/16] task: use no instead of 0 for booleans --- task/taskrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/task/taskrc b/task/taskrc index e5fa60a..aa601a5 100644 --- a/task/taskrc +++ b/task/taskrc @@ -21,8 +21,8 @@ include /usr/share/doc/task/rc/solarized-dark-256.theme weekstart=monday # Behaviour -confirmation = 0 # do not ask when deleting tasks -search.case.sensitive = 0 +confirmation = no # do not ask when deleting tasks +search.case.sensitive = no # Terminal reserved.lines=2 # reserve two lines for prompt -- 2.49.0 From 1cd9284f1ed61080917ba8fb18767c4b3c239327 Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Tue, 26 Mar 2024 00:31:13 +0000 Subject: [PATCH 06/16] task: add custom reports --- task/taskrc | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/task/taskrc b/task/taskrc index aa601a5..03b8755 100644 --- a/task/taskrc +++ b/task/taskrc @@ -27,6 +27,29 @@ search.case.sensitive = no # Terminal reserved.lines=2 # reserve two lines for prompt +report.in.description = Inbox +report.in.columns = id,start.age,entry.age,depends,priority,project,tags,recur,description +report.in.filter = ( status:waiting or status:pending ) limit:page (+in) +report.in.sort = entry+ + +report.today.description = Tasks for today +report.today.columns = id,start.age,priority,project,tags,scheduled.remaining,due.relative,until.remaining,description,urgency +report.today.filter = status:pending (-maybe -BLOCKED) (+ACTIVE or due.by:eod or scheduled.by:eod or +next) limit:page +report.today.sort = urgency- +report.today.context = yes + +report.motd.description = MOTD report (shown when opening a terminal) +report.motd.columns = id,project,scheduled.remaining,due.relative,until.remaining,description.truncated_count +report.motd.filter = status:pending (-maybe -BLOCKED) (+ACTIVE or due.by:eod or scheduled.by:eod or +next) limit:page +report.motd.sort = urgency- +report.motd.context = yes + +report.closed.description = Completed and deleted tasks +report.closed.columns = id,uuid.short,entry,end,status,entry.age,depends,priority,project,tags,recur.indicator,due,description +report.closed.filter = ( status:completed or status:deleted ) limit:page +report.closed.sort = end- +report.closed.context = yes + # taskd taskd.certificate=$XDG_DATA_HOME/task/hactar.cert.pem taskd.key=$XDG_DATA_HOME/task/hactar.key.pem -- 2.49.0 From d78192fdd32c9deb8e506ae6a63590b0f021e3aa Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Tue, 26 Mar 2024 00:34:12 +0000 Subject: [PATCH 07/16] task: configure urgency modifiers --- task/taskrc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/task/taskrc b/task/taskrc index 03b8755..1bd4b76 100644 --- a/task/taskrc +++ b/task/taskrc @@ -50,6 +50,19 @@ report.closed.filter = ( status:completed or status:deleted ) limit:page report.closed.sort = end- report.closed.context = yes +# Urgency +urgency.uda.priority.L.coefficient=-2 # setting priority to low reduces urgency + +urgency.user.tag.in.coefficient=-1 + +# inherit highest urgency from blocked tasks +# TODO: this doesn't quite work, check source code for explanation +# I'd like the blocking task to use the highest blocked task as a base urgency, +# then add on top a blocking coefficient +urgency.inherit = yes +urgency.blocked.coefficient = 0.0 +urgency.blocking.coefficient = 4.0 + # taskd taskd.certificate=$XDG_DATA_HOME/task/hactar.cert.pem taskd.key=$XDG_DATA_HOME/task/hactar.key.pem -- 2.49.0 From b0b9a0fea4e51381788121e5af7952813a93c97b Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Mon, 4 Mar 2024 11:05:56 +0000 Subject: [PATCH 08/16] zsh: don't do task-quote-magic on global aliases --- zsh/functions/task-quote-magic | 1 - 1 file changed, 1 deletion(-) diff --git a/zsh/functions/task-quote-magic b/zsh/functions/task-quote-magic index 9634320..6d2715e 100644 --- a/zsh/functions/task-quote-magic +++ b/zsh/functions/task-quote-magic @@ -32,7 +32,6 @@ zstyle -m ':task-quote-magic' task-cmds '*' || zstyle -e ':task-quote-magic' task-cmds \ 'zmodload -i zsh/parameter; reply=( task - ${(k)galiases[(R)(* |)task( *|)]:-} ${(k)aliases[(R)(* |)task( *|)]:-} )' function task-quote-magic { -- 2.49.0 From 3d971d9578f4f0f9d84fd35623beac5a9875d7fd Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Tue, 26 Mar 2024 00:22:23 +0000 Subject: [PATCH 09/16] zsh: magic escape ` in task commands --- zsh/functions/task-quote-magic | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zsh/functions/task-quote-magic b/zsh/functions/task-quote-magic index 6d2715e..16294c4 100644 --- a/zsh/functions/task-quote-magic +++ b/zsh/functions/task-quote-magic @@ -26,7 +26,7 @@ local -a reply match mbegin mend zstyle -m ':task-quote-magic:\*' task-seps '*' || - zstyle -e ':task-quote-magic:*' task-seps 'reply=("#{}&<>''${histchars[1]}")' + zstyle -e ':task-quote-magic:*' task-seps 'reply=("#{}\`&<>''${histchars[1]}")' zstyle -m ':task-quote-magic' task-cmds '*' || zstyle -e ':task-quote-magic' task-cmds \ -- 2.49.0 From e6863be5d96bc2f3e6f64b91a55061ca25613d06 Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Tue, 26 Mar 2024 00:46:32 +0000 Subject: [PATCH 10/16] zsh: print 5 most urgent tasks as motd --- zsh/lib/motd.zsh | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/zsh/lib/motd.zsh b/zsh/lib/motd.zsh index be5b477..a929b35 100644 --- a/zsh/lib/motd.zsh +++ b/zsh/lib/motd.zsh @@ -10,17 +10,22 @@ msg() print "$fg_bold[white]$1$reset_color\n$2\n" } -if [[ -d ~/org ]]; then - org-agenda -fi - if (( $+commands[checkupdates] )); then # checkupdate.service populates this db pkg_count=$(CHECKUPDATES_DB=/tmp/checkup-db-0 checkupdates -n | grep -cv '\[.*\]') - if (( $pkg_count > 0 )); then - short "Outdated packages: $pkg_count" - fi fi + +if (( $+commands[task] )); then + # this is moved after checkupdates above because it introduces enough of a delay + # for the terminal width calculation to have the right width stored + # see https://github.com/wez/wezterm/issues/5137 + task rc.verbose:0 motd limit:5 +fi + +if (( ${pkg_count:-0} > 0 )); then + short "Outdated packages: $pkg_count" +fi + if (( $+commands[pacman] )); then kercmp -q || short "linux" "$(kercmp)" fi -- 2.49.0 From b883f8d13bfc5c5e35c709b0546fd28fb145e6f6 Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Tue, 26 Mar 2024 00:46:53 +0000 Subject: [PATCH 11/16] zsh: tt alias for todays tasks --- zsh/lib/taskwarrior.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/zsh/lib/taskwarrior.zsh b/zsh/lib/taskwarrior.zsh index 7aae965..c99bebd 100644 --- a/zsh/lib/taskwarrior.zsh +++ b/zsh/lib/taskwarrior.zsh @@ -1,4 +1,5 @@ alias t="noglob task" +alias tt="task today" alias tlatest="t +LATEST" alias in="noglob task add +in" alias inn="in rc.context=none" -- 2.49.0 From 5acc440775ee9f7666d62668f9080c2b588eaa78 Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Tue, 26 Mar 2024 00:35:01 +0000 Subject: [PATCH 12/16] vim: remove deprecated gc and gp mappings I have now learned to use gcc and gpp. --- vim/vimrc | 2 -- 1 file changed, 2 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index bd479a7..0c341cb 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -821,11 +821,9 @@ command! GToggle GitToggle nnoremap gs :GitToggle nnoremap gd :Gdiffsplit -nnoremap gc :echohl WarningMsg \| echo "use \gcc instead" \| echohl None nnoremap gcc :tab G commit -v nnoremap gca :tab G commit -v --amend nnoremap gcf :tab G commit -v --fixup= -nnoremap gp :echohl WarningMsg \| echo "use \gpp instead" \| echohl None nnoremap gpp :Git push \| copen nnoremap gpf :Git push --force-with-lease \| copen nnoremap gll :Git pull -- 2.49.0 From dfda729156598121ba76e0cc77a520549d5b1af0 Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Tue, 26 Mar 2024 00:37:43 +0000 Subject: [PATCH 13/16] nvim: replace which-key with mini.clue --- nvim/lua/plugins/ui.lua | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/nvim/lua/plugins/ui.lua b/nvim/lua/plugins/ui.lua index 884225d..35882fb 100644 --- a/nvim/lua/plugins/ui.lua +++ b/nvim/lua/plugins/ui.lua @@ -1,5 +1,38 @@ ---@type LazyPluginSpec return { + -- disabled plugins {{{ + { "folke/which-key.nvim", + enabled = false, + }, + -- }}} + { 'echasnovski/mini.clue', + -- NOTE: this caused some issue with unterminated mappings, i.e. gc when there + -- is also gcc. It would simply terminate early and not allow for next mapping. + version = '*', + opts = { + triggers = { + { mode = 'n', keys = '' }, + { mode = 'x', keys = '' }, + -- `g` key + { mode = 'n', keys = 'g' }, + { mode = 'x', keys = 'g' }, + -- Marks + { mode = 'n', keys = "'" }, + { mode = 'n', keys = '`' }, + { mode = 'x', keys = "'" }, + { mode = 'x', keys = '`' }, + -- Window commands + { mode = 'n', keys = '' }, + -- `z` key + { mode = 'n', keys = 'z' }, + { mode = 'x', keys = 'z' }, + }, + clues = { + { mode = 'n', keys = 'b', desc = '+Buffers' }, + { mode = 'n', keys = 'c', desc = '+LSP' }, + }, + }, + }, { "nvim-notify", }, -- 2.49.0 From e0e3d9c441222774366e15934d59b2235eebba43 Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Tue, 26 Mar 2024 00:40:10 +0000 Subject: [PATCH 14/16] nvim: replace neo-tree with oil netrw/vinegar/oil are better file browser approaches. --- nvim/lua/plugins/editor.lua | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/nvim/lua/plugins/editor.lua b/nvim/lua/plugins/editor.lua index 1ec7312..a1fb2d1 100644 --- a/nvim/lua/plugins/editor.lua +++ b/nvim/lua/plugins/editor.lua @@ -92,8 +92,33 @@ return { end, keys = { { "ss", "Telescope luasnip", desc = "Snippets" } }, }, + { + "stevearc/oil.nvim", + opts = { + keymaps = { + ["g?"] = "actions.show_help", + [""] = "actions.select", + [""] = "actions.select_vsplit", + [""] = false, -- used to be actions.select_split + [""] = "actions.select_tab", + [""] = "actions.preview", + [""] = "actions.close", + [""] = false, -- used to be actions.refresh + ["-"] = "actions.parent", + ["_"] = "actions.open_cwd", + ["`"] = "actions.cd", + ["~"] = "actions.tcd", + ["gs"] = "actions.change_sort", + ["gx"] = "actions.open_external", + ["g."] = "actions.toggle_hidden", + ["g\\"] = "actions.toggle_trash", + }, + }, + dependencies = {"nvim-tree/nvim-web-devicons"}, + }, { "neo-tree.nvim", + enabled = false, lazy = false, opts = { filesystem = { -- 2.49.0 From 9ef97bdf4d63d9496a6027d8b0ff1ed89176aeed Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Tue, 26 Mar 2024 00:43:14 +0000 Subject: [PATCH 15/16] mutt: print all policies dispositions --- mutt/dmarc.xsl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mutt/dmarc.xsl b/mutt/dmarc.xsl index b6f693f..4573b05 100644 --- a/mutt/dmarc.xsl +++ b/mutt/dmarc.xsl @@ -290,6 +290,10 @@ +
+ dkim:
+ spf :
+ -- 2.49.0 From ccb3354f57fddb05ec951b0231fffe46ef4b8dc6 Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Tue, 26 Mar 2024 00:45:09 +0000 Subject: [PATCH 16/16] qutebrowser: prefer dark themes --- qutebrowser/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qutebrowser/config.py b/qutebrowser/config.py index c8ed834..66cd4c3 100644 --- a/qutebrowser/config.py +++ b/qutebrowser/config.py @@ -195,7 +195,7 @@ c.changelog_after_upgrade = 'patch' ## - auto: Use the system-wide color scheme setting. ## - light: Force a light theme. ## - dark: Force a dark theme. -# c.colors.webpage.preferred_color_scheme = 'auto' +c.colors.webpage.preferred_color_scheme = 'dark' ## Number of commands to save in the command history. 0: no history / -1: ## unlimited -- 2.49.0