btop: append `--utf-force` argument by default
authorTianling Shen <cnsztl@immortalwrt.org>
Mon, 14 Nov 2022 07:58:32 +0000 (15:58 +0800)
committerTianling Shen <cnsztl@gmail.com>
Tue, 15 Nov 2022 06:33:04 +0000 (14:33 +0800)
btop reads the `LANG` env variable to delect if the system has utf8
support, which exists on common Linux distributions.

However, OpenWrt does not ship it, and results in btop reporting
"No UTF-8 locale detected!". Users have to manually pass `--utf-force`
to make btop happy.

To make it OOTB, append `--utf-force` argument by default via alias.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
admin/btop/Makefile
admin/btop/files/btop.sh [new file with mode: 0644]

index 557393d78a2ba870145d3c57fc8c02c13522dad2..d1a98689354e7dfcf229a8606b53835f2201d31d 100644 (file)
@@ -42,6 +42,9 @@ define Package/btop/install
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/local/bin/btop $(1)/usr/bin/
        $(INSTALL_DIR) $(1)/usr/share
        $(CP) $(PKG_INSTALL_DIR)/usr/local/share/btop $(1)/usr/share/
+
+       $(INSTALL_DIR) $(1)/etc/profile.d
+       $(CP) $(CURDIR)/files/btop.sh $(1)/etc/profile.d/
 endef
 
 $(eval $(call BuildPackage,btop))
diff --git a/admin/btop/files/btop.sh b/admin/btop/files/btop.sh
new file mode 100644 (file)
index 0000000..d7aa447
--- /dev/null
@@ -0,0 +1 @@
+alias btop="btop --utf-force"