Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
bfacb51
docs(README): update some links and add an example nektos/act command
fevrin Apr 13, 2024
d651425
chore: update actions/setup-python to v5.1.0
fevrin Apr 13, 2024
5dc7651
feat: remove paths requirements for Actions triggers
fevrin Apr 13, 2024
f770798
feat: update pre-commit action version
fevrin Apr 13, 2024
039459d
feat: grant MegaLinter permission to write to PRs
fevrin Apr 13, 2024
26266d3
feat: add alternative theme changer script
fevrin Apr 20, 2024
b6e40a7
refactor: update theme changer script for efficiency and accuracy
fevrin Apr 20, 2024
55ea6de
feat: kill act Docker containers with signal 9 during cleanup
fevrin Apr 30, 2024
c909d08
feat: update starship config to always display the current commit hash
fevrin Jun 20, 2024
e3c40c3
feat: add ssh config template
fevrin Jun 20, 2024
f2a2890
feat: correct some conditional logic for installing vim-plugin
fevrin Nov 1, 2024
84eb133
feat: have 'git st' alias for 'git status' show ignored files
fevrin Dec 14, 2024
860d292
fix: update 'bluetoothctl' subcommand
fevrin Dec 27, 2024
5696e37
fix: gate some vimrc options behind vim version
fevrin Dec 27, 2024
ea79bc5
feat: add CopyQ autostart file due to special Wayland requirement
fevrin Dec 27, 2024
c11d8fc
feat: preserve modification times by default
fevrin Jan 5, 2025
8af8ec3
feat: add some functions for reusability
fevrin Jan 5, 2025
44b7374
style; rearrange some comments
fevrin Jan 5, 2025
d02525f
feat(change_theme): add logging, strict executing, and update comments
fevrin Jan 7, 2025
90fe82c
feat(change_theme): remove old logging and make script verbose
fevrin Jan 15, 2025
2c3bd1b
feat: take additional step to ensure theme is changed
fevrin Jan 18, 2025
e2d26de
feat: rework to support both cron and resume from suspend runs
fevrin Jan 21, 2025
176b9ff
feat: update SSH_AUTH_SOCK if a password manager's socket file exists
fevrin May 12, 2025
6f2c3e0
feat(gitconfig): add aliases for review-commits and worktree
fevrin Dec 3, 2025
373eeda
chore(cspell): switch to YAML
fevrin Dec 3, 2025
c5dbb0b
chore(cspell): convert to YAML
fevrin Dec 3, 2025
573b1d8
chore(lychee): add stackoverflow to excluded URLs
fevrin Dec 3, 2025
1a4c5bb
chore(megalinter): bump version
fevrin Dec 3, 2025
826c44b
chore(cspell): add some official dictionaries
fevrin Dec 3, 2025
a2d7ac6
chore(lychee): fix regex
fevrin Dec 3, 2025
74cea03
chore(pre-commit): bump setup-python and python version
fevrin Dec 3, 2025
9105e6a
feat(pre-commit): switch to individual commands for pre-commit
fevrin Dec 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .config/autostart/copyq.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Desktop Entry]
Type=Application
Exec=env QT_QPA_PLATFORM=xcb /usr/bin/copyq
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name[en_US]=CopyQ
Name=CopyQ
Comment[en_US]=
Comment=
# https://copyq.readthedocs.io/en/latest/known-issues.html#on-linux-global-shortcuts-pasting-or-clipboard-monitoring-does-not-work
1 change: 1 addition & 0 deletions .config/starship.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ symbol = '🌴 '
format = '\(on [$symbol$branch(:$remote_branch)]($style) '

[git_commit]
only_detached = false
tag_disabled = false

[git_status]
Expand Down
6 changes: 5 additions & 1 deletion .gitconfig
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@
'"
root-dir = rev-parse --show-toplevel
save = !git add -A && git commit -m 'chore: commit save point' # from https://snyk.io/blog/10-git-aliases-for-faster-and-productive-git-workflow/
st = status
st = status --ignored
sync = "!$HOME/.gitconfig.d/git-sync.sh $@"
type = cat-file -t
undo = reset HEAD~1 --mixed # from https://snyk.io/blog/10-git-aliases-for-faster-and-productive-git-workflow/
Expand Down Expand Up @@ -383,6 +383,10 @@
lg3 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold yellow)(%ar)%C(reset)%C(auto)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all
lg4 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset) %C(bold cyan)(committed: %cD)%C(reset) %C(auto)%d%C(reset)%n'' %C(white)%s%C(reset)%n'' %C(dim white)- %an <%ae> %C(reset) %C(dim white)(committer: %cn <%ce>)%C(reset)'
ss = stash show
review-commits = "!f() {\n CURRENT=$(git branch --show-current);\n echo \"Current branch: $CURRENT\";\n printf \"Enter base branch (default: main): \";\n read -r BASE < /dev/tty;\n BASE=${BASE:-main};\n echo;\n COMMITS=$(git log --reverse --pretty=format:\"%H\" $BASE..$CURRENT);\n if [ -z \"$COMMITS\" ]; then\n echo \"No commits found in $CURRENT that aren't in $BASE\";\n return 0;\n fi;\n COUNT=$(echo \"$COMMITS\" | wc -l);\n printf \"Found %s commit(s) to review\\n\" \"$COUNT\";\n echo;\n i=1;\n for c in $COMMITS; do\n MSG=$(git log --format=%B -n 1 $c | head -1);\n AUTH=$(git log --format=\"%an\" -n 1 $c);\n DATE=$(git log --format=\"%ar\" -n 1 $c);\n echo \"═══════════════════════════════════════════════════════════════════\";\n echo \"Commit $i of $COUNT\";\n echo \"═══════════════════════════════════════════════════════════════════\";\n echo \"Commit: $c\";\n echo \"Author: $AUTH\";\n echo \"Date: $DATE\";\n echo \"Message: $MSG\";\n echo;\n git diff $c^..$c;\n echo;\n echo \"───────────────────────────────────────────────────────────────────\";\n if [ $i -lt $COUNT ]; then\n printf \"Press Enter to continue to next commit...\";\n read -r dummy < /dev/tty;\n echo;\n else\n echo \"Review complete!\";\n fi;\n i=$((i + 1));\n done;\n}; f"
wl = worktree list
wr = worktree remove
wta = "!f() {\n branch=\"$1\";\n repo=$(basename $(git worktree list --porcelain | grep -m1 \"^worktree\" | cut -d\" \" -f2));\n parent=$(dirname $(git worktree list --porcelain | grep -m1 \"^worktree\" | cut -d\" \" -f2));\n safe=$(echo \"$branch\" | tr \"/\" \"-\");\n worktree_path=\"${parent}/${repo}-${safe}\";\n if git show-ref --verify --quiet refs/heads/\"${branch}\"; then\n git worktree add \"${worktree_path}\" \"${branch}\";\n elif git show-ref --verify --quiet refs/remotes/origin/\"${branch}\"; then\n git worktree add -b \"${branch}\" \"${worktree_path}\" \"origin/${branch}\";\n else\n git worktree add -b \"${branch}\" \"${worktree_path}\" origin/HEAD;\n fi && printf \"Worktree created at: %s\\n\" \"$(echo \"${worktree_path}\" | sed \"s|^$HOME|~|\")\";\n}; f"
[checkout]
defaultRemote = origin
[core]
Expand Down
46 changes: 27 additions & 19 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,7 @@ on:
branches:
- $GITHUB_BASE_REF
#if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
paths:
- '.github/workflows/pre-commit.yml'
- '.pre-commit-config.yaml'
pull_request:
paths:
- '.github/workflows/pre-commit.yml'
- '.pre-commit-config.yaml'

# from the example here:
# https://docs.github.com/en/actions/examples/using-scripts-to-test-your-code-on-a-runner#example-workflow
Expand Down Expand Up @@ -101,6 +95,8 @@ jobs:

lint:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
env:
Expand All @@ -109,7 +105,7 @@ jobs:
fetch-depth: $CHECKOUT_DEPTH

- name: MegaLinter
uses: oxsecurity/megalinter/flavors/cupcake@7e042c726c68415475b05a65a686c612120a1232 # v7.7.0
uses: oxsecurity/megalinter/flavors/cupcake@55a59b24a441e0e1943080d4a512d827710d4a9d # v9.2.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MEGALINTER_CONFIG: ci/.mega-linter.yaml
Expand Down Expand Up @@ -152,15 +148,21 @@ jobs:
check-latest: true

- name: Install python
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
with:
python-version: '3.11'
python-version: '3.12'

- name: Run pre-commit on all files
uses: pre-commit/action@646c83fcd040023954eafda54b4db0192ce70507 # v3.0.0
- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
# this should run the pre-commit hooks only on the files changed between the default branch and the one in the PR
extra_args: --verbose -a
path: ~/.cache/pre-commit
# Key includes python version and config hash to invalidate cache on changes
key: pre-commit-3|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}

- name: Install pre-commit
run: pip install pre-commit

- name: Run pre-commit
run: pre-commit run --show-diff-on-failure --color=always --all-files --verbose

pre-commit:
if: (!github.event.act)
Expand All @@ -174,15 +176,21 @@ jobs:
fetch-depth: $CHECKOUT_DEPTH

- name: Install python
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
with:
python-version: '3.11'
python-version: '3.12'

- name: Run pre-commit
uses: pre-commit/action@646c83fcd040023954eafda54b4db0192ce70507 # v3.0.0
- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
# this should run the pre-commit hooks only on the files changed between the default branch and the one in the PR
extra_args: --verbose --from-ref ${{ needs.get-changed-files.outputs.BASE_REF }} --to-ref HEAD
path: ~/.cache/pre-commit
# Key includes python version and config hash to invalidate cache on changes
key: pre-commit-3|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}

- name: Install pre-commit
run: pip install pre-commit

- name: Run pre-commit
run: pre-commit run --show-diff-on-failure --color=always --all-files --verbose

check-zshrc:
runs-on: ubuntu-latest
Expand Down
14 changes: 14 additions & 0 deletions .shellrc.d/base
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,17 @@ grep -q 10 /proc/sys/vm/swappiness || {
vm.swappiness = 10
EOF
}

for ssh_socket_file in \
"${HOME}/.1password/agent.sock" \
"${HOME}/.bitwarden-ssh-agent.sock" \
"${HOME}/snap/bitwarden/current/.bitwarden-ssh-agent.sock" \
"${HOME}/.keeper-ssh-agent.sock" \
; do
if [[ -S "${ssh_socket_file}" ]]; then
# the default is 'export SSH_AUTH_SOCK=/run/user/1000/keyring/ssh'
# but use a password manager's socket file if it exists
export SSH_AUTH_SOCK="${ssh_socket_file}"
break
fi
done
4 changes: 2 additions & 2 deletions .shellrc.d/functions/blueconnect
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ blueconnect() {
#amixer -D pulse sset Master mute
bluetoothctl disconnect;
}
if bluetoothctl connect $(bluetoothctl paired-devices | awk "tolower(\$0) ~ /${device}/ { print \$2 }"); then
if bluetoothctl connect $(bluetoothctl devices | awk "tolower(\$0) ~ /${device}/ { print \$2 }"); then
[[ "${bluetooth_versions[${bluetooth_version}]%%.*}" -lt 5 ]] && {
echo "turning volume back up..."
#sleep 3
Expand All @@ -73,7 +73,7 @@ _blueconnect_completions() {
if [[ "${#COMP_WORDS[@]}" -gt 2 ]]; then
if [[ "${COMP_WORDS[1]}" =~ ^file$ ]]; then
# output into columns all files tracked in the ${HOME_DIR} repo
VALUES="$(bluetoothctl paired-devices | cut -d' ' -f3-)"
VALUES="$(bluetoothctl devices | cut -d' ' -f3-)"
fi
elif [[ "${#COMP_WORDS[@]}" -eq 2 ]]; then
# ${#COMP_WORDS} starts off at 2, so we're at the initial [Tab]
Expand Down
7 changes: 3 additions & 4 deletions .shellrc.d/functions/rsync-with-progress
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ rsync-with-progress() {
--recursive
--links
--perms
--times
--group
--owner
--devices
Expand All @@ -86,8 +87,6 @@ rsync-with-progress() {
--hard-links
--exclude='.trashed-*'
--sparse
--no-times
--size-only
)
declare -a RSYNC_FLAGS_NEGATIONS=(
)
Expand Down Expand Up @@ -271,8 +270,8 @@ rsync-with-progress() {
time ${SUDO} rsync "${RSYNC_FLAGS[@]}" "${SRC}" "${DST}" | pv --eta --line-mode --progress --size "${file_count}"
}

# echo -n "do you want to skip updating times? [Y/n] "; read
# [[ ${REPLY} =~ ^n$ ]] || rsync_flags+=" --size-only"
echo -n "do you want to skip updating times? [Y/n] "; read
[[ ${REPLY} =~ ^n$ ]] || RSYNC_FLAGS+=(--size-only)


if has pv && [[ ${PV_METHOD} -eq 1 && "${file_count}" -le 100 ]]; then
Expand Down
24 changes: 16 additions & 8 deletions .vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,11 @@ set history=4000 " hi; allow for ample command history
":so ~/.vim/extenders/.vim.wrap
":so ~/.vim/extenders/.vim.loadtemplate

set term=xterm " needed for the colorscheme to show as more bold and vibrant than 'screen.xterm-256color'
colorscheme ron
if version < 901
" this block restricts the situations in which the following options are enabled
set term=xterm " needed for the colorscheme to show as more bold and vibrant than 'screen.xterm-256color'
colorscheme ron
endif

syntax sync minlines=50 " ensure vim doesn't keep changing syntax highlighting; from <http://vim.wikia.com/wiki/Fix_Syntax_Highlighting>

Expand Down Expand Up @@ -332,9 +335,13 @@ nnoremap <C-H> <C-W><C-H>
"
" automatically install vim-plug
" <https://github.com/junegunn/vim-plug/wiki/tips#automatic-installation>
let data_dir = has('nvim') ? stdpath('data') . '/site' : s:vim_home_dir
if empty(glob(data_dir . '/autoload/plug.vim'))
exe system('curl -fLo "' . s:vim_home_dir . '/autoload/plug.vim" --create-dirs
let data_dir = has('nvim') ? stdpath('data') . '/site/autoload' : s:vim_home_dir
if empty(data_dir)
exe system('mkdir -p ' . data_dir)
endif

if empty(glob(data_dir . '/plug.vim'))
exe system('curl -sfLo "' . data_dir . '/plug.vim" --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim')
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
Expand All @@ -344,7 +351,7 @@ endif

" plugins:
" https://vimawesome.com/
call plug#begin(s:vim_home_dir . '/plugged')
call plug#begin(data_dir . '/plugged')
" Plug 'airblade/vim-gitgutter' "
" Plug 'AndrewRadev/linediff.vim' "
" Plug 'arp242/undofile_warn.vim' "
Expand All @@ -354,8 +361,10 @@ call plug#begin(s:vim_home_dir . '/plugged')
Plug 'ekalinin/Dockerfile.vim' " adds syntax highlighting for Dockerfiles
" Plug 'ervandew/supertab' " smart tab completion (old)
Plug 'fatih/vim-go', { 'do': ':GoInstallBinaries', 'frozen': 'true' } " go development
" Plug 'glts/vim-textobj-comment' "
Plug 'hashivim/vim-terraform' " syntax highlighting for terraform
" Plug 'https://github.com/ElmCast/elm-vim' "
Plug 'github/copilot.vim' "
Plug 'https://github.com/fevrin/AnsiEsc.vim', { 'frozen': 'true' } " converts ANSI escape codes to colors
" Plug 'inkarkat/vim-AdvancedDiffOptions' "
" Plug 'inkarkat/vim-ConflictMotions' " older conflict marker jumper
Expand All @@ -364,7 +373,6 @@ call plug#begin(s:vim_home_dir . '/plugged')
" Plug 'junegunn/fzf.vim' "
Plug 'junegunn/vim-easy-align' " easily align lines based on a common character expression
" Plug 'kana/vim-textobj-user' "
" Plug 'glts/vim-textobj-comment' "
" Plug 'Konfekt/FastFold' " fixes slow folding
" Plug 'mbbill/undotree' " lets you visualize a file's undo history
" Plug 'mhinz/vim-signify' "
Expand Down Expand Up @@ -395,9 +403,9 @@ call plug#begin(s:vim_home_dir . '/plugged')
" Plug 'tpope/vim-surround' " adds commands for surrounding arbitrary text with tags, quotes, etc.
Plug 'tpope/vim-unimpaired' " add handy mappings for toggling options, jumping, formatting, etc.
" Plug 'vim-airline/vim-airline' "
" Plug 'Vimjas/vim-python-pep8-indent' " make python code comply with PEP8 recommendation
" Plug 'vim-scripts/vcscommand.vim' "
" Plug 'vim-syntastic/syntastic' " code syntax checker
" Plug 'Vimjas/vim-python-pep8-indent' " make python code comply with PEP8 recommendation
Plug 'vito/booklit.vim' " syntax highlighting for Booklit files
" Plug 'ycm-core/YouCompleteMe' " speedy code completion, comprehension, and refactoring engine
" Plug 'yggdroot/indentline' "
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ifeq ($(notdir $(CURDIR)), .ssh)

@if [ -d $(DIR) ]; then \
cp -ai $(TEMPLATE) $(CONFIG_FILE); \
$(info going through all Include lines and replace them with the file contents) \
$(info going through all Include lines and replacing them with the file contents) \
for line in $(shell grep -n Include $(TEMPLATE) | sed -re 's;Include ;;' | sort -r); do \
lineno=$${line%%:*}; \
file=$${line##*:}; \
Expand Down Expand Up @@ -52,7 +52,7 @@ ifeq ($(notdir $(CURDIR)), .gitconfig.d)

@if [ -d $(DIR) ]; then \
cp -ai $(TEMPLATE) $(CONFIG_FILE); \
$(info going through all 'include' lines and replace them with the file contents) \
$(info going through all 'include' lines and replacing them with the file contents) \
for line in $(shell grep -n ^include $(TEMPLATE) | sed -re 's;^include ;;' | sort -r); do \
lineno=$${line%%:*}; \
file=$${line##*:}; \
Expand Down Expand Up @@ -217,7 +217,7 @@ lint-cleanup: ## Linting: Clean up any leftover docker continers from linting
-@echo '=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-='
-@echo
-for container in $$(docker container ls -a --format='{{.Names}}' | grep -E '^act-'); do \
docker container stop "$${container}"; \
docker container stop --signal 9 "$${container}"; \
docker container rm "$${container}"; \
done && \
for volume in $$(docker volume ls --format='{{.Name}}' | grep -E '^act-'); do \
Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ To run a specific job:

gh act --rm -j lint -W .github/workflows/pre-commit.yml

To run jobs that use `actions/upload-artifact` and `actions/download-artifact`:

gh act --artifact-server-path /tmp/artifacts -W .github/workflows/pre-commit.yml

### Local `pre-commit` linting

If `pip` is installed, `make pre-commit` will run all `pre-commit` hooks on all changed files. Note, however, that the `pre-commit` linting is a
Expand Down Expand Up @@ -116,6 +120,6 @@ done
```


[install `gh`]: https://github.com/cli/cli#installation
[install `nektos/act`]: https://github.com/nektos/act#installation
[install `gh`]: https://github.com/cli/cli/blob/trunk/docs/install_linux.md#debian-ubuntu-linux-raspberry-pi-os-apt
[install `nektos/act`]: https://nektosact.com/installation/gh.html
[install docker]: https://docs.docker.com/get-docker/
8 changes: 6 additions & 2 deletions README.md.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ To run a specific job:

gh act --rm -j lint -W .github/workflows/pre-commit.yml

To run jobs that use `actions/upload-artifact` and `actions/download-artifact`:

gh act --artifact-server-path /tmp/artifacts -W .github/workflows/pre-commit.yml

### Local `pre-commit` linting

If `pip` is installed, `make pre-commit` will run all `pre-commit` hooks on all changed files. Note, however, that the `pre-commit` linting is a
Expand Down Expand Up @@ -89,6 +93,6 @@ done
```


[install `gh`]: https://github.com/cli/cli#installation
[install `nektos/act`]: https://github.com/nektos/act#installation
[install `gh`]: https://github.com/cli/cli/blob/trunk/docs/install_linux.md#debian-ubuntu-linux-raspberry-pi-os-apt
[install `nektos/act`]: https://nektosact.com/installation/gh.html
[install docker]: https://docs.docker.com/get-docker/
56 changes: 0 additions & 56 deletions ci/.cspell.json

This file was deleted.

2 changes: 1 addition & 1 deletion ci/.mega-linter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ MARKDOWN_MARKDOWNLINT_CONFIG_FILE: ci/.markdownlint.yaml
REPOSITORY_CHECKOV_ARGUMENTS: '--skip-check CKV_GHA_7'
REPOSITORY_CHECKOV_CONFIG_FILE: ci/.checkov.yaml

SPELL_CSPELL_CONFIG_FILE: ci/.cspell.json
SPELL_CSPELL_CONFIG_FILE: ci/cspell.yaml

SPELL_LYCHEE_CONFIG_FILE: ci/lychee.toml

Expand Down
Loading