This commit is contained in:
2026-03-27 02:19:37 +01:00
parent 22f55f2ae9
commit bcd2909722
8 changed files with 184 additions and 94 deletions
+17 -8
View File
@@ -1,17 +1,26 @@
[Settings]
gtk-theme-name=catppuccin-mocha-blue-standard+default
gtk-icon-theme-name=Papirus
gtk-font-name=Sarasa UI SC 10
gtk-application-prefer-dark-theme=true
gtk-button-images=true
gtk-cursor-blink=true
gtk-cursor-blink-time=1000
gtk-cursor-theme-name=Bibata-Modern-Ice
gtk-cursor-theme-size=24
gtk-toolbar-style=GTK_TOOLBAR_ICONS
gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR
gtk-button-images=0
gtk-menu-images=0
gtk-decoration-layout=icon:minimize,maximize,close
gtk-enable-animations=true
gtk-enable-event-sounds=1
gtk-enable-input-feedback-sounds=0
gtk-font-name=Sarasa UI SC, 10
gtk-icon-theme-name=Papirus
gtk-menu-images=true
gtk-modules=colorreload-gtk-module:appmenu-gtk-module
gtk-primary-button-warps-slider=true
gtk-shell-shows-menubar=1
gtk-sound-theme-name=ocean
gtk-theme-name=catppuccin-mocha-blue-standard+default
gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR
gtk-toolbar-style=3
gtk-xft-antialias=1
gtk-xft-dpi=122880
gtk-xft-hinting=1
gtk-xft-hintstyle=hintslight
gtk-xft-rgba=rgb
gtk-application-prefer-dark-theme=1
+11 -4
View File
@@ -1,7 +1,14 @@
[Settings]
gtk-theme-name=catppuccin-mocha-blue-standard+default
gtk-icon-theme-name=Papirus
gtk-font-name=Sarasa UI SC 10
gtk-application-prefer-dark-theme=true
gtk-cursor-blink=true
gtk-cursor-blink-time=1000
gtk-cursor-theme-name=Bibata-Modern-Ice
gtk-cursor-theme-size=24
gtk-application-prefer-dark-theme=1
gtk-decoration-layout=icon:minimize,maximize,close
gtk-enable-animations=true
gtk-font-name=Sarasa UI SC, 10
gtk-icon-theme-name=Papirus
gtk-primary-button-warps-slider=true
gtk-sound-theme-name=ocean
gtk-theme-name=catppuccin-mocha-blue-standard+default
gtk-xft-dpi=122880
+2 -1
View File
@@ -23,6 +23,7 @@ trap cleanup EXIT
sudo mount -t tmpfs -o size=8G tmpfs "$mountpoint"
tar -xf "$tarball" -C "$mountpoint"
cd "$mountpoint/$top_dir"
pushd "$mountpoint/$top_dir" > /dev/null
echo "Spawning shell in tmpfs. Type 'exit' to finish and cleanup."
bash
popd > /dev/null
+34 -14
View File
@@ -2,45 +2,65 @@
if type -q fzf
fzf --fish | source
# auto copy fzf's output
if type -q wl-copy
alias fzf="fzf --bind 'enter:execute-silent(echo {+} | wl-copy --trim-newline)+accept'"
# use fd if available
if type -q fd
set -x FD_CMD "fd"
else if type -q fdfind
set -x FD_CMD "fdfind"
end
if test -n "$FD_CMD"
set -x FZF_DEFAULT_COMMAND "$FD_CMD --type f --hidden --exclude .git"
set -x FZF_CTRL_T_COMMAND "$FZF_DEFAULT_COMMAND"
set -x FZF_ALT_C_COMMAND "$FD_CMD --type d --hidden --exclude .git"
end
# fzh: history
alias fzh="history | fzf"
# C-y to copy fzf's output
if type -q wl-copy
set -x FZF_DEFAULT_OPTS "--bind \"ctrl-y:execute-silent(echo -n {+} | wl-copy)+abort\""
end
# fz: fuzzy find a file and preview
if type -q bat
alias fz="fzf --preview 'bat --style=numbers --color=always {}'"
else
alias fz="fzf --preview 'cat --number {}'"
alias fz="fzf --preview 'bat --style=numbers --color=always {}'"
else
alias fz="fzf --preview 'cat -n {}'"
end
# fe: fuzzy find a file and edit using $EDITOR
function fe
set -l file $(fz $argv)
set -l file $(fz --header "[edit with $EDITOR]")
if test -n "$file"
$EDITOR "$file"
end
end
# fkill: fuzzy find a process and kill with SIGKILL
function fkill
set -l pids (ps -ef | sed 1d | fzf -m --preview 'pstree -p $(echo {} | awk "{print \$2}")' | awk '{print $2}')
# fkp: fuzzy find a process and kill with SIGKILL
function fkp
set -l pids (ps -ef | sed 1d | fzf -m --preview 'pstree -p $(echo {} | awk "{print \$2}")' --header '[kill process]' | awk '{print $2}')
if test -n "$pids"
kill -9 $pids
end
end
# fks: fuzzy find a TCP process and kill with SIGKILL
if type -q ss
function fks
set -l entries (sudo ss -lptn)
set -l pids (echo "$entries" | fzf -m --header-lines 1 --header '[kill process]' | grep -oP 'pid=\K\d+')
if test -n "$pids"
sudo kill -9 $pids
end
end
end
if type -q yay
# fyq: fuzzy yay query
alias fyq="yay -Qq | fzf --preview 'yay -Qi {}'"
# fyi: fuzzy yay install
function fyi
set -l pkg (yay -Sl | awk '{print $1"/"$2}' | fzf -m --preview 'yay -Si {}' $argv)
set -l pkg (yay -Sl | awk '{print $1"/"$2}' | fzf -m --preview 'yay -Si {}' --header "[install package]" $argv)
if test -n "$pkg"
yay -S $pkg
end
@@ -48,7 +68,7 @@ if type -q fzf
# fyr: fuzzy yay remove
function fyr
set -l pkg (yay -Qq | fzf -m --preview 'yay -Qi {}' $argv)
set -l pkg (yay -Qq | fzf -m --preview 'yay -Qi {}' --header "[remove package]" $argv)
if test -n "$pkg"
yay -Rn $pkg
end
+14 -5
View File
@@ -13,16 +13,13 @@ setopt HIST_VERIFY
setopt AUTO_CD EXTENDED_GLOB NOTIFY INTERACTIVE_COMMENTS
bindkey -e
# Allow word-based navigation and deletion to work on paths
WORDCHARS=${WORDCHARS//\//}
WORDCHARS=${WORDCHARS//[\/=\*-]/}
# Rookie keybindings :)
bindkey '^[[1;5D' backward-word # C-Left
bindkey '^[[1;5C' forward-word # C-Right
bindkey '^H' backward-kill-word # C-Backspace (also C-H)
bindkey '^Z' undo # C-z
# bindkey '^Z' undo # C-z
# A-s to prepend sudo
uy_prepend_sudo() {
@@ -35,3 +32,15 @@ uy_prepend_sudo() {
}
zle -N uy_prepend_sudo
bindkey '^[s' uy_prepend_sudo
# Edit current command in editor
autoload -Uz edit-command-line
zle -N edit-command-line
bindkey '^X' edit-command-line
# Magic space
# bindkey ' ' magic-space
# This is already handled by tab
# zmv
autoload zmv
+3 -3
View File
@@ -7,11 +7,11 @@ uy_oops_confirm() {
local last_line=$(tail -n 1 "$HISTFILE")
if [[ -z "$last_line" ]]; then
print -P "%F{yellow}History file is empty, nothing to clean. %f"
print -P "%F{yellow}History file is empty, nothing to delete.%f"
return 0
fi
print -P "About to permanently delete the last command from history:"
print -P "About to permanently delete the last command from history file:"
print -P "%F{red} $last_line%f"
local reply
@@ -20,7 +20,7 @@ uy_oops_confirm() {
if [[ -z "$reply" || "$reply" == [yY]* ]]; then
sed -i '$d' "$HISTFILE"
print -P "%F{green}Command removed from history.%f"
print -P "%F{green}Command removed from history file (may still visible in current session).%f"
else
print -P "%F{yellow}Operation cancelled.%f"
fi
+17 -5
View File
@@ -9,7 +9,6 @@ if (( $+commands[fzf] )); then
elif (( $+commands[fdfind] )); then
export FD_CMD="fdfind"
fi
if [[ -n "$FD_CMD" ]]; then
export FZF_DEFAULT_COMMAND="$FD_CMD --type f --hidden --exclude .git"
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
@@ -38,7 +37,7 @@ if (( $+commands[fzf] )); then
# fkp: fuzzy find a process and kill
fkp() {
local pids
pids=$(ps -ef | fzf -m --header-lines 1 --preview 'pstree -p $(echo {} | awk "{print \$2}")' --header '[kill process]' | awk '{print $2}')
pids=$(ps -ef | fzf -m --header-lines 1 --preview 'pstree -p $(echo {} | awk "{print \$2}")' --header "[kill process]" | awk '{print $2}')
echo "$pids" | xargs -r kill -${1:-9}
}
@@ -48,7 +47,7 @@ if (( $+commands[fzf] )); then
local pids
# Call sudo separately since one cannot enter password in fzf's window
pids=$(sudo ss -lptn)
pids=$(echo "$pids" | fzf -m --header-lines 1 --header '[kill process]' | grep -oP 'pid=\K\d+')
pids=$(echo "$pids" | fzf -m --header-lines 1 --header "[kill process]" | grep -oP 'pid=\K\d+')
echo "$pids" | xargs -r sudo kill -${1:-9}
}
fi
@@ -60,7 +59,7 @@ if (( $+commands[fzf] )); then
# fyi: fuzzy yay install
fyi() {
local pkg
pkg=$(yay -Sl | awk '{print $1"/"$2}' | fzf -m --preview 'yay -Si {}' --header '[install package]' "$@")
pkg=$(yay -Sl | awk '{print $1"/"$2}' | fzf -m --preview 'yay -Si {}' --header "[install package]" "$@")
# yay supports "repo/package" format
[[ -n "$pkg" ]] && yay -S ${=pkg}
}
@@ -68,7 +67,7 @@ if (( $+commands[fzf] )); then
# fyr: fuzzy yay remove
fyr() {
local pkg
pkg=$(yay -Qq | fzf -m --preview 'yay -Qi {}' --header '[remove package]' "$@")
pkg=$(yay -Qq | fzf -m --preview 'yay -Qi {}' --header "[remove package]" "$@")
[[ -n "$pkg" ]] && yay -Rn ${=pkg}
}
fi
@@ -207,3 +206,16 @@ if (( $+commands[git] )); then
}
fi
fi
# Global aliases (can be used as part of a command)
# wl-paste
if (( $+commands[wl-paste] )); then
alias -g C="| wl-copy"
fi
# Redirects
alias -g NE="2>/dev/null"
alias -g NO=">/dev/null"
alias -g EO="2>&1"
alias -g NUL="&>/dev/null"