aboutsummaryrefslogtreecommitdiffstats
path: root/wavemon.c
diff options
context:
space:
mode:
authorJonathan McCrohan <jmccrohan@gmail.com>2020-07-29 23:11:46 +0100
committerJonathan McCrohan <jmccrohan@gmail.com>2020-07-29 23:11:46 +0100
commit612e6fdfa43ac716a2431d695de842f7127c12d0 (patch)
tree58532da4c219499547e0ab5554d78ea112eea466 /wavemon.c
parent818f5500fa11d5bf57c5542b20beb94d6f0dda6e (diff)
parent8deb3660926fe8278948b898b9c1b772eed2e61e (diff)
downloadwavemon-612e6fdfa43ac716a2431d695de842f7127c12d0.tar.gz
Update upstream source from tag 'upstream/0.9.1'
Update to upstream version '0.9.1' with Debian dir 559193b433abdd46788bc66e02edda248b928278
Diffstat (limited to '')
-rw-r--r--wavemon.c37
1 files changed, 19 insertions, 18 deletions
diff --git a/wavemon.c b/wavemon.c
index 6369b81..72ad163 100644
--- a/wavemon.c
+++ b/wavemon.c
@@ -18,7 +18,6 @@
* Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "wavemon.h"
-#include <locale.h>
#include <setjmp.h>
/* GLOBALS */
@@ -140,6 +139,7 @@ static void check_geometry(void)
int main(int argc, char *argv[])
{
+ int bg_color = COLOR_BLACK;
enum wavemon_screen cur, next;
sigset_t blockmask, oldmask;
@@ -148,9 +148,6 @@ int main(int argc, char *argv[])
if (!isatty(STDIN_FILENO))
errx(1, "input is not from a terminal");
- /* honour numeric separators if the environment defines them */
- setlocale(LC_NUMERIC, "");
-
/* initialize the ncurses interface */
initscr();
noecho();
@@ -161,28 +158,32 @@ int main(int argc, char *argv[])
check_geometry();
start_color();
- init_pair(CP_STANDARD, COLOR_WHITE, COLOR_BLACK);
- init_pair(CP_SCALEHI, COLOR_RED, COLOR_BLACK);
- init_pair(CP_SCALEMID, COLOR_YELLOW, COLOR_BLACK);
- init_pair(CP_SCALELOW, COLOR_GREEN, COLOR_BLACK);
- init_pair(CP_WTITLE, COLOR_CYAN, COLOR_BLACK);
- init_pair(CP_INACTIVE, COLOR_CYAN, COLOR_BLACK);
+ if (conf.transparent_bg) {
+ bg_color = -1;
+ use_default_colors();
+ }
+ init_pair(CP_STANDARD, COLOR_WHITE, bg_color);
+ init_pair(CP_SCALEHI, COLOR_RED, bg_color);
+ init_pair(CP_SCALEMID, COLOR_YELLOW, bg_color);
+ init_pair(CP_SCALELOW, COLOR_GREEN, bg_color);
+ init_pair(CP_WTITLE, COLOR_CYAN, bg_color);
+ init_pair(CP_INACTIVE, COLOR_CYAN, bg_color);
init_pair(CP_ACTIVE, COLOR_CYAN, COLOR_BLUE);
- init_pair(CP_STATSIG, COLOR_GREEN, COLOR_BLACK);
- init_pair(CP_STATNOISE, COLOR_RED, COLOR_BLACK);
+ init_pair(CP_STATSIG, COLOR_GREEN, bg_color);
+ init_pair(CP_STATNOISE, COLOR_RED, bg_color);
init_pair(CP_STATSNR, COLOR_BLUE, COLOR_BLUE);
- init_pair(CP_STATBKG, COLOR_BLUE, COLOR_BLACK);
+ init_pair(CP_STATBKG, COLOR_BLUE, bg_color);
init_pair(CP_STATSIG_S, COLOR_GREEN, COLOR_BLUE);
init_pair(CP_STATNOISE_S, COLOR_RED, COLOR_BLUE);
- init_pair(CP_PREF_NORMAL, COLOR_WHITE, COLOR_BLACK);
+ init_pair(CP_PREF_NORMAL, COLOR_WHITE, bg_color);
init_pair(CP_PREF_SELECT, COLOR_WHITE, COLOR_BLUE);
- init_pair(CP_PREF_ARROW, COLOR_RED, COLOR_BLACK);
+ init_pair(CP_PREF_ARROW, COLOR_RED, bg_color);
- init_pair(CP_SCAN_CRYPT, COLOR_RED, COLOR_BLACK);
- init_pair(CP_SCAN_UNENC, COLOR_GREEN, COLOR_BLACK);
- init_pair(CP_SCAN_NON_AP, COLOR_YELLOW, COLOR_BLACK);
+ init_pair(CP_SCAN_CRYPT, COLOR_RED, bg_color);
+ init_pair(CP_SCAN_UNENC, COLOR_GREEN, bg_color);
+ init_pair(CP_SCAN_NON_AP, COLOR_YELLOW, bg_color);
/* Override signal handlers installed during ncurses initialisation. */
xsignal(SIGCHLD, SIG_IGN);