Skip to content

Commit

Permalink
misc improvements to clean.sh, removed rare symbol from fish prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikBjare committed Jul 29, 2024
1 parent 4de1649 commit 6073faa
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 6 deletions.
27 changes: 22 additions & 5 deletions home/.bin/clean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ echo
echo "Checking size of commonly large folders:"
pushd ~/Downloads > /dev/null
DOWNLOADS_SIZE=$(ls-by-size | head -1 | cut -f 1)
echo " - Size of ~/Downloads: $DOWNLOADS_SIZE"
echo -e "\nSize of ~/Downloads: $DOWNLOADS_SIZE"
popd > /dev/null

echo
Expand All @@ -25,11 +25,28 @@ rm -rf ~/.cache/pypoetry/*cache
rm -rf ~/.cache/yarn
rm -rf ~/.cargo/registry

# Redundant since also done by `yay -Scc`
#sudo pacman -Sc --noconfirm
# if we have yay
if command -v yay; then
echo -e "\n# Yay found! Cleaning pacman cache"
yay -Scc --noconfirm
fi

# if we have docker, clean up dangling images
if (command -v docker > /dev/null); then
echo -e "\n# Docker found!"

echo -e "## Dangling images:"
docker images -f dangling=true | true

echo "Cleaning pacman cache"
yay -Scc --noconfirm
echo ""
read -p "Do you want to prune dangling images? (y/N): " -n 1 -r
echo ""

if [[ $REPLY =~ ^[Yy]$ ]]; then
echo "# Pruning dangling images"
docker image prune -f | true
fi
fi

# get current free space and calculate how much was freed
FREE_SPACE_AFTER=$(df / | tail -1 | awk '{print $4}')
Expand Down
3 changes: 2 additions & 1 deletion home/.config/fish/functions/fish_prompt.fish
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ function fish_prompt --description 'Write out the prompt'
set_color -b '111'

set_color -o 'fff'
echo -n ' 🗁 '
# echo -n ' 🗁 '
echo -n ' '
set_color '999'
echo -n (prompt_pwd)' '

Expand Down
6 changes: 6 additions & 0 deletions home/.vim/spell/en.utf-8.add
Original file line number Diff line number Diff line change
Expand Up @@ -226,3 +226,9 @@ multidevice
datastore
GitLab
popup
OpenCollective
momsregistreringsnummer
organisationsnummer
Revolut
SEB
aktiebolag

0 comments on commit 6073faa

Please sign in to comment.