Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 4 additions & 1 deletion .bash_profile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Source .bashrc
[[ -f ~/.bashrc ]] && . ~/.bashrc
. "/home/pol/.local/share/cargo/env"

_cargo_env="${CARGO_HOME:-${XDG_DATA_HOME:-$HOME/.local/share}/cargo}/env"
[ -r "$_cargo_env" ] && . "$_cargo_env"
unset _cargo_env
5 changes: 4 additions & 1 deletion .bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,7 @@ if [ -f "$_zshdir/functions" ]; then
source "$_zshdir/functions"
fi
unset _zshdir
. "/home/pol/.local/share/cargo/env"

_cargo_env="${CARGO_HOME:-${XDG_DATA_HOME:-$HOME/.local/share}/cargo}/env"
[ -r "$_cargo_env" ] && . "$_cargo_env"
unset _cargo_env
2 changes: 1 addition & 1 deletion .config/nvidia/.nvidia-settings-rc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# /home/pol/.nvidia-settings-rc
# ~/.nvidia-settings-rc
#
# Configuration file for nvidia-settings - the NVIDIA X Server Settings utility
# Generated on Sun Aug 9 23:07:26 2020
Expand Down
54 changes: 54 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,57 @@ jobs:

- name: Run lint
run: bash .local/scripts/lint.sh

hardcoded-paths:
name: Hardcoded user paths
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: false

- name: Scan for /home/<user>/ and /Users/<user>/ in tracked files
run: |
# Fail on any tracked file containing an absolute /home/<user>/ or
# /Users/<user>/ path. Excludes:
# - documentation (*.md, SECURITY.md, .gitignore) where examples are fine
# - configs that are intentionally per-user runtime state and would
# otherwise need to be re-removed from git on every machine
if git grep -InE '(/home/[a-z][a-z0-9_-]*/|/Users/[a-z][a-z0-9_-]*/)' \
-- ':!*.md' \
':!.gitignore' \
':!SECURITY.md' \
':!.config/warp-terminal/user_preferences.json' \
':!.config/birdtray-config.json' \
':!.config/texstudio/texstudio.ini' \
':!.config/texstudio/cache/' \
':!.config/texstudio/dictionaries/' \
':!.cinnamon/backgrounds/user-folders.lst' \
':!.config/cinnamon/dark/gnome.dconf' \
':!.config/cinnamon/light/gnome.dconf' \
':!.config/.p10k.zsh' \
':!.config/zsh/.p10k.zsh' \
':!.config/vlc/vlc-qt-interface.conf' \
':!.vim/.netrwhist' \
':!.local/scripts/bootstrap/arch_functions'; then
echo ""
echo "ERROR: hardcoded user paths found in tracked files (see above)."
echo "Use \$HOME, ~/, or XDG variables instead."
exit 1
fi

stow-dryrun:
name: Stow dry-run
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: false

- name: Install stow
run: sudo apt-get update && sudo apt-get install -y stow

- name: Dry-run stow into a scratch HOME
run: |
scratch="$(mktemp -d)"
make dry-run TARGET="$scratch"
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
# Standalone files in .config/
!.config/.p10k.zsh
!.config/.git-prompt-colors.sh
!.config/birdtray-config.json
# birdtray-config.json contains per-user Thunderbird mailbox paths — don't track
!.config/emacs.org
!.config/inputrc
!.config/stick
Expand Down Expand Up @@ -309,6 +309,10 @@
.config/texstudio/packageCache.dat
.config/texstudio/template_resources.xml
.config/texstudio/wordCount.usage
# texstudio.ini holds recent-files/last-document with absolute per-user paths;
# cache/ holds per-document JSON also with absolute paths
.config/texstudio/cache/
.config/texstudio/texstudio.ini

# LibreOffice runtime
.config/libreoffice/4/user/GraphicsRenderTests.log
Expand Down Expand Up @@ -338,6 +342,10 @@

# Cinnamon runtime
.cinnamon/spices.cache
# Cinnamon dconf dumps regenerate on every login with absolute /home/<user>/ paths
.cinnamon/backgrounds/user-folders.lst
.config/cinnamon/dark/gnome.dconf
.config/cinnamon/light/gnome.dconf

# Distro (generated by bootstrap scripts)
.config/distro
3 changes: 2 additions & 1 deletion .local/Mini/.bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ pull() {

for i in "${!pids[@]}"; do
local pid="${pids[$i]}" repo="${repos[$i]}"
local outfile="$tmpdir/$(echo "$repo" | tr '/' '_').out"
local outfile
outfile="$tmpdir/$(echo "$repo" | tr '/' '_').out"
if wait "$pid"; then
printf "\033[32m✓ %s\033[0m\n" "$repo"
else
Expand Down
5 changes: 3 additions & 2 deletions .local/scripts/bin/git-recurse
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ function git_recursive() {
for i in "${!pids[@]}"; do
local pid=${pids[$i]}
local dir=${dirs[$i]}
local outfile="$tmpdir/$(echo "$dir" | tr '/' '_').out"
local outfile
outfile="$tmpdir/$(echo "$dir" | tr '/' '_').out"
local status=0
wait "$pid" || status=$?

Expand All @@ -75,7 +76,7 @@ function git_recursive() {
if [[ -s "$outfile" ]]; then
sed 's/^/ /' "$outfile"
else
printf " ${dim}(no output)${reset}\n"
printf " %s(no output)%s\n" "$dim" "$reset"
fi
done

Expand Down
8 changes: 5 additions & 3 deletions .local/scripts/bootstrap/base_functions
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,11 @@ apply_skip_worktree() {
info "Applying skip-worktree to volatile config files..."
for f in "${files[@]}"; do
if [ -f "$dotfiles_root/$f" ]; then
git -C "$dotfiles_root" update-index --skip-worktree "$f" \
&& info " skip-worktree: $f" \
|| warn " Could not apply skip-worktree to $f"
if git -C "$dotfiles_root" update-index --skip-worktree "$f"; then
info " skip-worktree: $f"
else
warn " Could not apply skip-worktree to $f"
fi
else
info " Skipping (not yet present): $f"
fi
Expand Down
43 changes: 22 additions & 21 deletions .vim/vimrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
" General {{{

" Leader key for custom key combinations
let mapleader=" "
let mapleader=' '
" Activate folds
set foldmethod=marker

Expand Down Expand Up @@ -80,18 +80,18 @@ Plug 'ycm-core/YouCompleteMe'
call plug#end()
"Acaben els plugins
autocmd! User vim-which-key call which_key#register('<Space>', 'g:which_key_map')
let g:UltiSnipsExpandTrigger="<S-e>" " insert snippet !!
let g:UltiSnipsJumpForwardTrigger="<c-b>"
let g:UltiSnipsJumpBackwardTrigger="<c-z>"
let g:UltiSnipsExpandTrigger='<S-e>' " insert snippet !!
let g:UltiSnipsJumpForwardTrigger='<c-b>'
let g:UltiSnipsJumpBackwardTrigger='<c-z>'

"Configuracions del plugin YouCompleteMe
let g:ycm_confirm_extra_conf = 0 "Disables prompting for script every time

if has('unix')
let g:ycm_clangd_binary_path = exepath("clangd")
let g:ycm_clangd_binary_path = exepath('clangd')
endif
if has('macunix')
let g:ycm_clangd_binary_path = exepath("clangd")
let g:ycm_clangd_binary_path = exepath('clangd')
endif

let g:ycm_autoclose_preview_window_after_insertion = 1
Expand Down Expand Up @@ -136,14 +136,14 @@ set mouse=a
autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o

" Set 4 lines to the cursor - when moving vertically using j/k
set so=4 " margin
set scrolloff=4 " margin

" Turn on the Wild menu, better autocompletion
set wildmenu

" Ignore compiled files
set wildignore=*.o,*~,*.pyc
if has("win16") || has("win32")
if has('win16') || has('win32')
set wildignore+=.git\*,.hg\*,.svn\*
else
set wildignore+=*/.git/*,*/.hg/*,*/.svn/*,*/.DS_Store
Expand Down Expand Up @@ -211,18 +211,18 @@ let g:which_key_map.f = { 'name' : '+file' }

" Use 24-bit (true-color) mode in Vim/Neovim when outside tmux IN LINUX, ( do not remove. )
if (empty($TMUX))
if (has("nvim"))
if (has('nvim'))
let $NVIM_TUI_ENABLE_TRUE_COLOR=1
endif
if (has("termguicolors"))
if (has('termguicolors'))
set termguicolors
endif
endif

" set t_Co=256

if exists('$TMUX')
if (has("nvim"))
if (has('nvim'))
set termguicolors " Nvim colors look good on tmux with this
else
endif
Expand All @@ -240,19 +240,20 @@ syntax on

" Set utf8 as standard encoding and en_US as the standard language
set encoding=utf8
scriptencoding utf-8
set fileencoding=utf-8

" Configuració per a vim-airline
let g:airline#extensions#tabline#enabled = 1 "fica automaticament els buffers a la barreta

" Use Unix as the standard file type
set ffs=unix,dos,mac
set fileformats=unix,dos,mac

" :help updatetime
set updatetime=1500

" Set font for gvim
if has("gui_running")
if has('gui_running')
set guifont=SauceCodePro\ Nerd\ Font\ 11
endif
" }}}
Expand Down Expand Up @@ -283,11 +284,11 @@ set shiftwidth=4
set tabstop=4

" Linebreak on 500 characters
set lbr
set tw=500
set linebreak
set textwidth=500

set ai "Auto indent
set si "Smart indent
set autoindent "Auto indent
set smartindent "Smart indent
set wrap "Wrap lines
set breakindent "Indent after line wrapped
"}}}
Expand All @@ -296,14 +297,14 @@ set breakindent "Indent after line wrapped
nmap <leader>tt :TagbarToggle<CR>
function! GotoJump()
jumps
let j = input("Please select your jump: ")
let j = input('Please select your jump: ')
if j != ''
let pattern = '\v\c^\+'
if j =~ pattern
let j = substitute(j, pattern, '', 'g')
execute "normal " . j . "\<c-i>"
execute 'normal ' . j . "\<c-i>"
else
execute "normal " . j . "\<c-o>"
execute 'normal ' . j . "\<c-o>"
endif
endif
endfunction
Expand Down Expand Up @@ -449,7 +450,7 @@ map <leader>? z=
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Nerd Tree
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let g:NERDTreeWinPos = "right"
let g:NERDTreeWinPos = 'right'
let NERDTreeShowHidden=0
let g:NERDTreeWinSize=35
""""""""""""""""""""""""""""""
Expand Down
10 changes: 9 additions & 1 deletion .zshenv
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,18 @@ export ADB_VENDOR_KEY="$XDG_CONFIG_HOME"/android
export GTK_RC_FILES="$XDG_CONFIG_HOME"/gtk-1.0/gtkrc
export GTK2_RC_FILES="$XDG_CONFIG_HOME"/gtk-2.0/gtkrc

###############################################################
# => Cargo (sourced before local overrides so they can adjust it)
###############################################################

_cargo_env="${CARGO_HOME:-${XDG_DATA_HOME:-$HOME/.local/share}/cargo}/env"
# shellcheck disable=SC1090
[ -r "$_cargo_env" ] && . "$_cargo_env"
unset _cargo_env

###############################################################
# => Local overrides (machine-specific, not tracked by git)
###############################################################

# shellcheck disable=SC1091
[ -r "$HOME/.zshenv.local" ] && source "$HOME/.zshenv.local"
. "/home/pol/.local/share/cargo/env"
12 changes: 11 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ STOW := stow
STOW_DIR := $(shell pwd)
TARGET := $(HOME)

.PHONY: help install uninstall restow dry-run lint check hooks update submodules antigen-update skip-worktree bootstrap-arch bootstrap-manjaro bootstrap-ubuntu bootstrap-mac bootstrap-work
.PHONY: help install uninstall restow dry-run lint check fix hooks update submodules antigen-update skip-worktree bootstrap-arch bootstrap-manjaro bootstrap-ubuntu bootstrap-mac bootstrap-work

help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*##' $(MAKEFILE_LIST) | \
Expand Down Expand Up @@ -55,6 +55,16 @@ check: lint ## Run all linters (shellcheck + markdownlint + vint)
@echo ""
@echo "==> All checks complete."

fix: ## Auto-fix markdown issues (markdownlint --fix)
@if command -v markdownlint-cli2 >/dev/null 2>&1; then \
markdownlint-cli2 --fix README.md .local/README.md .local/xdg/wallpapers/README.md; \
elif command -v markdownlint >/dev/null 2>&1; then \
markdownlint --fix README.md .local/README.md .local/xdg/wallpapers/README.md; \
else \
echo "markdownlint not found (npm install -g markdownlint-cli2)"; \
exit 1; \
fi

hooks: ## Install git pre-commit hook (runs shellcheck on staged files)
cp .local/scripts/hooks/pre-commit .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ Opinionated defaults. This repo is not meant to be used by everyone, just a pers
## How it works

### Why `dotfiles/dotfiles`?
You might wonder why the repository isn't just cloned directly into `~/dotfiles`. The nested `~/dotfiles/dotfiles` structure is required by how **[GNU Stow](https://www.gnu.org/software/stow/)** manages packages. Stow expects a "stow directory" (the parent, `~/dotfiles`) containing one or more "packages" (the child, `dotfiles`, which is this repo).

You might wonder why the repository isn't just cloned directly into `~/dotfiles`. The nested `~/dotfiles/dotfiles` structure is required by how **[GNU Stow](https://www.gnu.org/software/stow/)** manages packages. Stow expects a "stow directory" (the parent, `~/dotfiles`) containing one or more "packages" (the child, `dotfiles`, which is this repo).

By cloning into `~/dotfiles/dotfiles`, stow correctly treats the inner `dotfiles` folder as the package name, allowing it to safely symlink the contents (like `.config/`, `.vim/`) directly into your `$HOME` directory without confusing the repository root with the target deployment.

Expand Down Expand Up @@ -140,7 +141,7 @@ scripts directory.
## What's inside

| Category | Tool / Config | Notes |
|---|---|---|
| --- | --- | --- |
| **Shells** | zsh (antigen, p10k), bash | XDG-compliant `$ZDOTDIR` in `.config/zsh/` |
| **Editors** | Vim, Neovim, Doom Emacs, personal Emacs (chemacs) | Vim config at `.vim/vimrc`; Emacs literate config in `.config/emacs.org` |
| **Terminals** | kitty, Alacritty, termite | |
Expand Down
Loading