diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-08-24 12:05:10 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-08-24 12:05:10 +0900 |
| commit | b15c6b710f19b74398acd738efb6281183c88b8d (patch) | |
| tree | 5f23c44e6f06a4b943f4db9d4b9ab69b07bc5446 /mac/.config | |
| parent | 818ff6ad1be60d8d0d9de039306d1fc5c7189081 (diff) | |
updates
Diffstat (limited to 'mac/.config')
| -rwxr-xr-x | mac/.config/lf/cleaner | 4 | ||||
| -rw-r--r-- | mac/.config/lf/lfrc | 66 | ||||
| -rwxr-xr-x | mac/.config/lf/scope | 14 | ||||
| -rw-r--r-- | mac/.config/shell/aliasrc | 14 | ||||
| -rw-r--r-- | mac/.config/shell/git-aliasrc | 2 | ||||
| -rw-r--r-- | mac/.config/shell/profile | 29 | ||||
| -rw-r--r-- | mac/.config/zsh/.zshrc | 11 |
7 files changed, 69 insertions, 71 deletions
diff --git a/mac/.config/lf/cleaner b/mac/.config/lf/cleaner index a380dcd..a5f68d5 100755 --- a/mac/.config/lf/cleaner +++ b/mac/.config/lf/cleaner @@ -1,5 +1,5 @@ #!/bin/sh -if [ -n "$FIFO_UEBERZUGPP" ]; then - printf '{"action": "remove", "identifier": "PREVIEW"}\n' >"$FIFO_UEBERZUGPP" +if command -v kitty >/dev/null 2>&1; then + kitty +kitten icat --silent --stdin no --transfer-mode file --clear >/dev/tty fi diff --git a/mac/.config/lf/lfrc b/mac/.config/lf/lfrc index 661ccf3..6243955 100644 --- a/mac/.config/lf/lfrc +++ b/mac/.config/lf/lfrc @@ -269,38 +269,38 @@ cmd mpvdir ${{ }} # Open -cmd open ${{ - case $(file --mime-type "$(readlink -f $f)" -b) in - application/octet-stream) - case ${f##*.} in - doc|docx|xls|xlsx|odt|ppt|pptx) setsid -f libreoffice $fx >/dev/null 2>&1 ;; - ghw) setsid -f gtkwave $f >/dev/null 2>&1 ;; - ts) setsid -f mpv --x11-name=video $f -quiet >/dev/null 2>&1 ;; - *) setsid -f zathura $fx >/dev/null 2>&1 ;; - esac - ;; - application/epub*|application/pdf|application/postscript|application/vnd.djvu|image/vnd.djvu) setsid -f zathura $fx >/dev/null 2>&1 ;; - application/pgp-encrypted) $EDITOR $fx ;; - application/vnd.oasis.opendocument.text|application/vnd.oasis.opendocument.spreadsheet|application/vnd.oasis.opendocument.spreadsheet-template|application/vnd.oasis.opendocument.presentation-template|application/vnd.oasis.opendocument.presentation|application/vnd.ms-powerpoint|application/vnd.oasis.opendocument.graphics|application/vnd.oasis.opendocument.graphics-template|application/vnd.oasis.opendocument.formula|application/vnd.oasis.opendocument.database) setsid -f firefox $fx >/dev/null 2>&1 ;; - application/x-hwp|application/vnd.openxmlformats-officedocument.presentationml.presentation|application/vnd.openxmlformats-officedocument.wordprocessingml.document) setsid -f libreoffice $fx >/dev/null 2>&1 ;; - audio/*|video/x-ms-asf) setsid -f mpv --volume=50 --x11-name=music --force-window=yes --audio-display=embedded-first $f >/dev/null 2>&1 ;; - image/x-xcf) setsid -f gimp $f >/dev/null 2>&1 ;; - image/svg+xml) display -- $f ;; - image/*) rotdir $f | grep -i "\.\(png\|jpg\|jpeg\|gif\|webp\|avif\|tif\|ico\)\(_large\)*$" | - setsid -f nsxiv -aiop 2>/dev/null | while read -r file; do - [ -z "$file" ] && continue - lf -remote "send select \"$file\"" - lf -remote "send toggle" - done & - ;; - text/csv|application/vnd.openxmlformats-officedocument.spreadsheetml.sheet) sc-im $fx;; - text/html|text/xml) lynx $fx;; - text/troff) groff -mom $fx -Tpdf | zathura - ;; - text/*|application/json|inode/x-empty|application/x-subrip) $EDITOR $fx;; - video/*) setsid -f mpv --x11-name=video -quiet $f >/dev/null 2>&1 ;; - *) for f in $fx; do setsid -f ${OPENER:-xdg-open} $f >/dev/null 2>&1; done;; - esac -}} +# cmd open ${{ +# case $(file --mime-type "$(readlink -f $f)" -b) in +# application/octet-stream) +# case ${f##*.} in +# doc|docx|xls|xlsx|odt|ppt|pptx) setsid -f libreoffice $fx >/dev/null 2>&1 ;; +# ghw) setsid -f gtkwave $f >/dev/null 2>&1 ;; +# ts) setsid -f mpv --x11-name=video $f -quiet >/dev/null 2>&1 ;; +# *) setsid -f zathura $fx >/dev/null 2>&1 ;; +# esac +# ;; +# application/epub*|application/pdf|application/postscript|application/vnd.djvu|image/vnd.djvu) setsid -f zathura $fx >/dev/null 2>&1 ;; +# application/pgp-encrypted) $EDITOR $fx ;; +# application/vnd.oasis.opendocument.text|application/vnd.oasis.opendocument.spreadsheet|application/vnd.oasis.opendocument.spreadsheet-template|application/vnd.oasis.opendocument.presentation-template|application/vnd.oasis.opendocument.presentation|application/vnd.ms-powerpoint|application/vnd.oasis.opendocument.graphics|application/vnd.oasis.opendocument.graphics-template|application/vnd.oasis.opendocument.formula|application/vnd.oasis.opendocument.database) setsid -f firefox $fx >/dev/null 2>&1 ;; +# application/x-hwp|application/vnd.openxmlformats-officedocument.presentationml.presentation|application/vnd.openxmlformats-officedocument.wordprocessingml.document) setsid -f libreoffice $fx >/dev/null 2>&1 ;; +# audio/*|video/x-ms-asf) setsid -f mpv --volume=50 --x11-name=music --force-window=yes --audio-display=embedded-first $f >/dev/null 2>&1 ;; +# image/x-xcf) setsid -f gimp $f >/dev/null 2>&1 ;; +# image/svg+xml) display -- $f ;; +# image/*) rotdir $f | grep -i "\.\(png\|jpg\|jpeg\|gif\|webp\|avif\|tif\|ico\)\(_large\)*$" | +# setsid -f nsxiv -aiop 2>/dev/null | while read -r file; do +# [ -z "$file" ] && continue +# lf -remote "send select \"$file\"" +# lf -remote "send toggle" +# done & +# ;; +# text/csv|application/vnd.openxmlformats-officedocument.spreadsheetml.sheet) sc-im $fx;; +# text/html|text/xml) lynx $fx;; +# text/troff) groff -mom $fx -Tpdf | zathura - ;; +# text/*|application/json|inode/x-empty|application/x-subrip) $EDITOR $fx;; +# video/*) setsid -f mpv --x11-name=video -quiet $f >/dev/null 2>&1 ;; +# *) for f in $fx; do setsid -f ${OPENER:-xdg-open} $f >/dev/null 2>&1; done;; +# esac +# }} # Rename cmd bulkrename ${{ @@ -536,7 +536,7 @@ map th $nsxiv -apt "$(pwd)" # Open map O $mimeopen "$f" -map o open +map o open "$f" map <c-o> $mimeopen --ask "$f" # Paste diff --git a/mac/.config/lf/scope b/mac/.config/lf/scope index fc26f5e..2a2f7fa 100755 --- a/mac/.config/lf/scope +++ b/mac/.config/lf/scope @@ -7,10 +7,16 @@ IFS="$(printf '%b_' '\n')" IFS="${IFS%_}" image() { - if [ -f "$1" ] && [ -n "$DISPLAY" ] && [ -z "$WAYLAND_DISPLAY" ] && command -V ueberzugpp >/dev/null 2>&1; then - printf '{"action": "add", "identifier": "PREVIEW", "x": "%s", "y": "%s", "width": "%s", "height": "%s", "scaler": "contain", "path": "%s"}\n' "$4" "$(($5 + 1))" "$(($2 - 1))" "$(($3 - 2))" "$1" >"$FIFO_UEBERZUGPP" + if [ -f "$1" ] && command -v kitty >/dev/null 2>&1; then + file=$1 + w=$2 + h=$3 + x=$4 + y=$5 + kitty +kitten icat --silent --stdin no --transfer-mode file --place "${w}x${h}@${x}x${y}" "$file" </dev/null >/dev/tty mediainfo --Output="Video;%Duration/String%" "$6" else + chafa "$1" -s "$4x" mediainfo "$6" fi } @@ -30,12 +36,12 @@ image/vnd.djvu) [ ! -f "$CACHE" ] && djvused "$1" -e 'select 1; save-page-with /dev/stdout' | magick -density 200 - "$CACHE.jpg" >/dev/null 2>&1 image "$CACHE.jpg" "$2" "$3" "$4" "$5" "$1" ;; -image/svg+xml) +image/svg+xml | image/png) CACHE="${XDG_CACHE_HOME:-$HOME/.cache}/lf/thumb.$(stat --printf '%n\0%i\0%F\0%s\0%W\0%Y' -- "$(readlink -f "$1")" | sha256sum | cut -d' ' -f1)" [ ! -f "$CACHE" ] && inkscape --convert-dpi-method=none -o "$CACHE.png" --export-overwrite -D --export-png-color-mode=RGBA_16 "$1" image "$CACHE.png" "$2" "$3" "$4" "$5" "$1" ;; -image/x-xcf) +image/x-xcf | image/jpg | image/jpeg) CACHE="${XDG_CACHE_HOME:-$HOME/.cache}/lf/thumb.$(stat --printf '%n\0%i\0%F\0%s\0%W\0%Y' -- "$(readlink -f "$1")" | sha256sum | awk '{print $1}')" [ ! -f "$CACHE.jpg" ] && magick "$1[0]" "$CACHE.jpg" image "$CACHE.jpg" "$2" "$3" "$4" "$5" "$1" diff --git a/mac/.config/shell/aliasrc b/mac/.config/shell/aliasrc index 13ae888..30fb9f9 100644 --- a/mac/.config/shell/aliasrc +++ b/mac/.config/shell/aliasrc @@ -206,7 +206,7 @@ alias dgst='dotbare status' alias ff='fastfetch' # fcitx5-remote -alias fr='fcitx5-remote' +# alias fr='fcitx5-remote' # ffmpeg alias ffmpeg='ffmpeg -hide_banner' @@ -255,7 +255,7 @@ alias k9='kill -9' alias k15='kill -15' # lf -alias lf='lfub' +# alias lf='lfub' # mime alias mimereset="update-desktop-database ${XDG_DATA_HOME:-${HOME}/.local/share}/applications" @@ -298,7 +298,7 @@ alias nsxiv='nsxiv -p' alias vo="cd $HOME/Obsidian/SI && nvim Dashboard.md" # open -alias open='xdg-open' +# alias open='xdg-open' # pacman command -v pacman > /dev/null 2>&1 && { @@ -343,9 +343,9 @@ alias rscr='rsync -vrazPlu --remove-source-files' alias rrr='sudo udevadm control --reload-rules' # samba -alias winip="[ ! -d /media/$USER/hdd >/dev/null 2>&1 ] && mkdir -p /media/$USER/hdd >/dev/null 2>&1; sudo mount -t cifs //$(pass show smb/hdd) /media/$USER/hdd -o username=\"si\",password=\"$(pass show default/default)vers=2.0\"" -alias win10="[ ! -d /media/$USER/win10 >/dev/null 2>&1 ] && mkdir -p /media/$USER/win10 >/dev/null 2>&1; sudo mount -t cifs //$(pass show smb/share) /media/$USER/win10 -o username=\"THESIAHXYZ-WIN1\",password=\"$(pass show default/default)\"" -alias macair="[ ! -d /media/$USER/macair >/dev/null 2>&1 ] && mkdir -p /media/$USER/macair >/dev/null 2>&1; sudo mount -t cifs //$(pass show smb/macair)/si /media/$USER/macair -o username=\"Soomin Im\",password=\"$(pass show default/default)\"" +# alias winip="[ ! -d /media/$USER/hdd >/dev/null 2>&1 ] && mkdir -p /media/$USER/hdd >/dev/null 2>&1; sudo mount -t cifs //$(pass show smb/hdd) /media/$USER/hdd -o username=\"si\",password=\"$(pass show default/default)vers=2.0\"" +# alias win10="[ ! -d /media/$USER/win10 >/dev/null 2>&1 ] && mkdir -p /media/$USER/win10 >/dev/null 2>&1; sudo mount -t cifs //$(pass show smb/share) /media/$USER/win10 -o username=\"THESIAHXYZ-WIN1\",password=\"$(pass show default/default)\"" +# alias macair="[ ! -d /media/$USER/macair >/dev/null 2>&1 ] && mkdir -p /media/$USER/macair >/dev/null 2>&1; sudo mount -t cifs //$(pass show smb/macair)/si /media/$USER/macair -o username=\"Soomin Im\",password=\"$(pass show default/default)\"" # sc-im alias scim='sc-im' @@ -372,7 +372,7 @@ alias tofish="sudo chsh $USER -s /bin/fish && 'Now log out.'" alias shck='shellcheck --color=always' # shortcut -alias ref='shortcuts >/dev/null; source ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/shortcutrc; source ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/shortcutenvrc; source ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/zshnameddirrc' +alias ref='localshortcuts >/dev/null; source ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/shortcutrc; source ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/shortcutenvrc; source ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/zshnameddirrc' # skype alias skype='skypeforlinux' diff --git a/mac/.config/shell/git-aliasrc b/mac/.config/shell/git-aliasrc index f87a556..e6560c4 100644 --- a/mac/.config/shell/git-aliasrc +++ b/mac/.config/shell/git-aliasrc @@ -102,7 +102,7 @@ compdef _git ggpnp=git-checkout alias ggpur='ggu' alias g='git' -! pidof transmission-daemon >/dev/null && alias gaa='git add --all' || alias gaa='echo "Turn off transmission-daemon first!"' +! pgrep -x transmission-daemon >/dev/null 2>&1 && alias gaa='git add --all' || alias gaa='echo "Turn off transmission-daemon first!"' alias gapa='git add --patch' alias gau='git add --update' alias gav='git add --verbose' diff --git a/mac/.config/shell/profile b/mac/.config/shell/profile index ad43eb2..21858e9 100644 --- a/mac/.config/shell/profile +++ b/mac/.config/shell/profile @@ -3,6 +3,7 @@ ################################################### # Add all directories in each subdirectory to $PATH export PATH="$PATH:/opt/homebrew/bin" +export PATH="$PATH:$(find -L /opt/homebrew/opt -name bin -type d -print 2>/dev/null | sort -u | paste -s -d ':' -)" export PATH="$PATH:$(find ~/.local/bin -path '*/.git*' -prune -o \( -type f -o -type l \) -perm -u=x -exec dirname {} \; | sort -u | paste -sd ':' -)" export PATH="$PATH:$(find ~/.local/share/.password-store -type d -name '.extensions' | paste -sd ':' -)" @@ -113,19 +114,19 @@ export LYNX_CFG_PATH="$XDG_CONFIG_HOME/lynx" ### --- MANPAGER --- ### ([ -x "$(command -v batcat)" ] || [ -x "$(command -v batman)" ]) && { - export MANPAGER="sh -c 'col -bx | bat -l man -p'" - export MANROFFOPT="-c" -} || { - export MANPAGER='less -s' - export LESS="R" - export LESS_TERMCAP_mb="$(printf '%b' '[1;31m')" - export LESS_TERMCAP_md="$(printf '%b' '[1;36m')" - export LESS_TERMCAP_me="$(printf '%b' '[0m')" - export LESS_TERMCAP_so="$(printf '%b' '[01;44;33m')" - export LESS_TERMCAP_se="$(printf '%b' '[0m')" - export LESS_TERMCAP_us="$(printf '%b' '[1;32m')" - export LESS_TERMCAP_ue="$(printf '%b' '[0m')" - export LESSOPEN="| lesspipe.sh %s" + export MANPAGER="sh -c 'col -bx | bat -l man -p'" + export MANROFFOPT="-c" + } || { + export MANPAGER='less -s' + export LESS="R" + export LESS_TERMCAP_mb="$(printf '%b' '[1;31m')" + export LESS_TERMCAP_md="$(printf '%b' '[1;36m')" + export LESS_TERMCAP_me="$(printf '%b' '[0m')" + export LESS_TERMCAP_so="$(printf '%b' '[01;44;33m')" + export LESS_TERMCAP_se="$(printf '%b' '[0m')" + export LESS_TERMCAP_us="$(printf '%b' '[1;32m')" + export LESS_TERMCAP_ue="$(printf '%b' '[0m')" + export LESSOPEN="| lesspipe.sh %s" } ### --- MOZILLA --- ### @@ -159,6 +160,8 @@ export POWERLEVEL9K_INSTALLATION_DIR="/usr/share/zsh-theme-powerlevel10k" ### --- PYTHON --- ### export PYTHONPYCACHEPREFIX=$XDG_CACHE_HOME/python export PYTHONSTARTUP="$XDG_CONFIG_HOME/python/pythonrc" +export PIPX_BIN_DIR="$XDG_SCRIPTS_HOME" +export PIPX_MAN_DIR="$XDG_DATA_HOME/man" ### --- RUST --- ### export RUSTUP_HOME="$XDG_DATA_HOME/rustup" diff --git a/mac/.config/zsh/.zshrc b/mac/.config/zsh/.zshrc index 4126b8f..d5f3490 100644 --- a/mac/.config/zsh/.zshrc +++ b/mac/.config/zsh/.zshrc @@ -112,14 +112,3 @@ zstyle ':fzf-tab:*' switch-group ',' '.' # switch group using `,` and `.` [ -f "${XDG_CONFIG_HOME:-${HOME}/.config}/shell/shortcutrc" ] && source "${XDG_CONFIG_HOME:-${HOME}/.config}/shell/shortcutrc" [ -f "${XDG_CONFIG_HOME:-${HOME}/.config}/shell/shortcutenvrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutenvrc" [ -f "${XDG_CONFIG_HOME:-${HOME}/.config}/shell/zshnameddirrc" ] && source "${XDG_CONFIG_HOME:-${HOME}/.config}/shell/zshnameddirrc" - -if command -v tmux >/dev/null 2>&1 && [ -z "$TMUX" ]; then - terminal_count=$(pgrep -u "$USER" -ax "${TERMINAL:-st}" | grep -Ev 'ncmpcpp|newsboat|pulsemixer|spterm|splf|spcalc|stig|vimwikitodo' | wc -l) - if [ "$terminal_count" -le 1 ]; then - if ! tmux has-session 2>/dev/null; then - exec tmux new-session -s code - else - exec tmux attach-session - fi - fi -fi |
