Skip to content

Instantly share code, notes, and snippets.

@dardo82
Last active March 1, 2025 04:36
Show Gist options
  • Save dardo82/9a1f8d55959acb3ccc3674a724d10e1a to your computer and use it in GitHub Desktop.
Save dardo82/9a1f8d55959acb3ccc3674a724d10e1a to your computer and use it in GitHub Desktop.
FBterm with BG
#!/usr/bin/env zsh
BG_DIR="/usr/share/backgrounds"
OSID=$(awk -F= "/LIKE/"'{print $2}' /etc/os-release)
BG="$BG_DIR/**/*${(C)OSID}*.png"; BG=$(eval echo "$BG")
FONT_NAME=$( awk -F= "/FONT/"'{print $2}' /etc/vconsole.conf)
FONT_ALIAS=$(fc-list | awk "/$FONT_NAME/"'{print $2}')
FONT_SIZE="${${FONT_NAME#*-}:1:2}"
export FBTERM_BACKGROUND_IMAGE="1"
fbv -ciuker "${1:-$BG}" <<< "q"; echo -en "\e[?25l"
fbterm -n "${3:-$FONT_ALIAS}" -s "${2:-$FONT_SIZE}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment