Skip to content

Commit

Permalink
1. Updating readme to recommend rxvt-256color over xterm-256color.
Browse files Browse the repository at this point in the history
2. Fixing issue where gradient=true was not being read correctly.
  • Loading branch information
dpayne committed Sep 21, 2017
1 parent 4dce69e commit 149c823
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 7 deletions.
24 changes: 19 additions & 5 deletions Makefile
Expand Up @@ -46,7 +46,8 @@ CXX_FLAGS += -D__extern_always_inline=inline
TEST_CCACHE_CLANG=ccache clang++
TEST_CLANG=clang++

ALL_WARNINGS=-Werror
ALL_WARNINGS=-Werror -Weverything -Wno-zero-as-null-pointer-constant -Wno-variadic-macros -Wno-format-nonliteral -Wno-global-constructors -Wno-exit-time-destructors -Wno-padded -Wno-reserved-id-macro -Wno-gnu-zero-variadic-macro-arguments -Wno-c++98-compat -Wno-documentation-unknown-command
ifdef VIS_COMPILE_WITH_WARNINGS
# Only turn on extra warnings for clang since g++ does not support -Weverything
ifeq ($(CXX),$(TEST_CLANG))
CXX_FLAGS += $(ALL_WARNINGS)
Expand All @@ -55,6 +56,7 @@ ifeq ($(CXX),$(TEST_CCACHE_CLANG))
CXX_FLAGS += $(ALL_WARNINGS)
endif
endif
endif

#perf tests should not have many warnings or error out on warning
PERF_TEST_CXX_FLAGS = -std=c++14
Expand Down Expand Up @@ -110,12 +112,18 @@ LD_FLAGS += -fsanitize=$(SANITIZE)
endif

# Include Paths
INCLUDE_PATH = -I/usr/local/include -I$(DIR)/include -I$(DIR)/src
TEST_INCLUDE_PATH = -I/usr/include
PERF_TEST_INCLUDE_PATH = -I/usr/include

# Lib Paths
LIB_PATH = -L/usr/local/lib
ifdef VIS_NCURSES_LIB_PATH
LIB_PATH = -L${VIS_NCURSES_LIB_PATH} -L/usr/local/lib
INCLUDE_PATH = -I${VIS_NCURSES_INCLUDE_PATH} -I$(DIR)/include -I$(DIR)/src
else
INCLUDE_PATH = -I/usr/local/include -I$(DIR)/include -I$(DIR)/src
LIB_PATH = -L/usr/local/lib
endif

TEST_INCLUDE_PATH = ${INCLUDE_PATH}
PERF_TEST_INCLUDE_PATH = ${INCLUDE_PATH}

# Libs
LIBS = -lfftw3 -lm -lstdc++
Expand All @@ -128,6 +136,11 @@ LD_FLAGS += -D_ENABLE_PULSE
LIBS += -lpulse -lpulse-simple
endif

ifdef VIS_NCURSES_LIB_PATH
LIBS += -lncursesw -ldl
CXX_FLAGS += -DNCURSESW
LD_FLAGS += -DNCURSESW
else
#if this box has an older version of ncurses
ifneq ("$(wildcard /usr/include/ncursesw/ncurses.h)","")
LIBS += -lncursesw
Expand All @@ -142,6 +155,7 @@ else
LIBS += -lncurses
endif
endif
endif

#use jemalloc if available
ifneq ("$(wildcard /usr/lib/libjemalloc.so)","")
Expand Down
11 changes: 9 additions & 2 deletions README.md
Expand Up @@ -72,9 +72,11 @@ A C++ compiler that supports C++14 is also needed. On arch linux, the latest g++

In order to show the colors, you need a terminal with 256 color support.`rxvt-unicode` out of the box.

For xterm, the default `$TERM` setting needs to be changed to `xterm-256color`. To change this run
For xterm, the default `$TERM` setting needs to be changed to `rxvt-256color`. To change this run

export TERM=xterm-256color
export TERM=rxvt-256color

Setting TERM to `xterm-256color` may also work but seems to cause issues with rendering of the visualizers in some terminals.

### Ubuntu

Expand Down Expand Up @@ -605,6 +607,11 @@ Turn off overriding terminal colors.

Due to the way terminal color schemes work, there is no portable way for ncurses to get the original color scheme. By default it overrides the user's terminal colors with the visualizer colors. It does this to get a smoother transition between gradients, however this overrides the user's terminal color scheme.

#### Tearing our corrupt output

This is usually and issue with ncurses versions past versions 6.0+20170729. Try changing the TERM variable to rxvt with

export TERM=rxvt-256color

### Mac OSX

Expand Down
2 changes: 2 additions & 0 deletions TODO
@@ -1,5 +1,7 @@
- use configure or something similar to check for libraries and which compiler to use and flags

- use 1000 color range for ColorDefinition, this is usueful for smoother gradients

- add more visualizers
- add beat detection
- add flashing squares
Expand Down
1 change: 1 addition & 0 deletions src/Domain/VisConstants.h
Expand Up @@ -22,6 +22,7 @@ namespace VisConstants
static const int16_t k_max_extended_color = 2 << 13; // 16384
static const int16_t k_default_max_color = 256;
static const std::string k_disabled_gradient_color_config{"gradient=false"};
static const std::string k_enabled_gradient_color_config{"gradient=true"};

// Various constants
static const std::string k_default_locale{"en_US.UTF8"};
Expand Down
5 changes: 5 additions & 0 deletions src/Utils/ConfigurationUtils.cpp
Expand Up @@ -328,6 +328,11 @@ vis::ConfigurationUtils::read_colors(bool is_override_terminal_colors,
{
is_gradient_enabled = false;
}
else if (lines.empty() &&
line == VisConstants::k_enabled_gradient_color_config)
{
is_gradient_enabled = true;
}
else
{
lines.push_back(line);
Expand Down

0 comments on commit 149c823

Please sign in to comment.