diff --git a/shell/dot-local/bin/gl b/git/dot-local/bin/gl similarity index 100% rename from shell/dot-local/bin/gl rename to git/dot-local/bin/gl diff --git a/shell/dot-local/bin/addfonts b/shell/dot-local/bin/addfonts new file mode 100644 index 0000000..3ae1578 --- /dev/null +++ b/shell/dot-local/bin/addfonts @@ -0,0 +1,36 @@ +#!/bin/bash + +function install() { + name=$1 + src_dir=$2 + + mkdir -p /usr/share/fonts/$name + cp $src_dir/*.ttf /usr/share/fonts/$name/ + chmod 0775 /usr/share/fonts/$name + chmod 0664 /usr/share/fonts/$name/* +} + +function help() { + echo "$0 " +} + +if [[ -z "$1" ]]; then + help + exit +fi + +if [[ -z "$2" ]]; then + echo "ERROR: give at least two arguments" + echo + help + exit +fi + +if [[ ! -d "$2" ]]; then + echo "ERROR: $2 is not a directory" + echo + help + exit +fi + +install $1 "$2"