# Owner: glow # KeyID: E65A8520F36AEE13CFE4F56BEB8FE331063A4794 # Key: https://glow.li/pgp # Verify: curl "https://glow.li/posts/compiling-stag-on-termux/index.html.asc" | gpg -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 +++ { "date": "2016-01-16", "layout": "post", "oldurls": ["technology/2016/1/16/compiling-stag-on-termux/"], "tags": ["Technology", "Termux", "Android", "CLI", "Compiling", "Tutorial"], "title": "Compile Stag on Termux" } +++ **This post is now obsolete. You can install `stag` from the repository.** [Stag](https://github.com/seenaburns/stag) is a cool little programm that generates a bar graph. ![Sreenshot](media/images/Screenshot-STAG-1){.size-half} ![Screemshot](media/images/Screenshot-STAG-2){.size-half} To compile it on [Termux](https://termux.dev/) you'll need to downloaded the sources from GitHub. ``` git clone https://github.com/seenaburns/stag.git ``` To compile you need to install the `ncurses-dev` package. ``` apt install ncurses-dev ``` Open the stag.c file and change line 90 from `char opt` to `signed char opt`, otherwise it will throw an error during compilation. You'll also need to make a change to the Makefile, so that the right compiler is used. Change line 1 from `CC ?= gcc` to `cc = gcc`. After that you can simply use `make` to compile and install it. ``` make make install ``` # Examples ## CPU usage statisitc ``` while true; do top -bn1 | grep "CPU:" -m 1 | cut -f1 -d"." | cut -f2 -d" " ;sleep 1; done | stag -t "CPU" ``` ## Android battery status ``` while true; do termux-battery-status | jq .percentage;sleep 60; done | stag -t "Battery Stats" ``` -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE5lqFIPNq7hPP5PVr64/jMQY6R5QFAmYUIqYACgkQ64/jMQY6 R5TGpA//ZJeAEAd3NjIEmFzTJw/ZJw77Iok9LptoqRYQttqmjM650ZRX/mEIOKGR p4eK/CfS0+b3bid3wtsA4+S5Nac9Xdgs7kOOYBDqGHfWd+rK/9wKWQAdTj6OMYqW ZTaXCwCltIjLfV5msk1COoYjtNvRhPB8WH3lbe+/YqyeWrdvQjlkdANZmk5mjzhd 8ceRibHEOH64xg/6f1RektuPs90fzIL6E4k6A0gxhdpETVuwc+MOLhOGzfJ6D56n jb4kg5wOjNz5ju0q4uq2Cld4lwOZwhAeWE5vXC1P+m/3XyMmMsQ/4gT0WN8YeeMU kRzZPqPdk0sKM7+Uc6VB7w8o2d791740jWP3N8xty3h5A+DN9dyoAiRZ5avQC0S+ g714SVipjMdEApjYdvAloy7KEqb2SqYzIev1/po59OZ35876cDwRRRZch7JKOmMI eYTjmoq2ncyulIPCAqHhDcOhjMzP5wK/CldY31QEZ+dEUDUJhO8p6iIa9XhyKs9v LEjG+b2gH3hYVgtwZN08B4muiLEvlndL32M7J1cCO5zNFhsWu6aBK2cd79gmlbwD orAzxkW54eTVcDdUx7O9mqxAbXe5MqqgOMBYAzQuJkZmumUr7ES2MjI1YaRW/4Pk GuFMlKBHfPJuS7f+1bnafEpfLko64Km0uIKK7LcSgTFPifkwMj0= =Ay6k -----END PGP SIGNATURE-----