Skip to content

Commit 8d0f173

Browse files
committed
2024 August updates
1 parent 319b3b3 commit 8d0f173

File tree

15 files changed

+217
-79
lines changed

15 files changed

+217
-79
lines changed

Diff for: .gitmodules

+7-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,10 @@
77
url = https://github.com/tmux-plugins/tpm
88
[submodule "todo.actions.d/graph"]
99
path = todo.actions.d/graph
10-
url = https://github.com/Bassmann/todo.txt-graph.git
10+
url = https://github.com/timpulver/todo.txt-graph.git
11+
[submodule "todo.actions.d/due"]
12+
path = todo.actions.d/due
13+
url = https://github.com/rebeccamorgan/due.git
14+
[submodule "local/opt/fzf-git"]
15+
path = local/opt/fzf-git
16+
url = https://github.com/junegunn/fzf-git.sh.git

Diff for: bashrc.kmarc

+26-2
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ else
4646
source /usr/local/share/fzf/shell/completion.bash
4747
fi
4848

49+
if [ -f "$HOME/.local/opt/fzf-git/fzf-git.sh" ]; then
50+
source "$HOME/.local/opt/fzf-git/fzf-git.sh"
51+
fi
52+
4953
###################
5054
# NODE.JS - NVM #
5155
###################
@@ -124,8 +128,6 @@ alias diff='diff --color=auto'
124128
alias grep='grep --color=auto'
125129
alias mutt='neomutt'
126130
alias sudo='sudo '
127-
alias htop='TERM=xterm-256color htop'
128-
alias ssh='TERM=xterm-256color ssh'
129131
alias monerod="monerod --data-dir ${XDG_DATA_HOME}/bitmonero"
130132

131133
git-recursive-pull() {
@@ -213,6 +215,28 @@ if [[ $OSTYPE == 'darwin'* ]]; then
213215
fi
214216

215217

218+
function git-worktree() {
219+
if [ ${#*} -lt 2 ]; then
220+
2>&1 echo "Usage: git-worktree JIRA-NNN short-name"
221+
return 1
222+
fi
223+
local ticket orig_branch new_branch
224+
ticket="$1"
225+
new_branch=$2
226+
orig_branch="$(git rev-parse --abbrev-ref HEAD)"
227+
new_dir=../"$(basename "$PWD")"-"$new_branch"
228+
git fetch origin "$orig_branch"
229+
git worktree add "$new_dir" -B "$USER/$ticket-$new_branch"
230+
if [ -f .envrc ]; then
231+
cp .envrc "$new_dir/.envrc"
232+
direnv allow "$new_dir"
233+
fi
234+
if [ -f user.bazelrc ]; then
235+
cp user.bazelrc "$new_dir/user.bazelrc"
236+
fi
237+
}
238+
239+
216240
###############
217241
# dark mode #
218242
###############

Diff for: bin/mutt_helpers.sh

+6
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ function smtp_pass() {
2525
_query_keychain "$kind"-pass "$from"
2626
}
2727

28+
function smtp_user() {
29+
local kind="$1"
30+
local from="$2"
31+
_query_keychain "$kind"-username "$from" | sed 's#\\\\#\\#g'
32+
}
33+
2834
function query_command() {
2935
local kind="$1"
3036
local from="$2"

Diff for: bin/offlineimap.py

+9-3
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,17 @@
55
import platform
66

77

8-
def get_pass(kind, account):
8+
def get_entry(typ, kind, account):
99
if platform.uname().system == "Darwin":
10-
return check_output(f"security find-generic-password -w -s '{kind}-pass' -a '{account}'", shell=True).splitlines()[0]
10+
return check_output(f"security find-generic-password -w -s '{kind}-{typ}' -a '{account}'", shell=True).splitlines()[0]
1111
else:
12-
return check_output(f"secret-tool lookup {kind}-pass '{account}'", shell=True).splitlines()[0]
12+
return check_output(f"secret-tool lookup {kind}-{typ} '{account}'", shell=True).splitlines()[0]
13+
14+
def get_pass(kind, account):
15+
return get_entry('pass', kind, account)
16+
17+
def get_user(kind, account):
18+
return get_entry('username', kind, account)
1319

1420
if __name__ == '__main__':
1521
print(get_pass(sys.argv[1], sys.argv[2]))

Diff for: config/alacritty.toml

+6-4
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,18 @@ duration = 100
99
[env]
1010
# TERM = "xterm-256color"
1111

12-
[font.bold_italic]
13-
family = "Menlo"
14-
style = "Bold Italic"
12+
# [font.bold_italic]
13+
# family = "Menlo"
14+
# style = "Bold Italic"
15+
[font]
16+
size = 12
1517

1618
[font.normal]
1719
family = "Fira Code"
1820
style = "Medium"
1921

2022
[font.offset]
21-
y = -1
23+
y = 0
2224

2325
[[keyboard.bindings]]
2426
action = "CreateNewWindow"

Diff for: config/environment.d/env.conf

+6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
# shellcheck disable=SC2034
2+
3+
if infocmp alacritty >/dev/null; then
4+
export TERM=alacritty
5+
fi
6+
27
# export XDG_SESSION_TYPE=wayland
38
export XDG_DATA_HOME="$HOME/.local/share"
49
export XDG_CONFIG_HOME="$HOME/.config"
@@ -26,6 +31,7 @@ else
2631
fi
2732

2833
export PATH="$HOME/bin:$HOME/.local/bin/:$PATH"
34+
export PATH="$HOME/.local/share/cargo/bin:$PATH"
2935

3036
export GOPATH="$XDG_DATA_HOME/go"
3137

Diff for: config/git/config

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@
6565
autostash = true
6666

6767
[tag]
68-
forceSignAnnotated = true
69-
gpgSign = true
68+
; forceSignAnnotated = true
69+
; gpgSign = true
7070

7171
[tig]
7272
ignore-space = yes

Diff for: config/git/config.linux

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[credential]
2-
helper = git-credential-libsecret
2+
helper = /usr/libexec/git-core/git-credential-libsecret
33

44
# vim: set ft=gitconfig:

Diff for: config/newsboat/config

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ always-display-description yes
44
auto-reload yes
55
bookmark-autopilot yes
66
bookmark-cmd "printf '%s\t%s\t%s\t%s\n' >> $HOME/Documents/Notes/bookmarks.txt"
7-
browser "xdg-open %u"
7+
browser "open %u"
88
download-full-page yes
99
feed-sort-order lastupdated
1010
notify-always yes
@@ -44,7 +44,7 @@ highlight feedlist "[N ]*\\([0-9/]+\\) " white
4444
highlight articlelist "^[0-9 ]{4} " green
4545
highlight articlelist "\\(([0-9 ]{2}[0-9]\.?|[0-9]\\.[0-9]K|[ 0-9]{2}\\.[0-9])\\) " white
4646

47-
macro o set browser "mpv %u" ; open-in-browser ; set browser "xdg-open %u"
48-
macro d set browser "youtube-dl %u" ; open-in-browser ; set browser "xdg-open %u"
47+
macro o set browser "mpv %u" ; open-in-browser ; set browser "open %u"
48+
macro d set browser "youtube-dl %u" ; open-in-browser ; set browser "open %u"
4949

5050
# vim: set ft=conf:

Diff for: config/tmux/fix-ssh.sh

+13-7
Original file line numberDiff line numberDiff line change
@@ -36,30 +36,36 @@ if grep -iqE "$(echo "${SSH_VARS[@]}" | md5sum)" /tmp/tmux-ssh-settings.md5; the
3636
fi
3737
echo "${SSH_VARS[@]}" | md5sum > /tmp/tmux-ssh-settings.md5
3838

39+
monitor_bell="$(tmux show-option -gv monitor-bell)"
40+
tmux set-option -g monitor-bell off
41+
3942
# Check every pane for the running command and try to update the environment variables
4043
for pane in $(tmux list-panes -a -F '#{pane_id}'); do
4144
variables=$(for var in "${!SSH_VARS[@]}"; do
4245
printf "%s=\"%s\" " "$var" "${SSH_VARS[$var]}"
4346
done)
4447
bash_cmd="export $variables"
4548

46-
if ! is_bash; then
47-
log "not bash: $(pane_cmd)"
49+
log "$(tmux display -t "$pane" -p "#{window_index}.#{pane_index}") command: $(pane_cmd)"
4850

51+
if is_bash; then
52+
nop
53+
else
4954
if is_vim; then
5055
commands=$(for var in "${!SSH_VARS[@]}"; do
5156
printf "let \$%s=\"%s\" | " "$var" "${SSH_VARS[$var]}"
5257
done)
53-
tmux send-keys -t "$pane" Escape ":${commands%|*} | call histdel(':', '.*SSH_.*')" Enter
54-
sleep 0.5
58+
tmux send-keys -t "$pane" Escape Escape ":${commands%|*} | call histdel(':', '.*SSH_.*')" Enter
59+
# sleep 0.5
5560
fi
5661

5762
# If not in a shell, then background the app (C-z) and bring to the foreground after
58-
tmux send-keys -t "$pane" C-z C-c
63+
tmux send-keys -t "$pane" C-z
64+
sleep 0.1
65+
tmux send-keys -t "$pane" C-c
5966
bash_cmd+="; fg"
60-
sleep 1.0
6167
fi
6268

6369
tmux send-keys -t "$pane" C-u " $bash_cmd" Enter
6470
done
65-
71+
tmux set-option -g monitor-bell "$monitor_bell"

Diff for: config/tmux/tmux.conf

+1-2
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,12 @@ bind -T copy-mode-vi v send-keys -X begin-selection
3838
bind -T copy-mode-vi C-v send-keys -X rectangle-toggle
3939

4040
set -g history-limit 128000
41-
# set -g xterm-keys on
4241
set -g focus-events on
4342

4443
set -g set-clipboard on
4544

4645
# Slimux integration
47-
is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?x?)(diff)?$"'
46+
is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?x?|git)(diff)?$"'
4847
bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
4948
bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
5049
bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"

Diff for: install.conf.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@
9898
path: config/rtorrent/rtorrent.rc
9999
$XDG_DATA_HOME/terminfo:
100100
path: local/share/terminfo
101+
$HOME/.local/opt/fzf-git:
102+
path: local/opt/fzf-git
101103
$XDG_CONFIG_HOME/tmux/tmux.conf:
102104
path: config/tmux/tmux.conf
103105
$XDG_CONFIG_HOME/tmux/fix-ssh.sh:

Diff for: mutt/muttrc._owa_

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ set trash = +Trash
1010
set ssl_starttls = no
1111
set ssl_force_tls = no
1212
set smtp_pass = "`~/bin/mutt_helpers.sh smtp_pass owa '$from'`"
13+
set smtp_user = "`~/bin/mutt_helpers.sh smtp_user owa '$from'`"
1314
# set smtp_url = "<see muttrc.local>"
1415

1516
# Addressbook

0 commit comments

Comments
 (0)