瀏覽代碼

Support running script from anywhere

References the programs fonts, no matter where the script is run from.
master
Matt Baer 7 年之前
父節點
當前提交
6ca47e77d9
共有 1 個檔案被更改,包括 6 行新增5 行删除
  1. +6
    -5
      text-to-image.sh

+ 6
- 5
text-to-image.sh 查看文件

@@ -45,14 +45,15 @@ esac

echo "Thanks. Generating image..."

font_reg=$HOME/.local/share/fonts/Lora-Regular.ttf
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
font_reg=$DIR/fonts/Lora-Regular.ttf
if [ "$font" = "mono" ]; then
font_reg=$HOME/.local/share/fonts/Hack-Regular.ttf
font_reg=$DIR/fonts/Hack-Regular.ttf
elif [ "$font" != "norm" ]; then
font_reg=$HOME/.local/share/fonts/OpenSans-Regular.ttf
font_reg=$DIR/fonts/OpenSans-Regular.ttf
fi
write_bold=$HOME/.local/share/fonts/Lora-Bold.ttf
write_reg=$HOME/.local/share/fonts/Lora-Regular.ttf
write_bold=$DIR/fonts/Lora-Bold.ttf
write_reg=$DIR/fonts/Lora-Regular.ttf

# Generate post text
if [ $(echo "$msg" | wc -m) -lt 40 ]; then


Loading…
取消
儲存