use independent getfont.sh script

This commit is contained in:
Akbar Rahman 2021-04-11 18:54:59 +01:00
parent e7692af8b7
commit 43d62a0b4c
2 changed files with 15 additions and 1 deletions

View File

@ -17,7 +17,7 @@ options:
config.h:
sed "s/HOSTNAME/$(shell cat /etc/hostname)/; \
s/FONT/\"$(shell ../getfont.sh freedesktop)\"/" \
s/FONT/\"$(shell ./getfont.sh freedesktop)\"/" \
config.def.h > config.h
.c.o:

14
getfont.sh Executable file
View File

@ -0,0 +1,14 @@
#!/usr/bin/env bash
function is_display_large {
echo yes
}
[[ $(is_display_large) ]] && FONT="Fira Code" || FONT="curie"
[[ $(is_display_large) ]] && SIZE="15" || SIZE="10"
[[ $(is_display_large) ]] || BITMAP="true"
case $1 in
pango) [[ $BITMAP ]] && echo ${FONT} wrapped $SIZE || echo $FONT $SIZE ;;
freedesktop) [[ $BITMAP ]] && echo ${FONT} || echo ${FONT}:pizelsize=${SIZE} ;;
esac