Compare changes

Choose any two refs to compare.

+18
.chezmoi.toml.tmpl
···
+
[data]
+
{{ $machineTypeChoices := list "personal" "work" -}}
+
{{ $machineType := promptChoiceOnce . "machineType" "Machine type" $machineTypeChoices -}}
+
machineType = {{ $machineType | quote }}
+
+
{{- if eq .chezmoi.os "linux" }}
+
opDir = "/opt/1Password"
+
{{ else if eq .chezmoi.os "darwin" }}
+
opDir = "/Applications/1Password.app/Contents/MacOS"
+
{{- end }}
+
+
[data.git]
+
{{ $gitName := promptStringOnce . "git.name" "Git name" -}}
+
name = {{ $gitName | quote }}
+
{{ $gitEmail := promptStringOnce . "git.email" "Git email" -}}
+
email = {{ $gitEmail | quote }}
+
{{ $sshSigningKeyOpId := promptStringOnce . "git.sshSigningKeyOpId" "1Password ID for SSH signing key (e.g. op://Private/abcd)" -}}
+
sshSigningKeyOpId = {{ trimAll "\"" $sshSigningKeyOpId | quote }}
+4
.chezmoiexternal.toml
···
+
[".var/app/io.mpv.Mpv/config/mpv/scripts/autocrop.lua"]
+
type = "file"
+
url = "https://raw.githubusercontent.com/mpv-player/mpv/refs/tags/v0.39.0/TOOLS/lua/autocrop.lua"
+
checksum.sha256 = "40cc44b69ff1a8feabd6132ade0054e595fa9ea5e07f175d2dd99b22543fb683"
+26
.chezmoiignore
···
+
{{ if ne .machineType "personal" -}}
+
# Exclude restic files
+
.config/restic/
+
.config/systemd/user/restic-backup.service
+
.config/systemd/user/restic-backup.timer
+
.config/fish/functions/restic-chert.fish
+
.config/fish/functions/restic-pulsar.fish
+
.config/fish/functions/restic-slate.fish
+
+
# Exlude mpv files
+
.var/app/io.mpv.Mpv/config/mpv/scripts/autocrop.lua
+
+
# Ignore Bubblewrap scripts
+
.local/bin/bwrap-preset-renpy
+
.local/share/nautilus/scripts/Run in Bubblewrap (Ren'Py)
+
{{ end -}}
+
+
# Ignore Linux-specific files on non-Linux systems.
+
{{- if ne .chezmoi.os "linux" }}
+
.config/systemd/
+
.local/share/nautilus/
+
.var/app/
+
{{- end }}
+
+
# Ignore docs
+
README.md
+37
README.md
···
+
# Avery's dotfiles
+
My dotfiles, organized using chezmoi.
+
+
# Installation
+
1. Install Homebrew and chezmoi
+
```fish
+
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
+
eval (/home/linuxbrew/.linuxbrew/bin/brew shellenv)
+
brew install chezmoi
+
```
+
+
2. Create the chezmoi config at `~/.config/chezmoi/chezmoi.toml`
+
```toml
+
[data]
+
machineType = "personal|work"
+
+
[data.git]
+
name = ""
+
email = ""
+
sshSigningKeyOpId = ""
+
+
[data.restic.chert]
+
baseOpId = ""
+
+
[data.restic.pulsar]
+
baseOpId = ""
+
+
[data.restic.slate]
+
baseOpId = ""
+
```
+
+
3. Initialize the repository
+
```sh
+
chezmoi init https://tangled.sh/@bladee.bsky.social/dotfiles
+
fish -c "chezmoi apply"
+
fish -c "chezmoi apply"
+
```
+57
dot_config/git/config.tmpl
···
+
[user]
+
name = {{ .git.name }}
+
email = {{ .git.email }}
+
signingKey = {{ onepasswordRead (printf "%s/public key" .git.sshSigningKeyOpId) }}
+
+
[core]
+
autocrlf = input
+
+
[init]
+
defaultBranch = main
+
+
[commit]
+
gpgsign = true
+
verbose = true
+
+
[pull]
+
ff = only
+
+
[merge]
+
conflictStyle = zdiff3
+
+
[rebase]
+
autoSquash = true
+
+
[push]
+
default = current
+
+
[diff]
+
algorithm = histogram
+
colorMoved = default
+
+
[transfer]
+
fsckObjects = true
+
+
[fetch]
+
fsckObjects = true
+
+
[receive]
+
fsckObjects = true
+
+
[branch]
+
sort = -committerdate
+
+
[tag]
+
sort = taggerdate
+
+
[credential]
+
helper = libsecret
+
helper = oauth
+
helper = cache --timeout=3600
+
+
[gpg]
+
format = ssh
+
+
[gpg "ssh"]
+
program = {{ joinPath .opDir "op-ssh-sign" }}
+
allowedSignersFile = {{ joinPath .chezmoi.homeDir ".config/git/allowed_signers" }}
+116
dot_config/homebrew/Brewfile.tmpl
···
+
# Packages to install on all machines.
+
brew "aria2"
+
brew "atuin"
+
brew "bat"
+
brew "chezmoi"
+
brew "curl"
+
brew "dua-cli"
+
brew "fd"
+
brew "ffmpeg"
+
brew "gcc"
+
brew "git"
+
brew "helix"
+
brew "htop"
+
brew "jj"
+
brew "just"
+
brew "lnav"
+
brew "ollama"
+
brew "python@3.14"
+
brew "ripgrep"
+
brew "rustup"
+
brew "scrcpy"
+
brew "uv"
+
brew "wget"
+
+
+
{{ if eq .chezmoi.os "linux" -}}
+
# Packages to install on Linux machines.
+
brew "git-credential-libsecret"
+
brew "git-credential-oauth"
+
# TODO: How to specify flatpak file?
+
# flatpak "com.bitwig.BitwigStudio", remote: "bitwigstudio-origin"
+
flatpak "com.calibre_ebook.calibre"
+
flatpak "com.discordapp.Discord"
+
flatpak "com.fastmail.Fastmail"
+
flatpak "com.github.johnfactotum.Foliate"
+
flatpak "com.github.tchx84.Flatseal"
+
flatpak "com.google.Chrome"
+
flatpak "com.mattjakeman.ExtensionManager"
+
flatpak "com.obsproject.Studio"
+
flatpak "com.plexamp.Plexamp"
+
flatpak "com.todoist.Todoist"
+
flatpak "com.valvesoftware.Steam"
+
flatpak "com.valvesoftware.SteamLink"
+
flatpak "com.visualstudio.code"
+
flatpak "io.github.nozwock.Packet"
+
flatpak "io.mpv.Mpv"
+
flatpak "net.nokyan.Resources"
+
flatpak "org.audacityteam.Audacity"
+
flatpak "org.bunkus.mkvtoolnix-gui"
+
flatpak "org.cockpit_project.CockpitClient"
+
flatpak "org.darktable.Darktable"
+
flatpak "org.freac.freac"
+
flatpak "org.gimp.GIMP"
+
flatpak "org.gnome.Boxes"
+
flatpak "org.gnome.Calculator"
+
flatpak "org.gnome.Decibels"
+
flatpak "org.gnome.Loupe"
+
flatpak "org.gnome.Papers"
+
flatpak "org.gnome.Showtime"
+
flatpak "org.gnome.SimpleScan"
+
flatpak "org.gnome.Snapshot"
+
flatpak "org.gnome.SoundRecorder"
+
flatpak "org.gnome.TextEditor"
+
flatpak "org.gnome.Weather"
+
flatpak "org.gnome.clocks"
+
flatpak "org.libreoffice.LibreOffice"
+
flatpak "org.musicbrainz.Picard"
+
flatpak "org.torproject.torbrowser-launcher"
+
flatpak "org.wireshark.Wireshark"
+
flatpak "tv.plex.PlexDesktop"
+
{{ end -}}
+
+
+
{{ if eq .chezmoi.os "darwin" -}}
+
# Packages to install on macOS machines.
+
brew "cocoapods"
+
brew "coreutils"
+
brew "fish"
+
brew "lima"
+
brew "openssh"
+
brew "podman"
+
cask "1password"
+
cask "1password-cli"
+
cask "android-platform-tools"
+
cask "imhex"
+
cask "insomnia"
+
cask "jetbrains-toolbox"
+
cask "mitmproxy"
+
cask "notion"
+
cask "todoist-app"
+
cask "utm"
+
cask "visual-studio-code"
+
cask "wine-stable"
+
cask "wireshark-app"
+
cask "zed"
+
+
{{ if eq .machineType "work" }}
+
cask "picoscope"
+
{{ end -}}
+
{{ end -}}
+
+
+
{{ if eq .machineType "personal" -}}
+
# Packages to install on personal machines.
+
brew "cdrtools"
+
brew "gallery-dl"
+
brew "gemini-cli"
+
brew "restic"
+
brew "yt-dlp"
+
{{ end -}}
+
+
+
{{ if eq .machineType "work" -}}
+
# Packages to install on work machines.
+
brew "firebase-cli"
+
{{ end -}}
+45
dot_config/lnav/formats/installed/logcat_log.json
···
+
{
+
"$schema": "https://lnav.org/schemas/format-v1.schema.json",
+
"logcat_log": {
+
"title": "Android logcat logs",
+
"regex": {
+
"threadtime": {
+
"pattern": "^(?<timestamp>\\d{2}-\\d{2}\\s\\d{2}:\\d{2}:\\d{2}\\.\\d{3})\\s+(?<log_pid>\\d+)\\s+(?<log_tid>\\d+)\\s+(?<level>[A-Z])\\s+(?<log_tag>\\S+)\\s*:\\s*(?<body>.*)$"
+
}
+
},
+
"timestamp-field": "timestamp",
+
"timestamp-format": [ "%m-%d %H:%M:%S.%L" ],
+
"ordered-by-time": false,
+
"level-field": "level",
+
"body-field": "body",
+
"opid-field": "tag",
+
"level": {
+
"fatal": "F",
+
"error": "E",
+
"warning": "W",
+
"info": "I",
+
"debug": "D",
+
"trace": "V"
+
},
+
"value": {
+
"log_pid": {
+
"kind": "integer",
+
"identifier": false
+
},
+
"log_tid": {
+
"kind": "integer",
+
"identifier": false
+
},
+
"log_tag": {
+
"kind": "string",
+
"identifier": true
+
}
+
},
+
"sample": [
+
{
+
"line": "07-06 11:25:07.996 1583 2720 E fpc_fingerprint_hal: do_key_monitor open failed with error -2",
+
"level": "error"
+
}
+
]
+
}
+
}
+74 -35
dot_config/private_fish/config.fish.tmpl
···
-
{{ $brewPath := lookPath "brew" }}
-
{{ if $brewPath -}}
+
#
# Set up Homebrew.
-
set -x HOMEBREW_NO_INSTALL_CLEANUP 1
-
set -x HOMEBREW_NO_ANALYTICS 1
-
eval ({{ $brewPath | quote }} shellenv)
-
{{ end -}}
+
#
+
{{ $brewPath := lookPath "brew" -}}
+
if test -x {{ $brewPath | quote }}
+
set -x HOMEBREW_NO_ANALYTICS 1
+
set -x HOMEBREW_NO_AUTO_UPDATE 1
+
set -x HOMEBREW_NO_ENV_HINTS 1
+
set -x HOMEBREW_NO_INSTALL_CLEANUP 1
+
set -x HOMEBREW_NO_INSTALL_UPGRADE 1
+
set -x HOMEBREW_NO_UPDATE_REPORT_NEW 1
+
eval ({{ $brewPath | quote }} shellenv)
+
end
-
# Add directories to path.
+
#
+
# Add directories to PATH.
+
#
fish_add_path --global {{ joinPath .chezmoi.homeDir ".cargo/bin" | quote }}
fish_add_path --global {{ joinPath .chezmoi.homeDir ".local/bin" | quote }}
+
{{ if eq .chezmoi.os "linux" -}}
+
#
# Set XDG data directories.
+
#
set -x XDG_CACHE_HOME {{ joinPath .chezmoi.homeDir ".cache" | quote }}
set -x XDG_CONFIG_HOME {{ joinPath .chezmoi.homeDir ".config" | quote }}
set -x XDG_DATA_HOME {{ joinPath .chezmoi.homeDir ".local/share" | quote }}
set -x XDG_STATE_HOME {{ joinPath .chezmoi.homeDir ".local/state" | quote }}
+
{{- end }}
-
{{ $editorName := .editor | default "vi" -}}
-
{{ $editorPath := lookPath $editorName -}}
-
{{ if $editorPath -}}
-
set -x EDITOR {{ $editorPath | quote }}
-
{{ end -}}
+
#
+
# Set editor.
+
#
+
{{ $editorName := .editor -}}
+
if command --query {{ $editorName | quote }}
+
set -x EDITOR {{ $editorName | quote }}
+
end
+
+
{{ if eq .machineType "personal" -}}
+
#
+
# Set Ollama host to chert.
+
#
+
set -x OLLAMA_HOST "https://chert.caracal-economy.ts.net:11906"
+
{{- end}}
+
+
#
+
# Configure bat.
+
#
+
if command --query bat
+
alias cat bat
+
set -x MANPAGER "sh -c 'col -bx | bat -l man -p'"
+
set -x MANROFFOPT "-c"
+
set -x BAT_PAGER "less -FIKMFRS"
+
end
-
{{ $batPath := lookPath "bat" }}
-
{{ if $batPath -}}
-
# Configure 'bat'.
-
alias cat bat
-
set -x MANPAGER "sh -c 'col -bx | bat -l man -p'"
-
set -x MANROFFOPT "-c"
-
set -x BAT_PAGER "less -FIKMFRS"
-
{{ end -}}
+
{{ if eq .chezmoi.os "linux" -}}
+
#
+
# Configure systemd.
+
#
+
set -x SYSTEMD_LESS "FIKMRS"
+
{{- end }}
-
# Set default less options.
-
set -x SYSTEMD_LESS FIKMRS
+
#
+
# Enable Jujutsu completions.
+
#
+
if command --query jj
+
COMPLETE=fish jj | source
+
end
-
{{ $jjPath := lookPath "jj" }}
-
{{ if $jjPath -}}
-
# Enable JJ completions.
-
COMPLETE=fish {{ $jjPath | quote }} | source
-
{{ end -}}
+
{{ if eq .chezmoi.os "linux" -}}
+
#
+
# Replace 'rm' with 'ts'.
+
#
+
if command --query gio
+
alias ts "gio trash"
+
function rm
+
echo "'rm' is disabled. use 'ts' to move items to trash, or 'command rm' to use rm."
+
return 1
+
end
+
end
+
{{- end }}
-
{{ $gioPath := lookPath "gio" }}
-
{{ if $gioPath -}}
-
# Disable rm if the trash is enabled.
-
alias ts "{{ $gioPath }} trash"
-
function rm
-
echo "'rm' is disabled. use 'ts' to move items to trash, or 'command rm' to use rm."
-
return 1
+
if status --is-interactive
+
#
+
# Enable atuin.
+
#
+
if command --query atuin
+
atuin init fish | source
+
end
end
-
{{ end -}}
+20 -13
dot_config/private_fish/functions/clip.fish
···
function clip
-
if test $XDG_SESSION_TYPE = x11
-
if ! command --query xclip
-
echo -e "Error: `xclip` must be installed to copy on an X11 session"
-
return 1
-
end
-
-
command xclip -selection c
-
else if test $XDG_SESSION_TYPE = wayland
-
if ! command --query wl-copy
-
echo -e "Error: `wl-clipboard` must be installed to copy on a Wayland session"
+
if test (uname -s) = Darwin
+
command pbcopy
+
else if test (uname -s) = Linux
+
if test $XDG_SESSION_TYPE = x11
+
if ! command --query xclip
+
echo -e "Error: `xclip` must be installed to copy on an X11 session"
+
return 1
+
end
+
+
command xclip -selection c
+
else if test $XDG_SESSION_TYPE = wayland
+
if ! command --query wl-copy
+
echo -e "Error: `wl-clipboard` must be installed to copy on a Wayland session"
+
return 1
+
end
+
+
command wl-copy
+
else
+
echo -e "Error: Unknown session type `$XDG_SESSION_TYPE`"
return 1
end
-
-
command wl-copy
else
-
echo -e "Error: Unknown session type `$XDG_SESSION_TYPE`"
+
echo -e "Error: Unsupported operating system `$(uname -s)`"
return 1
end
end
-3
dot_config/private_fish/functions/edit.fish
···
-
function edit
-
flatpak run --file-forwarding org.gnome.TextEditor @@ $argv @@
-
end
-3
dot_config/private_fish/functions/fish_greeting.fish
···
-
function fish_greeting
-
systemctl --user list-units --quiet --state=failed
-
end
+5
dot_config/private_fish/functions/fish_greeting.fish.tmpl
···
+
function fish_greeting
+
{{- if eq .chezmoi.os "linux" }}
+
systemctl --user list-units --quiet --state=failed
+
{{- end }}
+
end
+24
dot_config/private_fish/functions/gemini-cleanup-album.fish
···
+
function gemini-cleanup-album --description "Clean up album files." --wraps "gemini"
+
set prompt "Rename all .lrc files to match their corresponding .flac files \
+
exactly. Do not rename the audio files. If there are multiple cover images, \
+
delete all but highest quality image, then rename it to cover.ext, where ext is \
+
the extension for the image type (i.e., jpg, png). Return a summary of all \
+
changed file names after completion."
+
+
# systemd-run --user --scope \
+
# -p ProtectSystem=strict \
+
# -p ProtectHome=read-only \
+
# -p ReadWritePaths="$PWD" \
+
# -p PrivateTmp=yes \
+
# -p NoNewPrivileges=yes \
+
# gemini --model gemini-2.5-flash --allowed-tools list_directory,run_shell_command "$prompt" $argv
+
+
bwrap \
+
--ro-bind / / \
+
--dev /dev \
+
--proc /proc \
+
--tmpfs /tmp \
+
--bind "$PWD" "$PWD" \
+
--bind "$HOME/.gemini" "$HOME/.gemini" \
+
gemini --model gemini-2.5-flash --allowed-tools list_directory,run_shell_command "$prompt" $argv
+
end
+8
dot_config/private_fish/functions/restic-chert.fish.tmpl
···
+
function restic-chert --wraps=restic
+
set -x RESTIC_REPOSITORY {{ printf "%s/%s" .restic.chert.baseOpId "restic repository" | quote }}
+
set -x RESTIC_PASSWORD {{ printf "%s/%s" .restic.chert.baseOpId "restic password" | quote }}
+
set -x AWS_ACCESS_KEY_ID {{ printf "%s/%s" .restic.chert.baseOpId "access key id" | quote }}
+
set -x AWS_SECRET_ACCESS_KEY {{ printf "%s/%s" .restic.chert.baseOpId "secret access key" | quote }}
+
+
command op run -- restic $argv
+
end
+8
dot_config/private_fish/functions/restic-pulsar.fish.tmpl
···
+
function restic-pulsar --wraps=restic
+
set -x RESTIC_REPOSITORY {{ printf "%s/%s" .restic.pulsar.baseOpId "restic repository" | quote }}
+
set -x RESTIC_PASSWORD {{ printf "%s/%s" .restic.pulsar.baseOpId "restic password" | quote }}
+
set -x AWS_ACCESS_KEY_ID {{ printf "%s/%s" .restic.pulsar.baseOpId "access key id" | quote }}
+
set -x AWS_SECRET_ACCESS_KEY {{ printf "%s/%s" .restic.pulsar.baseOpId "secret access key" | quote }}
+
+
command op run -- restic $argv
+
end
+8
dot_config/private_fish/functions/restic-slate.fish.tmpl
···
+
function restic-slate --wraps=restic
+
set -x RESTIC_REPOSITORY {{ printf "%s/%s" .restic.slate.baseOpId "restic repository" | quote }}
+
set -x RESTIC_PASSWORD {{ printf "%s/%s" .restic.slate.baseOpId "restic password" | quote }}
+
set -x AWS_ACCESS_KEY_ID {{ printf "%s/%s" .restic.slate.baseOpId "access key id" | quote }}
+
set -x AWS_SECRET_ACCESS_KEY {{ printf "%s/%s" .restic.slate.baseOpId "secret access key" | quote }}
+
+
command op run -- restic $argv
+
end
+26
dot_config/restic/excludes.conf
···
+
$HOME/.1password/
+
$HOME/.android/
+
$HOME/.BitwigStudio/
+
$HOME/.cache/
+
$HOME/.gradle/
+
$HOME/.java/
+
$HOME/.local/share/
+
$HOME/.local/state/
+
$HOME/.jdks/
+
$HOME/.pki/
+
$HOME/.skiko/
+
$HOME/.vscode/
+
+
$HOME/Downloads/
+
$HOME/Dropbox/
+
$HOME/Google Drive/
+
$HOME/Music/
+
$HOME/Videos/
+
+
$HOME/.var/app/**/cache/
+
$HOME/.var/app/**/.cache/
+
$HOME/.var/app/**/data/
+
$HOME/.var/app/**/.local/share/
+
+
**/mkosi.cache/
+
**/mkosi.output/
+15
dot_config/restic/private_backup.conf.tmpl
···
+
RESTIC_REPOSITORY={{ onepasswordRead (printf "%s/%s" .restic.slate.baseOpId "restic repository") | quote }}
+
RESTIC_PASSWORD={{ onepasswordRead (printf "%s/%s" .restic.slate.baseOpId "restic password") | quote }}
+
+
AWS_ACCESS_KEY_ID={{ onepasswordRead (printf "%s/%s" .restic.slate.baseOpId "access key id")| quote }}
+
AWS_SECRET_ACCESS_KEY={{ onepasswordRead (printf "%s/%s" .restic.slate.baseOpId "secret access key") | quote }}
+
+
BACKUP_PATHS={{ .chezmoi.homeDir | quote }}
+
BACKUP_TAGS=Automatic
+
+
UPLOAD_LIMIT=5000
+
+
RETENTION_DAYS=7
+
RETENTION_WEEKS=4
+
RETENTION_MONTHS=12
+
RETENTION_YEARS=unlimited
+14
dot_config/systemd/user/1password.service.tmpl
···
+
[Unit]
+
Description=Password manager
+
After=graphical-session.target
+
PartOf=graphical-session.target
+
+
[Service]
+
Type=exec
+
ExitType=cgroup
+
ExecStart={{ joinPath .opDir "1password" }} --silent
+
Restart=always
+
Slice=app.slice
+
+
[Install]
+
WantedBy=graphical-session.target
+16
dot_config/systemd/user/restic-backup.service.tmpl
···
+
[Unit]
+
Description=Backup home directory
+
After=network-online.target
+
Wants=network-online.target
+
+
[Service]
+
Type=oneshot
+
Environment=XDG_CACHE_HOME=%T
+
EnvironmentFile=%h/.config/restic/backup.conf
+
{{ $resticPath := lookPath "restic" -}}
+
ExecStart={{ $resticPath }} backup --verbose --limit-upload "$UPLOAD_LIMIT" --exclude-file %h/.config/restic/excludes.conf --exclude-caches --tag "$BACKUP_TAGS" $BACKUP_PATHS
+
ExecStartPost={{ $resticPath }} forget --verbose --tag "$BACKUP_TAGS" --keep-daily "$RETENTION_DAYS" --keep-weekly "$RETENTION_WEEKS" --keep-monthly "$RETENTION_MONTHS" --keep-yearly "$RETENTION_YEARS"
+
ExecStopPost={{ $resticPath }} unlock --remove-all
+
TimeoutStopSec=2m
+
SendSIGKILL=false
+
SuccessExitStatus=3
+10
dot_config/systemd/user/restic-backup.timer
···
+
[Unit]
+
Description=Schedule a backup of the home directory
+
+
[Timer]
+
OnCalendar=daily
+
Persistent=true
+
AccuracySec=30m
+
+
[Install]
+
WantedBy=timers.target
+8
dot_config/zed/keymap.json
···
+
[
+
{
+
"context": "Editor",
+
"bindings": {
+
"ctrl-d": "editor::DeleteLine"
+
}
+
}
+
]
+22
dot_config/zed/private_settings.json
···
+
{
+
"theme": "Ayu Dark",
+
"assistant": {
+
"default_model": {
+
"provider": "google",
+
"model": "gemini-2.5-pro-preview-03-25"
+
},
+
"version": "2"
+
},
+
"buffer_font_size": 14,
+
"buffer_font_family": "Intel One Mono",
+
"wrap_guides": [80, 120],
+
"features": {
+
"edit_prediction_provider": "none"
+
},
+
"format_on_save": "off",
+
"autosave": {
+
"after_delay": {
+
"milliseconds": 100
+
}
+
}
+
}
+4
dot_var/app/io.mpv.Mpv/config/mpv/mpv.conf
···
+
vo=gpu-next
+
gpu-api=vulkan
+
hwdec=auto-safe
+
script-opts-append=autocrop-auto=no
+82
private_dot_local/bin/executable_bwrap-preset-renpy
···
+
#!/usr/bin/env sh
+
+
# bwrap-preset-renpy
+
#
+
# Run an executable in a Bubblewrap sandbox set up for Ren'Py games. The saves
+
# directory will be in '$XDG_CONFIG_DIR/renpy' or '$HOME/.config/renpy' instead
+
# of the normal '$HOME/.renpy'.
+
+
set -eu
+
+
# Set script title for error messages.
+
SCRIPT_TITLE="Run in Bubblewrap (Ren'Py)"
+
+
# Notify the user of an error and exit.
+
notify_and_exit () {
+
# Make sure enough arguments were given.
+
if [ "$#" -ne 2 ]; then
+
printf "Error: notify_and_exit() called with '%i' arguments\n" "$#"
+
exit 127
+
fi
+
+
# Name the arguments.
+
error_msg="$1"
+
exit_code="$2"
+
+
# Either print to stdout or send a notification.
+
if [ "$TERM" = "dumb" ]; then
+
notify-send --urgency=normal --icon=error "$SCRIPT_TITLE" "$error_msg"
+
else
+
printf "%s: %s\n" "$SCRIPT_TITLE" "$error_msg"
+
fi
+
+
# Exit with the error code.
+
exit "$exit_code"
+
}
+
+
# Only one command can be run.
+
[ "$#" -ne 1 ] && notify_and_exit "Only one command can be run with this script" 1
+
+
+
# Make sure Bubblewrap is installed.
+
if ! command -v bwrap > /dev/null 2>&1; then
+
notify_and_exit "Could not find executable \`bwrap\`" 1
+
fi
+
+
# Set the Ren'Py saves directory.
+
if [ ! -z "$\{XDG_CONFIG_HOME+x\}" ]; then
+
RENPY_SAVE_DIR="$XDG_CONFIG_HOME/renpy"
+
else
+
RENPY_SAVE_DIR="$HOME/.config/renpy"
+
fi
+
+
# Create the Ren'Py saves directory if it doesn't exist.
+
[ ! -d "$RENPY_SAVE_DIR" ] && mkdir -p "$RENPY_SAVE_DIR"
+
+
# Get the full path of the file.
+
executable=$(realpath "$1")
+
+
# Get the directory the file is contained in so it can be mounted int the
+
# sandbox.
+
executable_dir=$(dirname "$executable")
+
+
# Make sure the file is executable.
+
[ ! -x "$executable" ] && notify_and_exit "File \`$executable\` is not executable" 1
+
+
# Run the specified command in Bubblewrap. Unshare all namespaces, and bind the
+
# working directory and Ren'Py saves directory.
+
exec bwrap \
+
--unshare-all \
+
--die-with-parent \
+
--new-session \
+
--unsetenv RENPY_PATH_TO_SAVES \
+
--ro-bind "/" "/" \
+
--dev "/dev" \
+
--dev-bind "/dev/dri" "/dev/dri" \
+
--proc "/proc" \
+
--tmpfs "$HOME" \
+
--bind "$XDG_CONFIG_HOME/MangoHud" "$XDG_CONFIG_HOME/MangoHud" \
+
--bind "$executable_dir" "$executable_dir" \
+
--bind "$RENPY_SAVE_DIR" "$HOME/.renpy" \
+
"$executable"
+
+2
private_dot_ssh/private_config.tmpl
···
+
Host *
+
IdentityAgent {{ joinPath .chezmoi.homeDir ".1password/agent.sock" }}
+4
run_onchange_after_brew-bundle.sh.tmpl
···
+
#!/usr/bin/bash
+
+
# Brewfile hash: {{ includeTemplate "dot_config/homebrew/Brewfile.tmpl" . | sha256sum }}
+
brew bundle install --global --no-upgrade