1
Fork 0
mirror of https://github.com/Steffo99/config-fish.git synced 2024-10-16 14:27:34 +00:00

Compare commits

..

3 commits

Author SHA1 Message Date
1269191e0d
Add venv to right prompt 2024-09-09 15:54:43 +02:00
1be4fe9a77
Add pad-image function 2024-09-09 15:53:02 +02:00
526504fe0c
Add uvx python functions 2024-09-09 15:52:48 +02:00
4 changed files with 37 additions and 1 deletions

View file

@ -1,4 +1,18 @@
function fish_right_prompt
if [ -n "$VIRTUAL_ENV_PROMPT" ]
set_color white
echo -n -- "{venv:"
set_color reset
set_color brcyan
echo -n -- " $VIRTUAL_ENV_PROMPT"
set_color reset
set_color white
echo -n -- "}"
set_color reset
end
if [ -f "compose.yml" ]
set --local docker_pod_name (docker compose config --format="json" | jq --raw-output '.name')
set --local docker_pod_states_output (docker compose ps --format="json" --all | jq --slurp --raw-output '.[].State')
@ -10,7 +24,7 @@ function fish_right_prompt
set --local docker_pod_dead_count (echo "$docker_pod_states_output" | grep --only-matching 'dead' - | wc --lines)
set_color white
echo -n -- "{"
echo -n -- "{compose:"
set_color reset
if [ "$docker_pod_dead_count" -gt 0 ]

10
functions/pad-image.fish Normal file
View file

@ -0,0 +1,10 @@
which magick --skip-functions >/dev/null 2>/dev/null
if [ $status -eq 0 ]
function pad-image
log-t "Creating" "Images padded to $argv[1]" "directory..."
command mkdir --parents "Images padded to $argv[1]"
log-d "Padding" "$argv[3]" "to $argv[1]..."
command magick -background "$argv[2]" "$argv[3]" -resize "$argv[1]" -gravity "center" -extent "$argv[1]" $argv[4..-1] "Images padded to $argv[1]/$argv[3]"
log-t "Done! Emoji added to the" "Images padded to $argv[1]" "directory!"
end
end

View file

@ -0,0 +1,6 @@
which uvx --skip-functions >/dev/null 2>/dev/null
if [ $status -eq 0 ]
function python-build
uvx --from build pyproject-build --installer uv
end
end

View file

@ -0,0 +1,6 @@
which uvx --skip-functions >/dev/null 2>/dev/null
if [ $status -eq 0 ]
function python-publish
uvx twine upload --non-interactive --verbose --username "Steffo" dist/*
end
end