From 5dcf01eff2a7fc1a60c5dc42da20660485d52af0 Mon Sep 17 00:00:00 2001 From: LailaTheElf Date: Wed, 3 Sep 2025 16:47:24 +0200 Subject: [PATCH] add cmd addfonts --- {shell => git}/dot-local/bin/gl | 0 shell/dot-local/bin/addfonts | 36 +++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) rename {shell => git}/dot-local/bin/gl (100%) create mode 100644 shell/dot-local/bin/addfonts 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"