From f05783228cf1c5ef66f861e5d0c9d06daafdcdce Mon Sep 17 00:00:00 2001 From: NNB Date: Tue, 18 May 2021 14:20:03 +0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=B8=20Add=20st-app?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 14 +++++++------- bin/bt | 19 ++++++++++++++++++- bin/{real-bt => bt-app} | 21 +++------------------ 3 files changed, 28 insertions(+), 26 deletions(-) rename bin/{real-bt => bt-app} (63%) diff --git a/Makefile b/Makefile index 78f4a89..8ba24f3 100644 --- a/Makefile +++ b/Makefile @@ -1,19 +1,19 @@ PREFIX ?= /usr/local MANDIR ?= $(PREFIX)/share/man -BIN ?= bt - install: @mkdir -p $(PREFIX)/bin @mkdir -p $(MANDIR)/man1 - @cp -p bin/$(BIN) $(PREFIX)/bin/ - @cp -p man/$(BIN).1 $(MANDIR)/man1/ + @cp -p bin/bt $(PREFIX)/bin/ + @cp -p bin/bt-app $(PREFIX)/bin/ + @cp -p man/bt.1 $(MANDIR)/man1/ - @chmod 755 $(PREFIX)/bin/$(BIN) + @chmod 755 $(PREFIX)/bin/bt + @chmod 755 $(PREFIX)/bin/bt-app uninstall: - @rm -rf $(PREFIX)/bin/$(BIN) - @rm -rf $(MANDIR)/man1/$(BIN).1* + @rm -rf $(PREFIX)/bin/bt + @rm -rf $(MANDIR)/man1/bt.1* diff --git a/bin/bt b/bin/bt index 8244bc4..cd959f3 100755 --- a/bin/bt +++ b/bin/bt @@ -27,8 +27,25 @@ # along with this program. If not, see . +# Values +FONT_FAMILY="${BUI_FONT_MONO_FAMILY:-Monospace}" +FONT_SIZE="${BUI_FONT_MONO_SIZE:-10.0}" + +OPACITY="${BUI_OPACITY:-1.0}" + +case "$BUI_FONT_ANTIALIAS" in + 'true'|'') FONT_ANTIALIAS='true' ;; + *) FONT_ANTIALIAS='false' ;; +esac + +case "$BUI_HINT_STYLE" in + 'slight'|'medium'|'full'|'') FONT_HINT='true' ;; + *) FONT_HINT='false' ;; +esac + + # Start -"$(getent passwd "$LOGNAME" | cut -d: -f7)" -c "real-bt \"$@\"" +st -f "$FONT_FAMILY:size=$FONT_SIZE:antialias=$FONT_ANTIALIAS:autohint=$FONT_HINT" -A "$OPACITY" "$@" exit 0 diff --git a/bin/real-bt b/bin/bt-app similarity index 63% rename from bin/real-bt rename to bin/bt-app index 1d03bbb..0d56139 100755 --- a/bin/real-bt +++ b/bin/bt-app @@ -6,11 +6,11 @@ # / /_/ // / # /_____//_/ -# File: real-bt +# File: bt-app # Description: BUI for ST terminal # Author: NNB # └─ https://github.com/NNBnh -# URL: https://github.com/NNBnh/real-bt +# URL: https://github.com/NNBnh/bt-app # License: GPLv3 # This program is free software: you can redistribute it and/or modify @@ -27,23 +27,8 @@ # along with this program. If not, see . -# Values -FONT_FAMILY="${BUI_FONT_MONO_FAMILY:-Monospace}" -FONT_SIZE="${BUI_FONT_MONO_SIZE:-10.0}" - -case "$BUI_FONT_ANTIALIAS" in - 'true'|'') FONT_ANTIALIAS='true' ;; - *) FONT_ANTIALIAS='false' ;; -esac - -case "$BUI_HINT_STYLE" in - 'slight'|'medium'|'full'|'') FONT_HINT='true' ;; - *) FONT_HINT='false' ;; -esac - - # Start -st -f "$FONT_FAMILY:size=$FONT_SIZE:antialias=$FONT_ANTIALIAS:autohint=$FONT_HINT" -A "$BUI_OPACITY" "$@" +"$(getent passwd "$LOGNAME" | cut -d ':' -f '7')" -c "bt" exit 0