home/tui/fish/config.fish
2024-01-21 12:09:37 +01:00

84 lines
2.3 KiB
Fish

# Start Hyprland by default when in tty and it isn't running.
if status is-login && not pidof -q Hyprland
Hyprland
else
# UI settings.
set fish_greeting
set hydro_color_pwd blue
set hydro_color_prompt black
set hydro_symbol_prompt '| λ ::'
# Structuring settings.
set -x vault_d "/home/$USER/vault"
set -x config_d "$vault_d/config"
set -x specific_d "$vault_d/specific"
set -x tmp_d "$specific_d/tmp"
set -x garbage_d "$tmp_d/garbage"
# Utilities settings.
set -e SSH_ASKPASS
set -x EDITOR 'hx'
set -x MANPAGER "sh -c 'col -bx | bat -l man -p'"
set -x MANROFFOPT "-c"
set -x GNUPGHOME "$vault_d/gpg"
set -x PASSWORD_STORE_DIR "$GNUPGHOME/password-store"
set -x BAT_THEME 'Nord'
set -x BAT_STYLE 'grid,numbers'
set -x LS_COLORS (echo (sh -c 'dircolors') | awk -F '\'' '{ print $2 }')
set -x GTK_THEME "Catppuccin-Macchiato-Standard-Blue-Dark";
# Aliases.
alias ls_garbage "ls $garbage_d"
alias ls_tmp "ls $tmp_d"
alias volume 'alsamixer -g'
alias browser 'mullvad-browser'
alias edit $EDITOR
alias see 'bat'
alias hibernate 'systemctl hibernate'
alias nsh 'env | grep -q IN_NIX_SHELL || return 1'
alias run 'qemu-riscv64 target/bin'
# Allows us to background everything, using a subshell.
function back -d 'Puts the command into the background'
fish -c (string join -- ' ' (string escape -- $argv)) &
end
# Save files before removing them.
function delete -d 'Safely remove files.'
mkdir -p $garbage_d
mv -f $argv $garbage_d
end
# Save files.
function save -d 'Save files.'
mkdir -p $garbage_d
cp -rf $argv $tmp_d
end
# Archives files.
function archive -d 'Compress files.'
if [ $argv[1] = '-d' ]
tar -xf $argv[2]
else
set argv[1] (string trim -rc '/' $argv[1])
if [ -e $argv[1].tar ]
tar -uf $argv[1].tar $argv[1]
else
tar -cf $argv[1].tar $argv[1]
end
end
end
# Removes metadata inplace and save the file at $tmp_d.
function clean -d 'Removes metadata inplace.'
mkdir -p $garbage_d
cp -rf $argv $garbage_d
mat2 --inplace $argv
end
end