1
0
Fork 0
mirror of https://codeberg.org/Mo8it/server_dotfiles.git synced 2024-09-19 19:01:16 +00:00
server_dotfiles/.config/fish/config.fish

39 lines
885 B
Fish
Raw Permalink Normal View History

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-07-19 13:30:27 +00:00
podman create \
2022-07-19 21:14:13 +00:00
--name $container_name \
2023-08-17 21:56:32 +00:00
--replace \
2022-08-02 12:38:20 +00:00
--tz local \
2023-08-17 21:56:32 +00:00
-e TZ=Europe/Berlin \
$argv[2..]; or return 1
2022-07-19 13:30:27 +00:00
2023-08-17 21:56:32 +00:00
podman generate systemd --no-header --new --name $container_name >~/.config/systemd/user/container-$container_name.service; or return 1
2022-07-19 13:30:27 +00:00
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
2023-08-17 21:58:01 +00:00
set -x EDITOR ~/.cargo/bin/hx
2022-07-14 16:48:24 +00:00
# Abbreviations
## Replacements
2023-08-17 21:58:18 +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"
2022-09-08 22:35:52 +00:00
abbr -ag rmr "rm -r"
2022-08-05 12:07:43 +00:00
## Shortcuts
abbr -ag pps "podman ps --format '{{.Names}}'"
2022-07-14 16:48:24 +00:00
2023-08-17 21:58:18 +00:00
# Aliases
alias cat "bat"
2022-07-14 16:48:24 +00:00
end