mirror of
https://github.com/thewtex/tmux-mem-cpu-load.git
synced 2026-09-10 07:16:16 -04:00
Compare commits
No commits in common. "master" and "v3.5.0" have entirely different histories.
2
.github/workflows/expired.yml
vendored
2
.github/workflows/expired.yml
vendored
|
|
@ -6,7 +6,7 @@ jobs:
|
|||
stale:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/stale@v11
|
||||
- uses: actions/stale@v4
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
exempt-issue-milestones: 'future,alpha,beta,release'
|
||||
|
|
|
|||
5
.github/workflows/main.yml
vendored
5
.github/workflows/main.yml
vendored
|
|
@ -21,12 +21,11 @@ jobs:
|
|||
matrix:
|
||||
# Disable: unsupported system: android-arm, android-arm64, android-x86, android-x86_64, web-wasm,
|
||||
# Disable: missing header in linux(GCC): windows-static-x64, windows-static-x64-posix, windows-static-x86, windows-shared-x64, windows-shared-x64-posix, windows-shared-x86,
|
||||
# Disable: string-related vtable linker error: manylinux2014-aarch64
|
||||
arch_name: [linux-arm64, linux-arm64-musl, linux-armv5, linux-armv5-musl, linux-armv6, linux-armv6-musl, linux-armv7, linux-armv7a, linux-armv7l-musl, linux-x64-clang, linux-s390x, linux-x64, linux-x86, linux-mips, linux-ppc64le, manylinux1-x64, manylinux1-x86, manylinux2010-x64, manylinux2010-x86, manylinux2014-x64, manylinux2014-x86, linux-riscv64, linux-riscv32]
|
||||
arch_name: [linux-arm64, linux-arm64-musl, linux-armv5, linux-armv5-musl, linux-armv6, linux-armv6-musl, linux-armv7, linux-armv7a, linux-armv7l-musl, linux-x64-clang, linux-s390x, linux-x64, linux-x86, linux-mips, linux-ppc64le, manylinux1-x64, manylinux1-x86, manylinux2010-x64, manylinux2010-x86, manylinux2014-x64, manylinux2014-x86, manylinux2014-aarch64, linux-riscv64, linux-riscv32]
|
||||
build_type: [Release, Debug]
|
||||
steps:
|
||||
- name: "📥 Checkout Code"
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: 'recursive'
|
||||
fetch-depth: 0
|
||||
|
|
|
|||
17
.github/workflows/release.yml
vendored
17
.github/workflows/release.yml
vendored
|
|
@ -18,7 +18,7 @@ jobs:
|
|||
arch_name: [linux-arm64, linux-arm64-musl, linux-armv5, linux-armv5-musl, linux-armv6, linux-armv6-musl, linux-armv7, linux-armv7a, linux-armv7l-musl, linux-x64-clang, linux-s390x, linux-x64, linux-x86, linux-mips, linux-ppc64le, manylinux1-x64, manylinux1-x86, manylinux2010-x64, manylinux2010-x86, manylinux2014-x64, manylinux2014-x86, manylinux2014-aarch64, linux-riscv64, linux-riscv32]
|
||||
steps:
|
||||
- name: "📥 Checkout Code"
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: 'recursive'
|
||||
fetch-depth: 0
|
||||
|
|
@ -29,26 +29,25 @@ jobs:
|
|||
- name: "🗜️ compress"
|
||||
run: cd build-${{ matrix.arch_name }} && find . -maxdepth 1 -name "tmux-mem-cpu-load*" -o -name "*.sha256" | XZ_OPT=-e9 tar -cJf tmux-mem-cpu-load-${{ matrix.arch_name }}.tar.xz -T - && mv tmux-mem-cpu-load-${{ matrix.arch_name }}.tar.xz ..
|
||||
- name: "💾 save binaries"
|
||||
uses: actions/upload-artifact@v7
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: bin-artifact-${{ matrix.arch_name }}
|
||||
name: bin-artifact
|
||||
path: tmux-mem-cpu-load-${{ matrix.arch_name }}.tar.xz
|
||||
retention-days: 1
|
||||
retention-days: 1
|
||||
release:
|
||||
name: release
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
steps:
|
||||
- name: "📥 Checkout Code"
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: 'recursive'
|
||||
fetch-depth: 0
|
||||
- name: get artifact
|
||||
uses: actions/download-artifact@v8
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
pattern: bin-artifact-*
|
||||
merge-multiple: true
|
||||
name: bin-artifact
|
||||
path: .
|
||||
- name: "✅ checksum"
|
||||
run: find . -maxdepth 1 -name "*.tar.xz" | xargs sha256sum > checksum_all.sha256
|
||||
|
|
@ -60,4 +59,4 @@ jobs:
|
|||
files: |
|
||||
LICENSE
|
||||
*.tar.xz
|
||||
*.sha256
|
||||
*.sha256
|
||||
|
|
@ -21,15 +21,25 @@ cmake_minimum_required(VERSION 3.5)
|
|||
### General Package stuff
|
||||
project(tmux-mem-cpu-load)
|
||||
set(tmux-mem-cpu-load_VERSION_MAJOR 3)
|
||||
set(tmux-mem-cpu-load_VERSION_MINOR 8)
|
||||
set(tmux-mem-cpu-load_VERSION_PATCH 3)
|
||||
set(tmux-mem-cpu-load_VERSION_MINOR 4)
|
||||
set(tmux-mem-cpu-load_VERSION_PATCH 0)
|
||||
#Compute full version string
|
||||
set(tmux-mem-cpu-load_VERSION
|
||||
${tmux-mem-cpu-load_VERSION_MAJOR}.${tmux-mem-cpu-load_VERSION_MINOR}.${tmux-mem-cpu-load_VERSION_PATCH})
|
||||
|
||||
# Check whether we have support for c++11 in compiler and fail if we don't
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
include(CheckCXXCompilerFlag)
|
||||
check_cxx_compiler_flag("-std=c++11" COMPILER_SUPPORTS_CXX11)
|
||||
check_cxx_compiler_flag("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
|
||||
|
||||
if(COMPILER_SUPPORTS_CXX11)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||
elseif(COMPILER_SUPPORTS_CXX0X)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
|
||||
else()
|
||||
message(FATAL_ERROR
|
||||
"Compiler ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION} has no C++11 support.")
|
||||
endif()
|
||||
|
||||
# generate header file to handle version
|
||||
configure_file(
|
||||
|
|
@ -121,7 +131,7 @@ if(BUILD_TESTING)
|
|||
)
|
||||
|
||||
add_test(NAME invalid_graph_lines
|
||||
COMMAND tmux-mem-cpu-load --graph-lines -2
|
||||
COMMAND tmux-mem-cpu-load --graph_lines -2
|
||||
)
|
||||
|
||||
add_test(NAME old_option_specification
|
||||
|
|
|
|||
46
README.rst
46
README.rst
|
|
@ -5,6 +5,9 @@
|
|||
CPU, RAM, and load monitor for use with tmux_
|
||||
---------------------------------------------
|
||||
|
||||
.. image:: https://travis-ci.org/thewtex/tmux-mem-cpu-load.svg
|
||||
:target: https://travis-ci.org/thewtex/tmux-mem-cpu-load
|
||||
|
||||
.. image:: https://circleci.com/gh/thewtex/tmux-mem-cpu-load.svg?style=svg
|
||||
:target: https://circleci.com/gh/thewtex/tmux-mem-cpu-load
|
||||
|
||||
|
|
@ -55,7 +58,7 @@ Currently, Linux, Mac OSX, FreeBSD, OpenBSD, and NetBSD are supported.
|
|||
Building
|
||||
~~~~~~~~
|
||||
|
||||
* >= CMake_ -3.5
|
||||
* >= CMake_ -2.6
|
||||
* C++ compiler with C++11 support (e.g. gcc/g++ >= 4.6)
|
||||
|
||||
Download
|
||||
|
|
@ -96,7 +99,6 @@ Install with Package Managers
|
|||
|
||||
* Gentoo: ``emerge tmux-mem-cpu-load``
|
||||
* Homebrew: ``brew install tmux-mem-cpu-load``
|
||||
* FreeBSD: ``pkg install tmux-mem-cpu-load``
|
||||
|
||||
Build and Install Using Antigen_
|
||||
--------------------------------
|
||||
|
|
@ -144,16 +146,6 @@ The full usage::
|
|||
Use powerline left symbols throughout the output, enables --colors
|
||||
-q, --powerline-right
|
||||
Use powerline right symbols throughout the output, enables --colors
|
||||
-v, --vertical-graph
|
||||
Use vertical bar chart for CPU graph
|
||||
-l <value>, --segments-left <value>
|
||||
Enable blending bg/fg color (depending on -p or -q use) with segment to left
|
||||
Provide color to be used depending on -p or -q option for seamless segment blending
|
||||
Color is an integer value which uses the standard tmux color palette values
|
||||
-r <value>, --segments-right <value>
|
||||
Enable blending bg/fg color (depending on -p or -q use) with segment to right
|
||||
Provide color to be used depending on -p or -q option for seamless segment blending
|
||||
Color is an integer value which uses the standard tmux color palette values
|
||||
-i <value>, --interval <value>
|
||||
Set tmux status refresh interval in seconds. Default: 1 second
|
||||
-g <value>, --graph-lines <value>
|
||||
|
|
@ -165,37 +157,7 @@ The full usage::
|
|||
-a <value>, --averages-count <value>
|
||||
Set how many load-averages should be drawn. Default: 3
|
||||
|
||||
Blending Dynamic Colors Tmux Powerline Segments
|
||||
===============================================
|
||||
|
||||
The -l and -r options when used in conjunction with a recent version of Tmux Powerline
|
||||
that has the ability to selectively disable spacing and separators between segments allow
|
||||
for seamless blending of tmux-mem-cpu-load output with other adjacent segments. The end
|
||||
result is dynamic changing of appropriate foreground and background colors as the start
|
||||
and end of the tmux-mem-cpu-load output string that is aggregated with other Tmux
|
||||
Powerline output to produce a more polished status line in Tmux.
|
||||
|
||||
Segment Adjaceny before this feature:
|
||||
|
||||
.. image:: seg-adj1.png
|
||||
|
||||
Segment Adjaceny after this feature:
|
||||
|
||||
.. image:: seg-adj2.png
|
||||
|
||||
Note that the values for the -l and -r options will be the standard Tmux integer color
|
||||
values. They set the appropriate background and foreground colors used for the separator
|
||||
character when used with the poweline-left or powerline-right options so it is easy to
|
||||
match coloring to adjacent segments. An example from the segment script that calls
|
||||
tmux-mem-cpu-load is as follows::
|
||||
|
||||
tmux-mem-cpu-load -q -v -l 52 -r 33
|
||||
|
||||
This combines with theme options available to tmux-powerline, such as the following::
|
||||
|
||||
"disk_usage_cust 52 123 ${TMUX_POWERLINE_SEPARATOR_LEFT_BOLD} 52 123 right_disable" \
|
||||
"tmux_mem_cpu_load_cust 52 234 ${TMUX_POWERLINE_SEPARATOR_LEFT_BOLD} 52 234 both_disable separator_disable" \
|
||||
"batt_cust 33 154 ${TMUX_POWERLINE_SEPARATOR_LEFT_BOLD} 16 33 N separator_disable" \
|
||||
|
||||
Authors
|
||||
=======
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@
|
|||
#ifndef CPU_H_
|
||||
#define CPU_H_
|
||||
|
||||
#include <cstdint>
|
||||
#include <sys/types.h>
|
||||
|
||||
#if defined(__APPLE__) && defined(__MACH__)
|
||||
|
|
@ -28,15 +27,12 @@
|
|||
#define CP_IDLE 2
|
||||
#define CP_NICE 3
|
||||
#define CP_STATES 4
|
||||
#elif defined(__OpenBSD__)
|
||||
#include <sys/sched.h>
|
||||
#define CP_STATES CPUSTATES
|
||||
#else
|
||||
#define CP_USER 0
|
||||
#define CP_NICE 1
|
||||
#define CP_SYS 2
|
||||
|
||||
#if defined(__FreeBSD__) || defined(__NetBSD__)
|
||||
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
|
||||
// *BSD or OSX
|
||||
#define CP_INTR 3
|
||||
#define CP_IDLE 4
|
||||
|
|
|
|||
|
|
@ -18,11 +18,10 @@
|
|||
|
||||
#include <string>
|
||||
#include <cstring>
|
||||
#include <map>
|
||||
|
||||
#include "graph.h"
|
||||
|
||||
std::string get_graph_by_percentage( unsigned value, unsigned len )
|
||||
std::string get_graph_by_percentage( unsigned value, unsigned len )
|
||||
{
|
||||
unsigned step = 0;
|
||||
std::string bars;
|
||||
|
|
@ -61,20 +60,3 @@ std::string get_graph_by_value( unsigned value, unsigned max, unsigned len )
|
|||
return bars;
|
||||
}
|
||||
|
||||
std::string get_graph_vert( unsigned value )
|
||||
{
|
||||
static const std::map<unsigned, std::string> graph_chars = {
|
||||
{ 0, " " }, { 10, "▁" }, { 20, "▂" }, { 30, "▃" }, { 40, "▄" },
|
||||
{ 50, "▅" }, { 60, "▆" }, { 70, "▇" }, { 80, "█" }, { 90, "▲" }
|
||||
};
|
||||
|
||||
for( auto it = graph_chars.rbegin(); it != graph_chars.rend(); ++it )
|
||||
{
|
||||
if( value >= it->first )
|
||||
{
|
||||
return it->second;
|
||||
}
|
||||
}
|
||||
|
||||
return " "; // default return in case value doesn't match map options
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,6 +23,5 @@
|
|||
|
||||
std::string get_graph_by_percentage( unsigned, unsigned len = 10 );
|
||||
std::string get_graph_by_value( unsigned, unsigned, unsigned len = 10 );
|
||||
std::string get_graph_vert( unsigned );
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@
|
|||
#include <stdlib.h> // getloadavg()
|
||||
#include <cmath> // floorf()
|
||||
#include <sys/types.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "cpu.h"
|
||||
#include "load.h"
|
||||
|
|
@ -36,12 +35,14 @@
|
|||
|
||||
// Load Averages
|
||||
std::string load_string( bool use_colors,
|
||||
bool use_powerline_left, bool use_powerline_right, short num_averages,
|
||||
bool segments_to_right, short right_color )
|
||||
bool use_powerline_left, bool use_powerline_right,
|
||||
short num_averages )
|
||||
{
|
||||
std::ostringstream ss;
|
||||
ss.setf( std::ios::fixed, std::ios::floatfield );
|
||||
ss.precision( 2 );
|
||||
double averages[num_averages];
|
||||
// based on: opensource.apple.com/source/Libc/Libc-262/gen/getloadavg.c
|
||||
|
||||
if( num_averages <= 0 || num_averages > 3)
|
||||
{
|
||||
|
|
@ -49,9 +50,6 @@ std::string load_string( bool use_colors,
|
|||
return ss.str();
|
||||
}
|
||||
|
||||
double averages[3];
|
||||
// based on: opensource.apple.com/source/Libc/Libc-262/gen/getloadavg.c
|
||||
|
||||
if( getloadavg( averages, num_averages ) < 0 )
|
||||
{
|
||||
ss << " 0.00 0.00 0.00"; // couldn't get averages.
|
||||
|
|
@ -99,12 +97,7 @@ std::string load_string( bool use_colors,
|
|||
|
||||
if( use_colors )
|
||||
{
|
||||
if( use_powerline_left && segments_to_right )
|
||||
{
|
||||
powerline( ss, load_lut[load_percent], POWERLINE_LEFT, true );
|
||||
powerline_char( ss, load_lut[load_percent], right_color, POWERLINE_LEFT, true );
|
||||
}
|
||||
else if( use_powerline_left && !segments_to_right )
|
||||
if( use_powerline_left )
|
||||
{
|
||||
powerline( ss, load_lut[load_percent], POWERLINE_LEFT, true );
|
||||
powerline( ss, "#[fg=default,bg=default]", POWERLINE_LEFT );
|
||||
|
|
@ -113,10 +106,6 @@ std::string load_string( bool use_colors,
|
|||
{
|
||||
ss << "#[fg=default,bg=default]";
|
||||
}
|
||||
else if ( segments_to_right && use_powerline_right )
|
||||
{
|
||||
powerline_char( ss, load_lut[load_percent], right_color, POWERLINE_RIGHT, true );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@
|
|||
|
||||
std::string load_string( bool use_colors = false,
|
||||
bool use_powerline_left = false, bool use_powerline_right = false,
|
||||
short num_averages = 3, bool segments_to_right = false,
|
||||
short right_color = 0 );
|
||||
short num_averages = 3 );
|
||||
|
||||
#endif
|
||||
|
|
|
|||
138
common/luts.h
138
common/luts.h
|
|
@ -5,74 +5,8 @@ static const char cpu_percentage_lut[][32] = {
|
|||
"#[fg=brightwhite,bg=colour16]",
|
||||
"#[fg=brightwhite,bg=colour16]",
|
||||
"#[fg=brightwhite,bg=colour16]",
|
||||
"#[fg=brightwhite,bg=colour16]",
|
||||
"#[fg=brightwhite,bg=colour16]",
|
||||
"#[fg=brightwhite,bg=colour16]",
|
||||
"#[fg=brightwhite,bg=colour16]",
|
||||
"#[fg=brightwhite,bg=colour17]",
|
||||
"#[fg=brightwhite,bg=colour17]",
|
||||
"#[fg=brightwhite,bg=colour17]",
|
||||
"#[fg=brightwhite,bg=colour17]",
|
||||
"#[fg=brightwhite,bg=colour17]",
|
||||
"#[fg=brightwhite,bg=colour17]",
|
||||
"#[fg=brightwhite,bg=colour17]",
|
||||
"#[fg=brightwhite,bg=colour17]",
|
||||
"#[fg=brightwhite,bg=colour18]",
|
||||
"#[fg=brightwhite,bg=colour18]",
|
||||
"#[fg=brightwhite,bg=colour18]",
|
||||
"#[fg=brightwhite,bg=colour18]",
|
||||
"#[fg=brightwhite,bg=colour18]",
|
||||
"#[fg=brightwhite,bg=colour18]",
|
||||
"#[fg=brightwhite,bg=colour18]",
|
||||
"#[fg=brightwhite,bg=colour19]",
|
||||
"#[fg=brightwhite,bg=colour19]",
|
||||
"#[fg=brightwhite,bg=colour19]",
|
||||
"#[fg=brightwhite,bg=colour19]",
|
||||
"#[fg=brightwhite,bg=colour19]",
|
||||
"#[fg=brightwhite,bg=colour19]",
|
||||
"#[fg=brightwhite,bg=colour20]",
|
||||
"#[fg=brightwhite,bg=colour20]",
|
||||
"#[fg=brightwhite,bg=colour20]",
|
||||
"#[fg=brightwhite,bg=colour20]",
|
||||
"#[fg=brightwhite,bg=colour20]",
|
||||
"#[fg=brightwhite,bg=colour20]",
|
||||
"#[fg=brightwhite,bg=colour20]",
|
||||
"#[fg=brightwhite,bg=colour21]",
|
||||
"#[fg=brightwhite,bg=colour21]",
|
||||
"#[fg=brightwhite,bg=colour21]",
|
||||
"#[fg=brightwhite,bg=colour21]",
|
||||
"#[fg=brightwhite,bg=colour21]",
|
||||
"#[fg=brightwhite,bg=colour21]",
|
||||
"#[fg=brightwhite,bg=colour57]",
|
||||
"#[fg=brightwhite,bg=colour57]",
|
||||
"#[fg=brightwhite,bg=colour57]",
|
||||
"#[fg=brightwhite,bg=colour57]",
|
||||
"#[fg=brightwhite,bg=colour57]",
|
||||
"#[fg=brightwhite,bg=colour57]",
|
||||
"#[fg=brightwhite,bg=colour56]",
|
||||
"#[fg=brightwhite,bg=colour56]",
|
||||
"#[fg=brightwhite,bg=colour56]",
|
||||
"#[fg=brightwhite,bg=colour56]",
|
||||
"#[fg=brightwhite,bg=colour56]",
|
||||
"#[fg=brightwhite,bg=colour56]",
|
||||
"#[fg=brightwhite,bg=colour55]",
|
||||
"#[fg=brightwhite,bg=colour55]",
|
||||
"#[fg=brightwhite,bg=colour55]",
|
||||
"#[fg=brightwhite,bg=colour55]",
|
||||
"#[fg=brightwhite,bg=colour55]",
|
||||
"#[fg=brightwhite,bg=colour55]",
|
||||
"#[fg=brightwhite,bg=colour54]",
|
||||
"#[fg=brightwhite,bg=colour54]",
|
||||
"#[fg=brightwhite,bg=colour54]",
|
||||
"#[fg=brightwhite,bg=colour54]",
|
||||
"#[fg=brightwhite,bg=colour54]",
|
||||
"#[fg=brightwhite,bg=colour54]",
|
||||
"#[fg=brightwhite,bg=colour53]",
|
||||
"#[fg=brightwhite,bg=colour53]",
|
||||
"#[fg=brightwhite,bg=colour53]",
|
||||
"#[fg=brightwhite,bg=colour53]",
|
||||
"#[fg=brightwhite,bg=colour53]",
|
||||
"#[fg=brightwhite,bg=colour53]",
|
||||
"#[fg=brightwhite,bg=colour52]",
|
||||
"#[fg=brightwhite,bg=colour52]",
|
||||
"#[fg=brightwhite,bg=colour52]",
|
||||
"#[fg=brightwhite,bg=colour52]",
|
||||
"#[fg=brightwhite,bg=colour52]",
|
||||
|
|
@ -85,12 +19,16 @@ static const char cpu_percentage_lut[][32] = {
|
|||
"#[fg=brightwhite,bg=colour88]",
|
||||
"#[fg=brightwhite,bg=colour88]",
|
||||
"#[fg=brightwhite,bg=colour88]",
|
||||
"#[fg=brightwhite,bg=colour88]",
|
||||
"#[fg=brightwhite,bg=colour124]",
|
||||
"#[fg=brightwhite,bg=colour124]",
|
||||
"#[fg=brightwhite,bg=colour124]",
|
||||
"#[fg=brightwhite,bg=colour124]",
|
||||
"#[fg=brightwhite,bg=colour124]",
|
||||
"#[fg=brightwhite,bg=colour124]",
|
||||
"#[fg=brightwhite,bg=colour124]",
|
||||
"#[fg=brightwhite,bg=colour160]",
|
||||
"#[fg=brightwhite,bg=colour160]",
|
||||
"#[fg=brightwhite,bg=colour160]",
|
||||
"#[fg=brightwhite,bg=colour160]",
|
||||
"#[fg=brightwhite,bg=colour160]",
|
||||
|
|
@ -102,7 +40,69 @@ static const char cpu_percentage_lut[][32] = {
|
|||
"#[fg=brightwhite,bg=colour196]",
|
||||
"#[fg=brightwhite,bg=colour196]",
|
||||
"#[fg=brightwhite,bg=colour196]",
|
||||
"#[fg=brightwhite,bg=colour196]"
|
||||
"#[fg=brightwhite,bg=colour196]",
|
||||
"#[fg=brightwhite,bg=colour196]",
|
||||
"#[fg=brightwhite,bg=colour196]",
|
||||
"#[fg=brightwhite,bg=colour202]",
|
||||
"#[fg=brightwhite,bg=colour202]",
|
||||
"#[fg=brightwhite,bg=colour202]",
|
||||
"#[fg=brightwhite,bg=colour202]",
|
||||
"#[fg=brightwhite,bg=colour202]",
|
||||
"#[fg=brightwhite,bg=colour202]",
|
||||
"#[fg=brightwhite,bg=colour202]",
|
||||
"#[fg=brightwhite,bg=colour202]",
|
||||
"#[fg=brightwhite,bg=colour208]",
|
||||
"#[fg=black,bg=colour208]",
|
||||
"#[fg=black,bg=colour208]",
|
||||
"#[fg=black,bg=colour208]",
|
||||
"#[fg=black,bg=colour208]",
|
||||
"#[fg=black,bg=colour208]",
|
||||
"#[fg=black,bg=colour208]",
|
||||
"#[fg=black,bg=colour214]",
|
||||
"#[fg=black,bg=colour214]",
|
||||
"#[fg=black,bg=colour214]",
|
||||
"#[fg=black,bg=colour214]",
|
||||
"#[fg=black,bg=colour214]",
|
||||
"#[fg=black,bg=colour214]",
|
||||
"#[fg=black,bg=colour214]",
|
||||
"#[fg=black,bg=colour214]",
|
||||
"#[fg=black,bg=colour220]",
|
||||
"#[fg=black,bg=colour220]",
|
||||
"#[fg=black,bg=colour220]",
|
||||
"#[fg=black,bg=colour220]",
|
||||
"#[fg=black,bg=colour220]",
|
||||
"#[fg=black,bg=colour220]",
|
||||
"#[fg=black,bg=colour220]",
|
||||
"#[fg=black,bg=colour226]",
|
||||
"#[fg=black,bg=colour226]",
|
||||
"#[fg=black,bg=colour226]",
|
||||
"#[fg=black,bg=colour226]",
|
||||
"#[fg=black,bg=colour226]",
|
||||
"#[fg=black,bg=colour226]",
|
||||
"#[fg=black,bg=colour227]",
|
||||
"#[fg=black,bg=colour227]",
|
||||
"#[fg=black,bg=colour227]",
|
||||
"#[fg=black,bg=colour227]",
|
||||
"#[fg=black,bg=colour227]",
|
||||
"#[fg=black,bg=colour227]",
|
||||
"#[fg=black,bg=colour228]",
|
||||
"#[fg=black,bg=colour228]",
|
||||
"#[fg=black,bg=colour228]",
|
||||
"#[fg=black,bg=colour228]",
|
||||
"#[fg=black,bg=colour228]",
|
||||
"#[fg=black,bg=colour229]",
|
||||
"#[fg=black,bg=colour229]",
|
||||
"#[fg=black,bg=colour229]",
|
||||
"#[fg=black,bg=colour229]",
|
||||
"#[fg=black,bg=colour229]",
|
||||
"#[fg=black,bg=colour230]",
|
||||
"#[fg=black,bg=colour230]",
|
||||
"#[fg=black,bg=colour230]",
|
||||
"#[fg=black,bg=colour230]",
|
||||
"#[fg=black,bg=colour230]",
|
||||
"#[fg=black,bg=colour231]",
|
||||
"#[fg=black,bg=colour231]",
|
||||
"#[fg=black,bg=colour231]"
|
||||
}; // end cpu_percentage_lut
|
||||
|
||||
static const char mem_lut[][32] = {
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@
|
|||
|
||||
std::string cpu_string( CPU_MODE cpu_mode, unsigned int cpu_usage_delay, unsigned int graph_lines,
|
||||
bool use_colors = false,
|
||||
bool use_powerline_left = false, bool use_powerline_right = false, bool use_vert_graph = false)
|
||||
bool use_powerline_left = false, bool use_powerline_right = false )
|
||||
{
|
||||
|
||||
float percentage;
|
||||
|
|
@ -80,19 +80,13 @@ std::string cpu_string( CPU_MODE cpu_mode, unsigned int cpu_usage_delay, unsigne
|
|||
}
|
||||
}
|
||||
|
||||
if( use_vert_graph )
|
||||
{
|
||||
oss << "▕";
|
||||
oss << get_graph_vert( unsigned( percentage ) );
|
||||
oss << "▏";
|
||||
}
|
||||
else if( graph_lines > 0)
|
||||
if( graph_lines > 0)
|
||||
{
|
||||
oss << " [";
|
||||
oss << get_graph_by_percentage( unsigned( percentage ), graph_lines );
|
||||
oss << "]";
|
||||
}
|
||||
oss.width( 6 );
|
||||
oss.width( 5 );
|
||||
oss.setf( std::ios::fixed, std::ios::floatfield );
|
||||
oss.precision( 1 );
|
||||
oss.fill( ' ' );
|
||||
|
|
@ -129,16 +123,6 @@ void print_help()
|
|||
<< "\tUse powerline left symbols throughout the output, enables --colors\n"
|
||||
<< "-q, --powerline-right\n"
|
||||
<< "\tUse powerline right symbols throughout the output, enables --colors\n"
|
||||
<< "-v, --vertical-graph\n"
|
||||
<< "\tUse vertical bar chart for CPU graph\n"
|
||||
<< "-l <value>, --segments-left <value>\n"
|
||||
<< "\tEnable blending bg/fg color (depending on -p or -q use) with segment to left\n"
|
||||
<< "\tProvide color to be used depending on -p or -q option for seamless segment blending\n"
|
||||
<< "\tColor is an integer value which uses the standard tmux color palette values\n"
|
||||
<< "-r <value>, --segments-right <value>\n"
|
||||
<< "\tEnable blending bg/fg color (depending on -p or -q use) with segment to right\n"
|
||||
<< "\tProvide color to be used depending on -p or -q option for seamless segment blending\n"
|
||||
<< "\tColor is an integer value which uses the standard tmux color palette values\n"
|
||||
<< "-i <value>, --interval <value>\n"
|
||||
<< "\tSet tmux status refresh interval in seconds. Default: 1 second\n"
|
||||
<< "-g <value>, --graph-lines <value>\n"
|
||||
|
|
@ -157,14 +141,9 @@ int main( int argc, char** argv )
|
|||
unsigned cpu_usage_delay = 990000;
|
||||
short averages_count = 3;
|
||||
short graph_lines = 10; // max 32767 should be enough
|
||||
short left_color = 0;
|
||||
short right_color = 0;
|
||||
bool use_colors = false;
|
||||
bool use_powerline_left = false;
|
||||
bool use_powerline_right = false;
|
||||
bool use_vert_graph = false;
|
||||
bool segments_to_left = false;
|
||||
bool segments_to_right= false;
|
||||
MEMORY_MODE mem_mode = MEMORY_MODE_DEFAULT;
|
||||
CPU_MODE cpu_mode = CPU_MODE_DEFAULT;
|
||||
|
||||
|
|
@ -178,20 +157,17 @@ int main( int argc, char** argv )
|
|||
{ "colors", no_argument, NULL, 'c' },
|
||||
{ "powerline-left", no_argument, NULL, 'p' },
|
||||
{ "powerline-right", no_argument, NULL, 'q' },
|
||||
{ "vertical-graph", no_argument, NULL, 'v' },
|
||||
{ "interval", required_argument, NULL, 'i' },
|
||||
{ "graph-lines", required_argument, NULL, 'g' },
|
||||
{ "mem-mode", required_argument, NULL, 'm' },
|
||||
{ "cpu-mode", required_argument, NULL, 't' },
|
||||
{ "averages-count", required_argument, NULL, 'a' },
|
||||
{ "segments-left", required_argument, NULL, 'l' },
|
||||
{ "segments-right", required_argument, NULL, 'r' },
|
||||
{ 0, 0, 0, 0 } // used to handle unknown long options
|
||||
};
|
||||
|
||||
int c;
|
||||
// while c != -1
|
||||
while( (c = getopt_long( argc, argv, "hi:cpqvl:r:g:m:a:t:", long_options, NULL) ) != -1 )
|
||||
while( (c = getopt_long( argc, argv, "hi:cpqg:m:a:t:", long_options, NULL) ) != -1 )
|
||||
{
|
||||
switch( c )
|
||||
{
|
||||
|
|
@ -210,27 +186,6 @@ int main( int argc, char** argv )
|
|||
use_colors = true;
|
||||
use_powerline_right = true;
|
||||
break;
|
||||
case 'v': // --vertical-graph
|
||||
use_vert_graph = true;
|
||||
break;
|
||||
case 'l': // --segments-left
|
||||
segments_to_left = true;
|
||||
if( atoi( optarg ) < 0 || atoi( optarg ) > 255 )
|
||||
{
|
||||
std::cerr << "Valid color vaues are from 0 to 255.\n";
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
left_color = atoi( optarg ) ;
|
||||
break;
|
||||
case 'r': // --segments-right
|
||||
segments_to_right= true;
|
||||
if( atoi( optarg ) < 0 || atoi( optarg ) > 255 )
|
||||
{
|
||||
std::cerr << "Valid color vaues are from 0 to 255.\n";
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
right_color = atoi( optarg ) ;
|
||||
break;
|
||||
case 'i': // --interval, -i
|
||||
if( atoi( optarg ) < 1 )
|
||||
{
|
||||
|
|
@ -291,9 +246,9 @@ int main( int argc, char** argv )
|
|||
|
||||
MemoryStatus memory_status;
|
||||
mem_status( memory_status );
|
||||
std::cout << mem_string( memory_status, mem_mode, use_colors, use_powerline_left, use_powerline_right, segments_to_left, left_color )
|
||||
<< cpu_string( cpu_mode, cpu_usage_delay, graph_lines, use_colors, use_powerline_left, use_powerline_right, use_vert_graph )
|
||||
<< load_string( use_colors, use_powerline_left, use_powerline_right, averages_count, segments_to_right, right_color );
|
||||
std::cout << mem_string( memory_status, mem_mode, use_colors, use_powerline_left, use_powerline_right )
|
||||
<< cpu_string( cpu_mode, cpu_usage_delay, graph_lines, use_colors, use_powerline_left, use_powerline_right )
|
||||
<< load_string( use_colors, use_powerline_left, use_powerline_right, averages_count );
|
||||
|
||||
std::cout << std::endl;
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@
|
|||
*/
|
||||
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
|
||||
#include "memory.h"
|
||||
#include "luts.h"
|
||||
|
|
@ -28,9 +27,7 @@ std::string mem_string( const MemoryStatus & mem_status,
|
|||
MEMORY_MODE mode,
|
||||
bool use_colors,
|
||||
bool use_powerline_left,
|
||||
bool use_powerline_right,
|
||||
bool segments_to_left,
|
||||
short left_color )
|
||||
bool use_powerline_right )
|
||||
{
|
||||
std::ostringstream oss;
|
||||
// Change the percision for floats, for a pretty output
|
||||
|
|
@ -40,22 +37,12 @@ std::string mem_string( const MemoryStatus & mem_status,
|
|||
unsigned int color = static_cast< unsigned int >((100 * mem_status.used_mem) / mem_status.total_mem);
|
||||
if( use_colors )
|
||||
{
|
||||
if( use_powerline_right && segments_to_left )
|
||||
{
|
||||
powerline_char( oss, mem_lut[color], left_color, POWERLINE_RIGHT, false);
|
||||
oss << ' ';
|
||||
}
|
||||
else if( use_powerline_right && !segments_to_left )
|
||||
if( use_powerline_right )
|
||||
{
|
||||
oss << "#[bg=default]";
|
||||
powerline( oss, mem_lut[color], POWERLINE_RIGHT );
|
||||
oss << ' ';
|
||||
}
|
||||
else if( use_powerline_left && segments_to_left )
|
||||
{
|
||||
powerline_char( oss, mem_lut[color], left_color, POWERLINE_LEFT, false);
|
||||
oss << ' ';
|
||||
}
|
||||
else if( use_powerline_left )
|
||||
{
|
||||
//powerline( oss, mem_lut[color], POWERLINE_LEFT );
|
||||
|
|
@ -97,12 +84,9 @@ std::string mem_string( const MemoryStatus & mem_status,
|
|||
break;
|
||||
}
|
||||
default: // Default mode, just show the used/total memory in MB
|
||||
if(mem_status.used_mem>10000 && mem_status.total_mem>10000)
|
||||
oss<<static_cast<unsigned int>(mem_status.used_mem/1024)<<"/"<<static_cast<unsigned int>(mem_status.total_mem/1024)<<"GB";
|
||||
else if(mem_status.used_mem<10000 && mem_status.total_mem>10000)
|
||||
oss<<static_cast<unsigned int>(mem_status.used_mem)<<"MB/"<<static_cast<unsigned int>(mem_status.total_mem/1024)<<"GB";
|
||||
else
|
||||
oss<<static_cast<unsigned int>(mem_status.used_mem)<<"/"<<static_cast<unsigned int>(mem_status.total_mem)<<"MB";
|
||||
if(mem_status.used_mem>100000 && mem_status.total_mem>100000) oss<<static_cast<unsigned int>(mem_status.used_mem/1024)<<"/"<<static_cast<unsigned int>(mem_status.total_mem/1024)<<"GB";
|
||||
else if(mem_status.used_mem<100000 && mem_status.total_mem>100000) oss<<static_cast<unsigned int>(mem_status.used_mem)<<"MB/"<<static_cast<unsigned int>(mem_status.total_mem/1024)<<"GB";
|
||||
else oss<<static_cast<unsigned int>(mem_status.used_mem)<<"/"<<static_cast<unsigned int>(mem_status.total_mem)<<"MB";
|
||||
}
|
||||
|
||||
if( use_colors )
|
||||
|
|
|
|||
|
|
@ -51,8 +51,6 @@ std::string mem_string( const MemoryStatus & mem_status,
|
|||
MEMORY_MODE mode = MEMORY_MODE_DEFAULT,
|
||||
bool use_colors = false,
|
||||
bool use_powerline_left = false,
|
||||
bool use_powerline_right = false,
|
||||
bool segments_to_left = false,
|
||||
short left_color = 0 );
|
||||
bool use_powerline_right = false );
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -66,37 +66,3 @@ void powerline( std::ostringstream & oss, const char color[],
|
|||
break;
|
||||
};
|
||||
}
|
||||
|
||||
void powerline_char( std::ostringstream & oss, const char dynamic_color[],
|
||||
short static_color, POWERLINE_DIRECTION direction, bool eol )
|
||||
{
|
||||
char write_color[7];
|
||||
sprintf(write_color, "%d", static_color);
|
||||
switch( direction )
|
||||
{
|
||||
case NONE:
|
||||
break;
|
||||
case POWERLINE_LEFT:
|
||||
if ( eol )
|
||||
{
|
||||
oss << bg2fg( dynamic_color ) << "#[bg=colour" << write_color << "]";
|
||||
}
|
||||
else
|
||||
{
|
||||
oss << dynamic_color << "#[fg=colour" << write_color << "]";
|
||||
}
|
||||
oss << PWL_LEFT_FILLED << dynamic_color;
|
||||
break;
|
||||
case POWERLINE_RIGHT:
|
||||
if ( eol )
|
||||
{
|
||||
oss << dynamic_color << "#[fg=colour" << write_color << "] ";
|
||||
}
|
||||
else
|
||||
{
|
||||
oss << bg2fg(dynamic_color) << " #[bg=colour" << write_color << "]";
|
||||
}
|
||||
oss << PWL_RIGHT_FILLED << dynamic_color;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,7 +34,5 @@ enum POWERLINE_DIRECTION
|
|||
* in the next entr. */
|
||||
void powerline( std::ostringstream & oss, const char color[],
|
||||
POWERLINE_DIRECTION direction, bool background_only = false );
|
||||
void powerline_char( std::ostringstream & oss, const char dynamic_color[],
|
||||
short static_color, POWERLINE_DIRECTION direction, bool eol = false );
|
||||
|
||||
#endif // POWERLINE_H
|
||||
|
|
|
|||
|
|
@ -26,12 +26,12 @@
|
|||
#include "getsysctl.h"
|
||||
#include "cpu.h"
|
||||
|
||||
uint32_t get_cpu_count()
|
||||
uint8_t get_cpu_count()
|
||||
{
|
||||
int32_t cpu_count = 0;
|
||||
GETSYSCTL( "hw.ncpu", cpu_count );
|
||||
|
||||
return static_cast<uint32_t>( cpu_count );
|
||||
return static_cast<uint8_t>( cpu_count );
|
||||
}
|
||||
|
||||
float cpu_percentage( unsigned int cpu_usage_delay )
|
||||
|
|
|
|||
|
|
@ -66,21 +66,21 @@ void mem_status( MemoryStatus & status )
|
|||
if( substr.compare( "MemTotal" ) == 0 )
|
||||
{
|
||||
// get total memory
|
||||
total_mem = stol( line.substr( substr_start, substr_len ) );
|
||||
total_mem = stoi( line.substr( substr_start, substr_len ) );
|
||||
}
|
||||
else if( substr.compare( "MemFree" ) == 0 )
|
||||
{
|
||||
used_mem = total_mem - stol( line.substr( substr_start, substr_len ) );
|
||||
used_mem = total_mem - stoi( line.substr( substr_start, substr_len ) );
|
||||
}
|
||||
else if( substr.compare( "Shmem" ) == 0 )
|
||||
{
|
||||
used_mem += stol( line.substr( substr_start, substr_len ) );
|
||||
used_mem += stoi( line.substr( substr_start, substr_len ) );
|
||||
}
|
||||
else if( substr.compare( "Buffers" ) == 0 ||
|
||||
substr.compare( "Cached" ) == 0 ||
|
||||
substr.compare( "SReclaimable" ) == 0 )
|
||||
{
|
||||
used_mem -= stol( line.substr( substr_start, substr_len ) );
|
||||
used_mem -= stoi( line.substr( substr_start, substr_len ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,12 +26,12 @@
|
|||
#include "getsysctl.h"
|
||||
#include "cpu.h"
|
||||
|
||||
uint32_t get_cpu_count()
|
||||
uint8_t get_cpu_count()
|
||||
{
|
||||
int cpu_count = 0;
|
||||
GETSYSCTL( "hw.ncpu", cpu_count );
|
||||
|
||||
return static_cast<uint32_t>( cpu_count );
|
||||
return static_cast<uint8_t>( cpu_count );
|
||||
}
|
||||
|
||||
float cpu_percentage( unsigned int cpu_usage_delay )
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
#include "error.h"
|
||||
#include "cpu.h"
|
||||
|
||||
uint32_t get_cpu_count()
|
||||
uint8_t get_cpu_count()
|
||||
{
|
||||
int cpu_count = 1; // default to 1
|
||||
int mib[2] = { CTL_HW, HW_NCPUONLINE };
|
||||
|
|
@ -35,7 +35,7 @@ uint32_t get_cpu_count()
|
|||
error( "sysctl: error getting cpu count" );
|
||||
}
|
||||
|
||||
return static_cast<uint32_t>( cpu_count );
|
||||
return cpu_count;
|
||||
}
|
||||
|
||||
float cpu_percentage( unsigned int cpu_usage_delay )
|
||||
|
|
@ -55,8 +55,6 @@ float cpu_percentage( unsigned int cpu_usage_delay )
|
|||
|
||||
usleep( cpu_usage_delay );
|
||||
|
||||
size = sizeof( load2 );
|
||||
|
||||
// update cpu times
|
||||
if( sysctl( cpu_ctl, 2, &load2, &size, NULL, 0 ) < 0 )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -28,16 +28,14 @@ void mem_status( MemoryStatus & status )
|
|||
{
|
||||
// These values are in bytes
|
||||
u_int64_t total_mem;
|
||||
// float app_mem = 0.0f;
|
||||
// float cached_file_mem = 0.0f;
|
||||
float available_mem = 0.0f;
|
||||
float used_mem;
|
||||
float percentage_mem;
|
||||
float free_mem;
|
||||
float free_mem_in_gigabytes; // used to check if free mem < 1 GB
|
||||
//u_int64_t unused_mem;
|
||||
|
||||
vm_size_t page_size;
|
||||
vm_statistics64_data_t vm_stats; // Use 64-bit VM statistics
|
||||
vm_statistics_data_t vm_stats;
|
||||
|
||||
// Get total physical memory
|
||||
int mib[] = { CTL_HW, HW_MEMSIZE };
|
||||
|
|
@ -45,21 +43,18 @@ void mem_status( MemoryStatus & status )
|
|||
sysctl( mib, 2, &total_mem, &length, NULL, 0 );
|
||||
|
||||
mach_port_t mach_port = mach_host_self();
|
||||
|
||||
// Use HOST_VM_INFO64_COUNT as the count for vm_statistics64_data_t
|
||||
mach_msg_type_number_t count = HOST_VM_INFO64_COUNT;
|
||||
|
||||
mach_msg_type_number_t count = sizeof( vm_stats ) / sizeof( natural_t );
|
||||
if( KERN_SUCCESS == host_page_size( mach_port, &page_size ) &&
|
||||
KERN_SUCCESS == host_statistics64( mach_port, HOST_VM_INFO64,
|
||||
KERN_SUCCESS == host_statistics( mach_port, HOST_VM_INFO,
|
||||
( host_info_t )&vm_stats, &count )
|
||||
)
|
||||
{
|
||||
//unused_mem = static_cast<u_int64_t>( vm_stats.free_count * page_size );
|
||||
// app_mem = static_cast<float>(( vm_stats.internal_page_count - vm_stats.purgeable_count ) * page_size );
|
||||
// cached_file_mem = static_cast<float>(( vm_stats.purgeable_count + vm_stats.external_page_count ) * page_size );
|
||||
available_mem = static_cast<float>(( vm_stats.free_count + vm_stats.external_page_count - vm_stats.speculative_count ) * page_size );
|
||||
|
||||
used_mem = static_cast<float>(
|
||||
( vm_stats.active_count + vm_stats.wire_count ) * page_size);
|
||||
}
|
||||
|
||||
status.used_mem = convert_unit(static_cast< float >(total_mem - available_mem ), MEGABYTES );
|
||||
status.used_mem = convert_unit(static_cast< float >( used_mem ), MEGABYTES );
|
||||
status.total_mem = convert_unit(static_cast< float >( total_mem ), MEGABYTES );
|
||||
}
|
||||
|
|
|
|||
BIN
seg-adj1.png
BIN
seg-adj1.png
Binary file not shown.
|
Before Width: | Height: | Size: 4.8 KiB |
BIN
seg-adj2.png
BIN
seg-adj2.png
Binary file not shown.
|
Before Width: | Height: | Size: 4.4 KiB |
|
|
@ -18,32 +18,15 @@
|
|||
# The directory where this plugin is located.
|
||||
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
if [ ! -f $CURRENT_DIR/tmux-mem-cpu-load ] && ! $(builtin type -P "tmux-mem-cpu-load" &> /dev/null) ; then
|
||||
tmux run-shell "echo \"tmux-mem-cpu-load not found. Attempting to build.
|
||||
\""
|
||||
pushd $CURRENT_DIR #Pushd to the directory where this plugin is located.
|
||||
|
||||
pushd $CURRENT_DIR #Pushd to the directory where this plugin is located.
|
||||
# Attempt to rebuild the plugin and log any errors in the tmux display window.
|
||||
if output=$(cmake . 2>&1); then tmux run-shell "echo \"'cmake $CURRENT_DIR' failed.
|
||||
$output
|
||||
\""; else exit 1; fi
|
||||
|
||||
# Attempt to rebuild the plugin and log any errors in the tmux display window.
|
||||
if output=$(cmake . 2>&1); then
|
||||
tmux run-shell "echo \"'cmake $CURRENT_DIR' completed successfully.
|
||||
\""
|
||||
else
|
||||
tmux run-shell "echo \"'cmake $CURRENT_DIR' failed. Error logged below.
|
||||
$output
|
||||
\""
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if output=$(cmake --build . 2>&1); then
|
||||
tmux run-shell "echo \"tmux-mem-cpu-load built successfully.
|
||||
\""
|
||||
else
|
||||
tmux run-shell "echo \"tmux-mem-cpu-load failed to build. Error logged below.
|
||||
$output
|
||||
\""
|
||||
exit 1
|
||||
fi
|
||||
popd
|
||||
fi
|
||||
if output=$(make 2>&1); then tmux run-shell "echo \"tmux-mem-cpu-load failed to build.
|
||||
$output
|
||||
\""; else exit 1; fi
|
||||
|
||||
popd
|
||||
|
|
|
|||
Loading…
Reference in a new issue