mirror of
https://codeberg.org/Mo8it/server_dotfiles.git
synced 2024-11-08 22:21:08 +00:00
59 lines
1.2 KiB
Fish
59 lines
1.2 KiB
Fish
# Environment variables
|
|
set -p PATH "$HOME/.cargo/bin"
|
|
|
|
# Non interactive functions
|
|
function podman-default-create -w podman
|
|
set -l container_name $argv[1]
|
|
|
|
if systemctl --user is-enabled container-$container_name
|
|
systemctl --user disable --now container-$container_name
|
|
end
|
|
|
|
if podman container exists $container_name
|
|
podman stop $container_name
|
|
end
|
|
|
|
podman create \
|
|
--name $container_name \
|
|
--tz local \
|
|
$argv[2..]
|
|
|
|
set -l old_pwd (pwd)
|
|
cd ~/.config/systemd/user
|
|
podman generate systemd --new --files --name $container_name
|
|
cd $old_pwd
|
|
|
|
systemctl --user enable --now container-$container_name
|
|
end
|
|
|
|
if status is-interactive
|
|
# Disable greeting
|
|
set -g fish_greeting
|
|
|
|
# Interactive environment variables
|
|
set -x EDITOR /usr/bin/nvim
|
|
|
|
# Setup
|
|
## Atuin
|
|
set -gx ATUIN_NOBIND true
|
|
atuin init fish | source
|
|
bind \cr _atuin_search
|
|
|
|
# Abbreviations
|
|
## Replacements
|
|
abbr -ag rm trash
|
|
|
|
## Safety options
|
|
abbr -ag cp "cp -i"
|
|
abbr -ag mv "mv -i"
|
|
abbr -ag rmi "rm -i"
|
|
|
|
## Shortcuts
|
|
abbr -ag pps "podman ps --format '{{.Names}}'"
|
|
|
|
# Functions
|
|
## Replacements
|
|
function cat -w bat
|
|
bat $argv
|
|
end
|
|
end
|