From 58f7632fd838ba3a8d8590baa10128c2db44c9ad Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Wed, 12 Aug 2026 19:27:30 +0200 Subject: mac updates --- home/.chezmoiignore | 3 + home/dot_config/kitty/kitty.conf | 20 +++++++ home/dot_config/kitty/symlink_kitty.app.icns | 1 + home/dot_config/mpv/scripts/copy-subs.lua | 2 +- home/dot_config/pip/pip.conf | 4 ++ home/dot_config/private_homebrew/brew.env | 2 + home/dot_local/share/bin/executable_copy.tmpl | 6 ++ home/dot_local/share/bin/executable_subrename | 2 +- home/dot_profile | 2 - home/dot_zshrc | 64 ++++++++++++++++++++ home/dot_zshrc.tmpl | 68 ---------------------- .../LaunchAgents/homebrew.mxcl.mpd.plist.tmpl | 30 ++++++++++ .../LaunchAgents/homebrew.mxcl.syncthing.plist | 30 ++++++++++ 13 files changed, 162 insertions(+), 72 deletions(-) create mode 100644 home/.chezmoiignore create mode 100644 home/dot_config/kitty/kitty.conf create mode 100644 home/dot_config/kitty/symlink_kitty.app.icns create mode 100644 home/dot_config/pip/pip.conf create mode 100644 home/dot_config/private_homebrew/brew.env create mode 100755 home/dot_local/share/bin/executable_copy.tmpl create mode 100644 home/dot_zshrc delete mode 100644 home/dot_zshrc.tmpl create mode 100644 home/private_Library/LaunchAgents/homebrew.mxcl.mpd.plist.tmpl create mode 100644 home/private_Library/LaunchAgents/homebrew.mxcl.syncthing.plist diff --git a/home/.chezmoiignore b/home/.chezmoiignore new file mode 100644 index 0000000..c7ea764 --- /dev/null +++ b/home/.chezmoiignore @@ -0,0 +1,3 @@ +{{- if ne .chezmoi.os "darwin" }} +Library +{{- end }} diff --git a/home/dot_config/kitty/kitty.conf b/home/dot_config/kitty/kitty.conf new file mode 100644 index 0000000..6b3a18c --- /dev/null +++ b/home/dot_config/kitty/kitty.conf @@ -0,0 +1,20 @@ +font_family JetBrains Mono +bold_font JetBrains Mono Bold +italic_font JetBrains Mono Italic +bold_italic_font JetBrains Mono Bold Italic +font_size 10 + +modify_font cell_height 120% + +term xterm-256color +cursor_blink_interval 0 +cursor_shape block +shell_integration disabled +resize_debounce_time 0 0 +resize_in_steps yes +confirm_os_window_close 0 +enable_audio_bell no + +placement_strategy top-left +window_margin_width 8 + diff --git a/home/dot_config/kitty/symlink_kitty.app.icns b/home/dot_config/kitty/symlink_kitty.app.icns new file mode 100644 index 0000000..dcd4e5e --- /dev/null +++ b/home/dot_config/kitty/symlink_kitty.app.icns @@ -0,0 +1 @@ +/System/Applications/Utilities/Terminal.app/Contents/Resources/Terminal.icns diff --git a/home/dot_config/mpv/scripts/copy-subs.lua b/home/dot_config/mpv/scripts/copy-subs.lua index 973e1f2..56928b2 100644 --- a/home/dot_config/mpv/scripts/copy-subs.lua +++ b/home/dot_config/mpv/scripts/copy-subs.lua @@ -11,7 +11,7 @@ function copy() sub = sub:gsub('\n', ' ') -- replace newlines with space sub = sub:gsub('\'', '\'\\\'\'') -- escape single quotes - os.execute("echo '" .. sub .. "' | xclip -selection clipboard -i") + os.execute("echo '" .. sub .. "' | copy") end end diff --git a/home/dot_config/pip/pip.conf b/home/dot_config/pip/pip.conf new file mode 100644 index 0000000..ebfb002 --- /dev/null +++ b/home/dot_config/pip/pip.conf @@ -0,0 +1,4 @@ +[install] +break-system-packages = true +user = true + diff --git a/home/dot_config/private_homebrew/brew.env b/home/dot_config/private_homebrew/brew.env new file mode 100644 index 0000000..6b97bc1 --- /dev/null +++ b/home/dot_config/private_homebrew/brew.env @@ -0,0 +1,2 @@ +HOMEBREW_NO_AUTO_UPDATE=1 +HOMEBREW_NO_ENV_HINTS=1 diff --git a/home/dot_local/share/bin/executable_copy.tmpl b/home/dot_local/share/bin/executable_copy.tmpl new file mode 100755 index 0000000..dde46b3 --- /dev/null +++ b/home/dot_local/share/bin/executable_copy.tmpl @@ -0,0 +1,6 @@ +#!/usr/bin/env sh +{{- if eq .chezmoi.os "darwin" }} +exec pbcopy +{{- else if eq .chezmoi.os "linux" }} +exec xclip -selection clipboard -in +{{- end }} diff --git a/home/dot_local/share/bin/executable_subrename b/home/dot_local/share/bin/executable_subrename index 16d913f..ea6e446 100644 --- a/home/dot_local/share/bin/executable_subrename +++ b/home/dot_local/share/bin/executable_subrename @@ -48,7 +48,7 @@ fi for file in "$@" ; do new_filename="$(printf 's%02de%02d%s\n' "$season" "$episode" "$file_extension")" - mv --verbose "$file" "$new_filename" + mv -v "$file" "$new_filename" episode=$(( $episode + 1 )) done diff --git a/home/dot_profile b/home/dot_profile index c5d8663..8ef501e 100644 --- a/home/dot_profile +++ b/home/dot_profile @@ -8,7 +8,6 @@ export LANG='ja_JP.UTF-8' # aliases -alias copy='xclip -selection clipboard' alias dnd='dragon-drop --all --and-exit' alias sl='sl -w' alias bctl='bluetoothctl' @@ -44,7 +43,6 @@ export GEM_HOME="$XDG_DATA_HOME/gem/ruby/3.0.0" # script locations if [ -z "$PATH_EXTENDED" ] ; then - PATH="/opt/zephyr-sdk/arm-zephyr-eabi/bin:$PATH" PATH="$GEM_HOME/bin:$PATH" PATH="$HOME/.local/share/cargo/bin:$PATH" PATH="$HOME/.local/go/bin:$PATH" diff --git a/home/dot_zshrc b/home/dot_zshrc new file mode 100644 index 0000000..6220015 --- /dev/null +++ b/home/dot_zshrc @@ -0,0 +1,64 @@ +#!/bin/zsh +export ZSH_COMPDUMP="$XDG_CACHE_HOME/zcompdump" + +# do not glob for calculator command +aliases[=]="noglob =" + +# color aliases +alias ls='ls --color=auto' +alias grep='grep --color=auto' + +# completion +autoload -U compinit +zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}" +zstyle ':completion:*:*:*:*:*' menu select +zstyle ':completion:*' matcher-list 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'r:|=*' 'l:|=* r:|=*' +zstyle ':completion:*' special-dirs true +setopt auto_menu # show completion menu when spamming +setopt complete_in_word +setopt always_to_end # move cursor to end of word after completion +setopt auto_cd # cd if the command is a valid path +WORDCHARS="${WORDCHARS:gs/\//}" # remove '/' from WORDCHARS +compinit -d "$ZSH_COMPDUMP" + +# history +! [ -d "$XDG_DATA_HOME/zsh" ] && mkdir -p "$XDG_DATA_HOME/zsh" +export HISTFILE="$XDG_DATA_HOME/zsh/history" +export HISTSIZE=10000000 +export SAVEHIST=10000000 +setopt hist_ignore_space +setopt share_history +setopt hist_ignore_dups + +# keybinds +bindkey -e # emacs bindings +bindkey '^[[Z' reverse-menu-complete + +# prompt +setopt PROMPT_SUBST +export VIRTUAL_ENV_DISABLE_PROMPT=y +PROMPT='$(eo=%{ ec=%} prompt)' + +# auto venv +function cd() { + builtin cd "$@" + + if [ -n "$VIRTUAL_ENV" ] ; then + if [[ "$PWD"/ != "$(dirname "$VIRTUAL_ENV")"/* ]] && [ ! -z "$(command -v deactivate)" ] ; then + deactivate + else + return + fi + fi + + git_dir="$(git rev-parse --show-toplevel 2>/dev/null)" + for dir in ./ "$git_dir" ../ "$git_dir/.." ; do + [ ! -d "$dir" ] && continue + for file in "$dir"/.env "$dir"/venv/bin/activate ; do + [ ! -e "$file" ] && continue + source "$file" + return + done + done +} + diff --git a/home/dot_zshrc.tmpl b/home/dot_zshrc.tmpl deleted file mode 100644 index eca7ae1..0000000 --- a/home/dot_zshrc.tmpl +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/zsh -export ZSH_COMPDUMP="$XDG_CACHE_HOME/zcompdump" - -# do not glob for calculator command -aliases[=]="noglob =" - -# color aliases -alias ls='ls --color=auto' -alias grep='grep --color=auto' - -# completion -autoload -U compinit -zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}" -zstyle ':completion:*:*:*:*:*' menu select -zstyle ':completion:*' matcher-list 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'r:|=*' 'l:|=* r:|=*' -zstyle ':completion:*' special-dirs true -setopt auto_menu # show completion menu when spamming -setopt complete_in_word -setopt always_to_end # move cursor to end of word after completion -setopt auto_cd # cd if the command is a valid path -WORDCHARS="${WORDCHARS:gs/\//}" # remove '/' from WORDCHARS -compinit -d "$ZSH_COMPDUMP" - -# history -! [ -d "$XDG_DATA_HOME/zsh" ] && mkdir -p "$XDG_DATA_HOME/zsh" -export HISTFILE="$XDG_DATA_HOME/zsh/history" -export HISTSIZE=10000000 -export SAVEHIST=10000000 -setopt hist_ignore_space -setopt share_history -setopt hist_ignore_dups - -# keybinds -bindkey -e # emacs bindings -bindkey '^[[Z' reverse-menu-complete - -# prompt -setopt PROMPT_SUBST -export VIRTUAL_ENV_DISABLE_PROMPT=y -PROMPT='$(eo=%{ ec=%} prompt)' - -# auto venv -function cd() { - builtin cd "$@" - - if [ -n "$VIRTUAL_ENV" ] ; then - if [[ "$PWD"/ != "$(dirname "$VIRTUAL_ENV")"/* ]] && [ ! -z "$(command -v deactivate)" ] ; then - deactivate - else - return - fi - fi - - git_dir="$(git rev-parse --show-toplevel 2>/dev/null)" - for dir in ./ "$git_dir" ../ "$git_dir/.." ; do - [ ! -d "$dir" ] && continue - for file in "$dir"/.env "$dir"/venv/bin/activate ; do - [ ! -e "$file" ] && continue - source "$file" - return - done - done -} - -{{- if eq .chezmoi.os "darwin" }} - -eval "$(/opt/homebrew/bin/brew shellenv)" -{{- end }} diff --git a/home/private_Library/LaunchAgents/homebrew.mxcl.mpd.plist.tmpl b/home/private_Library/LaunchAgents/homebrew.mxcl.mpd.plist.tmpl new file mode 100644 index 0000000..dc82a82 --- /dev/null +++ b/home/private_Library/LaunchAgents/homebrew.mxcl.mpd.plist.tmpl @@ -0,0 +1,30 @@ + + + + + KeepAlive + + Label + homebrew.mxcl.mpd + LimitLoadToSessionType + + Aqua + Background + LoginWindow + StandardIO + System + + ProcessType + Interactive + ProgramArguments + + /opt/homebrew/opt/mpd/bin/mpd + --no-daemon + {{ env "XDG_CONFIG_HOME" }}/mpd/mpd.conf + + RunAtLoad + + WorkingDirectory + /opt/homebrew + + diff --git a/home/private_Library/LaunchAgents/homebrew.mxcl.syncthing.plist b/home/private_Library/LaunchAgents/homebrew.mxcl.syncthing.plist new file mode 100644 index 0000000..2932303 --- /dev/null +++ b/home/private_Library/LaunchAgents/homebrew.mxcl.syncthing.plist @@ -0,0 +1,30 @@ + + + + + KeepAlive + + Label + homebrew.mxcl.syncthing + LimitLoadToSessionType + + Aqua + Background + LoginWindow + StandardIO + System + + ProgramArguments + + /opt/homebrew/opt/syncthing/bin/syncthing + --no-browser + --no-restart + + RunAtLoad + + StandardErrorPath + /opt/homebrew/var/log/syncthing.log + StandardOutPath + /opt/homebrew/var/log/syncthing.log + + -- cgit v1.2.3