2022-07-14 16:48:24 +00:00
|
|
|
# Environment variables
|
|
|
|
set -p PATH "$HOME/.cargo/bin"
|
|
|
|
|
2022-07-19 13:30:27 +00:00
|
|
|
# Non interactive functions
|
|
|
|
function podman-default-create -w podman
|
2022-07-19 21:14:13 +00:00
|
|
|
set -l container_name $argv[1]
|
|
|
|
|
2022-08-02 12:38:20 +00:00
|
|
|
if systemctl --user is-enabled container-$container_name
|
|
|
|
systemctl --user disable --now container-$container_name
|
|
|
|
end
|
|
|
|
|
2022-07-19 21:14:13 +00:00
|
|
|
if podman container exists $container_name
|
|
|
|
podman stop $container_name
|
|
|
|
end
|
|
|
|
|
2022-07-19 13:30:27 +00:00
|
|
|
podman create \
|
2022-07-19 21:14:13 +00:00
|
|
|
--name $container_name \
|
2022-08-02 12:38:20 +00:00
|
|
|
--tz local \
|
2022-07-19 13:30:27 +00:00
|
|
|
$argv[2..]
|
|
|
|
|
|
|
|
set -l old_pwd (pwd)
|
|
|
|
cd ~/.config/systemd/user
|
2022-07-19 21:14:13 +00:00
|
|
|
podman generate systemd --new --files --name $container_name
|
2022-07-19 13:30:27 +00:00
|
|
|
cd $old_pwd
|
|
|
|
|
2022-07-19 21:14:13 +00:00
|
|
|
systemctl --user enable --now container-$container_name
|
2022-07-19 13:30:27 +00:00
|
|
|
end
|
|
|
|
|
2022-07-14 16:48:24 +00:00
|
|
|
if status is-interactive
|
2022-07-19 20:16:16 +00:00
|
|
|
# Disable greeting
|
|
|
|
set -g fish_greeting
|
|
|
|
|
2022-07-14 16:48:24 +00:00
|
|
|
# Interactive environment variables
|
|
|
|
set -x EDITOR /usr/bin/nvim
|
|
|
|
|
|
|
|
# Setup
|
2022-09-08 22:17:40 +00:00
|
|
|
## Atuin
|
|
|
|
set -gx ATUIN_NOBIND true
|
|
|
|
atuin init fish | source
|
|
|
|
bind \cr _atuin_search
|
2022-07-14 16:48:24 +00:00
|
|
|
|
|
|
|
# Abbreviations
|
|
|
|
## Replacements
|
2022-08-05 12:07:43 +00:00
|
|
|
abbr -ag rm trash
|
2022-07-14 16:48:24 +00:00
|
|
|
|
|
|
|
## Safety options
|
2022-08-05 12:07:43 +00:00
|
|
|
abbr -ag cp "cp -i"
|
|
|
|
abbr -ag mv "mv -i"
|
|
|
|
abbr -ag rmi "rm -i"
|
|
|
|
|
|
|
|
## Shortcuts
|
|
|
|
abbr -ag pps "podman ps --format '{{.Names}}'"
|
2022-07-14 16:48:24 +00:00
|
|
|
|
|
|
|
# Functions
|
|
|
|
## Replacements
|
|
|
|
function cat -w bat
|
|
|
|
bat $argv
|
|
|
|
end
|
|
|
|
end
|