diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-21 11:30:46 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-21 11:30:46 +0000 |
commit | 0fd136032da867c46316931cf35fc361933ce76d (patch) | |
tree | ee1295e4221a722a32b91f0d9bdc41f68731ea1b /install.sh | |
parent | Initial commit. (diff) | |
download | powerline-fonts-5f126eaa2548e41d1025e4094494ddea481695a7.tar.xz powerline-fonts-5f126eaa2548e41d1025e4094494ddea481695a7.zip |
Adding upstream version 0~20240322.upstream/0_20240322upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'install.sh')
-rwxr-xr-x | install.sh | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..eab1ccd --- /dev/null +++ b/install.sh @@ -0,0 +1,28 @@ +#!/bin/sh + +# Set source and target directories +powerline_fonts_dir="$( cd "$( dirname "$0" )" && pwd )" + +# if an argument is given it is used to select which fonts to install +prefix="$1" + +if test "$(uname)" = "Darwin" ; then + # MacOS + font_dir="$HOME/Library/Fonts" +else + # Linux + font_dir="$HOME/.local/share/fonts" + mkdir -p $font_dir +fi + +# Copy all fonts to user fonts directory +echo "Copying fonts..." +find "$powerline_fonts_dir" \( -name "$prefix*.[ot]tf" -or -name "$prefix*.pcf.gz" \) -type f -print0 | xargs -0 -n1 -I % cp "%" "$font_dir/" + +# Reset font cache on Linux +if which fc-cache >/dev/null 2>&1 ; then + echo "Resetting font cache, this may take a moment..." + fc-cache -f "$font_dir" +fi + +echo "Powerline fonts installed to $font_dir" |