Compare commits

...

6 Commits

7 changed files with 182 additions and 10 deletions

View File

@@ -44,12 +44,12 @@ repos:
- id: shfmt
- repo: https://github.com/rhysd/actionlint
rev: v1.7.6
rev: v1.7.7
hooks:
- id: actionlint
- repo: https://github.com/renovatebot/pre-commit-hooks
rev: 39.107.2
rev: 39.117.2
hooks:
- id: renovate-config-validator

View File

@@ -43,6 +43,14 @@ automatically-unhide-macos-hidden-apps = true
if.app-name-regex-substring = 'settings' # All settings
run = ['layout floating']
[[on-window-detected]]
if.app-id = 'com.apple.systempreferences' # macOS System Preferences
run = ['layout floating']
[[on-window-detected]]
if.app-id = 'com.1password.1password' # 1Password
run = ['layout floating']
[[on-window-detected]]
if.app-id = 'org.ferdium.ferdium-app' # Ferdium, has WhatsApp etc.
run = ['layout floating']
@@ -52,7 +60,7 @@ if.app-id = 'com.apple.finder' # Finder
run = ['layout floating']
[[on-window-detected]]
if.app-id = 'com.apple.Preview'
if.app-id = 'com.apple.Preview' # Preview
run = ['layout floating']
[[on-window-detected]]
@@ -91,6 +99,19 @@ run = ['layout floating']
if.app-id = 'com.tinyspeck.slackmacgap' # Slack
run = ['layout floating']
[[on-window-detected]]
if.app-id = 'md.obsidia' # Obsidian
run = ['layout floating']
[[on-window-detected]]
if.app-id = 'com.todoist.mac.Todoist' # Todoist
run = ['layout floating']
[[on-window-detected]]
if.app-id = 'com.apple.backup.launcher' # TimeMachine
run = ['layout floating']
# Possible values: (qwerty|dvorak)
# See https://nikitabobko.github.io/AeroSpace/guide#key-mapping
[key-mapping]
@@ -117,6 +138,9 @@ outer.left = 0
# Fallback value (if you omit the key): mode.main.binding = {}
[mode.main.binding]
cmd-h = [] # Disable "hide application"
cmd-alt-h = [] # Disable "hide others"
# All possible keys:
# - Letters. a, b, c, ..., z
# - Numbers. 0, 1, 2, ..., 9
@@ -154,10 +178,10 @@ alt-l = 'focus right'
# See: https://nikitabobko.github.io/AeroSpace/commands#workspace
alt-shift-1 = 'workspace 1' # Main
alt-shift-2 = 'workspace 2' # Media
ctrl-shift-1 = 'move-node-to-workspace 1'
ctrl-shift-2 = 'move-node-to-workspace 2'
ctrl-shift-1 = 'move-node-to-workspace 1' # Move node to Main
ctrl-shift-2 = 'move-node-to-workspace 2' # Move node to Media
alt-shift-tab = 'workspace-back-and-forth'
alt-shift-tab = 'workspace-back-and-forth' # Switch between workspaces
ctrl-shift-tab = 'move-workspace-to-monitor --wrap-around prev'
# See: https://nikitabobko.github.io/AeroSpace/commands#mode

View File

@@ -2,4 +2,9 @@ default_session = "main"
[[search_dirs]]
path = "~/Code"
depth = 10
depth = 3
[picker_colors]
highlight_color = "#21202e"
highlight_text_color = "#86e1fc"
border_color = "#524f67"

52
docs/alias.md Normal file
View File

@@ -0,0 +1,52 @@
# Alias Commands
This file lists all aliases defined in `config/alias`.
| Alias | Command |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| `....` | `cd ../../..` |
| `...` | `cd ../..` |
| `..` | `cd ..` |
| `.` | `cd $HOME` |
| `.b` | `cd $XDG_BIN_HOME` |
| `.c` | `cd $HOME/Code` |
| `.d` | `cd $DOTFILES` |
| `.l` | `cd $HOME/.local` |
| `.o` | `cd $HOME/Code/ivuorinen/obsidian/` |
| `art` | `[ -f artisan ] && php artisan \|\| php vendor/bin/artisan` |
| `cd..` | `cd ..` |
| `cdgr` | `cd "$(get_git_root)"` |
| `dn` | `du -chd1` |
| `flush` | `dscacheutil -flushcache` |
| `grep` | `grep --color` |
| `hide` | `defaults write com.apple.finder AppleShowAllFiles -bool false; killall Finder` |
| `ips` | `ifconfig -a \| grep -o 'inet6\? \(\([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+\)\\|[a-fA-F0-9:]\+\)' \| sed -e 's/inet6* //' \| sort` |
| `irssi` | `irssi --config=$XDG_CONFIG_HOME/irssi/config --home=$XDG_CONFIG_HOME/irssi` |
| `isodate` | `date +'%Y-%m-%d'` |
| `l` | `ls -a` |
| `ll` | `ls -la` |
| `localip` | `ipconfig getifaddr en1` |
| `mirror_site` | `wget -m -k -K -E -e robots=off` |
| `peek` | `tee >(cat 1>&2)` |
| `pubkey` | `more ~/.ssh/id_rsa.pub \| pbcopy \| echo '=> Public key copied to pasteboard.'` |
| `sail` | `[ -f sail ] && bash sail \|\| bash vendor/bin/sail` |
| `show` | `defaults write com.apple.finder AppleShowAllFiles -bool true; killall Finder` |
| `sl` | `ls` |
| `svn` | `svn --config-dir $XDG_CONFIG_HOME/subversion` |
| `trivy_scan` | `docker run -v /var/run/docker.sock:/var/run/docker.sock -v $HOME/Library/Caches:/root/.cache/ aquasec/trivy` |
| `updatedb` | `sudo /usr/libexec/locate.updatedb` |
| `vi` | `nvim` |
| `vim` | `nvim` |
| `watchx` | `watch -dpbc` |
| `wget` | `wget --hsts-file=$XDG_DATA_HOME/wget-hsts` |
| `x-datetime` | `date +'%Y-%m-%d %H:%M:%S'` |
| `x-ip` | `dig +short myip.opendns.com @resolver1.opendns.com` |
| `x-timestamp` | `date +'%s'` |
| `xdg` | `xdg-ninja --skip-ok --skip-unsupported` |
| `zapall` | `zapds && zappyc` |
| `zapds` | `find . -name ".DS_Store" -print -delete` |
| `zappyc` | `find . -type f -name '*.pyc' -ls -delete` |
| `zedit` | `$EDITOR ~/.dotfiles` |
Total aliases: 43
Last updated: Fri 17 Jan 2025 13:06:59 EET

View File

@@ -26,7 +26,7 @@ msgr nested "Change user shell to zsh if it is available and not the current"
# Change user shell to zsh if not that already.
if hash zsh 2> /dev/null; then
[[ "$SHELL" != $(which zsh) ]] && chsh -s "$(which zsh)"
[[ $SHELL != $(which zsh) ]] && chsh -s "$(which zsh)"
fi
###############################################################################
@@ -150,7 +150,7 @@ msgr nested "Settings for Finder"
# Set Desktop as the default location for new Finder windows
# For other paths, use `PfLo` and `file:///full/path/here/`
defaults write com.apple.finder NewWindowTarget -string "PfDe"
defaults write com.apple.finder NewWindowTargetPath -string "file://${HOME}/Desktop/"
defaults write com.apple.finder NewWindowTargetPath -string "file://${HOME}/"
# Show icons for external hard drives, servers, and removable media on the desktop
defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool true
@@ -201,6 +201,10 @@ defaults write com.apple.finder FXInfoPanesExpanded -dict \
OpenWith -bool true \
Privileges -bool true
# Move windows by dragging any part of the window
# From https://nikitabobko.github.io/AeroSpace/goodies
defaults write -g NSWindowShouldDragOnGesture -bool true
###############################################################################
# Screenshots #
###############################################################################

View File

@@ -0,0 +1,86 @@
#!/usr/bin/env bash
# update-readme-aliases.sh
# @description Update alias documentation in $DOTFILES/docs/alias.md
#
# Author: Ismo Vuorinen <https://github.com/ivuorinen> 2025
# License: MIT
set -euo pipefail
# Paths
ALIAS_FILE="$DOTFILES/config/alias"
OUTPUT_FILE="$DOTFILES/docs/alias.md"
# Check if alias file exists
if [[ ! -f $ALIAS_FILE ]]; then
echo "Alias file not found: $ALIAS_FILE"
exit 1
fi
# Declare associative array
declare -a alias_table
echo "Parsing aliases..."
while IFS= read -r line; do
# Skip all lines that do not start with 'alias'
if [[ ! $line =~ ^alias\ ]]; then
continue
fi
# Split alias and command and handle both ' and "
if [[ $line =~ ^alias\ ([^=]+)=[\'\"](.*)[\'\"]$ ]]; then
alias_name="${BASH_REMATCH[1]}"
alias_command="${BASH_REMATCH[2]//|/\\|}" # fix markdown table separator
# Save alias to table
alias_table+=("\`$alias_name\`␟\`$alias_command\`")
else
echo "Warning: Could not parse line: $line"
fi
done < "$ALIAS_FILE"
# Sort array by alias name
# shellcheck disable=SC2207
IFS=$'\n' sorted_aliases=($(sort <<< "${alias_table[*]}"))
unset IFS
# Calculate cell max lengths
max_alias_length=5 # "Alias" min length
max_command_length=7 # "Command" min length
for entry in "${sorted_aliases[@]}"; do
IFS=$'␟' read -r alias_name alias_command <<< "$entry"
max_alias_length=$((${#alias_name} > max_alias_length ? ${#alias_name} : max_alias_length))
max_command_length=$((${#alias_command} > max_command_length ? ${#alias_command} : max_command_length))
done
# Empty the markdown file and add header
printf "# Alias Commands\n\nThis file lists all aliases defined in \`config/alias\`.\n\n" > "$OUTPUT_FILE"
# Add table header
printf "| %-*s | %-*s |\n" \
"$max_alias_length" "Alias" \
"$max_command_length" "Command" >> "$OUTPUT_FILE"
# Add table header separator
printf "| %-*s | %-*s |\n" \
"$max_alias_length" "$(printf '%0.s-' $(seq 1 $max_alias_length))" \
"$max_command_length" "$(printf '%0.s-' $(seq 1 $max_command_length))" >> "$OUTPUT_FILE"
# Create table with max cell lengths
for entry in "${sorted_aliases[@]}"; do
IFS=$'␟' read -r alias_name alias_command <<< "$entry"
printf "| %-*s | %-*s |\n" \
"$max_alias_length" "$alias_name" \
"$max_command_length" "$alias_command" >> "$OUTPUT_FILE"
done
{
printf "\n"
printf "Total aliases: %d\n" "${#sorted_aliases[@]}"
printf "Last updated: %s\n" "$(date)"
} >> "$OUTPUT_FILE"
# Announce process completion
echo "Alias documentation updated: $OUTPUT_FILE"

View File

@@ -1,3 +1,5 @@
# vim: ft=sshconfig
Host t1
User ubuntu
HostName t1.home.antiprocess.net
@@ -14,4 +16,3 @@ Host t4
User ubuntu
HostName t4.home.antiprocess.net
IdentityFile ~/.ssh/id_rsa