Commit Graph

40 Commits

Author SHA1 Message Date
Pawel "l0ner" Soltys
89a4b0c048 version defines prefixed with name, full version
now the version variables will be prefixed with 'tmux-mem-cpu-load'. This way we
won't clash with any future dependency that might redefine those variables.
This is exactly how CMake does it in their code, see:

f3e92d2816/Source/CMakeVersion.cmake
6ae98ee18f/Source/cmVersionConfig.h.in
6ae98ee18f/Source/CMakeVersionCompute.cmake

the only difference is that they have functions that return the versions and I
use those variables directly.

6ae98ee18f/Source/cmVersion.cxx

Since the partial version variables are not used anywhere in the code we might
as well remove them from version.h.in. I've deciced to leave them for now, since
we might need them in the future.
2015-01-18 15:04:09 +01:00
Pawel "l0ner" Soltys
51f85ba032 code syntax style, vim modelines, license
* Use std::sting instead of char[] in the graph drawing functions. This is the
  only change to the code. Rest is just styling.
* Corrected whole code to follow Allman/GNU coding style, with 2 spaces for each
  indentation step.
* Added license headers to all code files
* Added vim modelines to all files. They sit on the first line and enable the
  following settings: 2 space indentation, tab expansion to spaces, line at
  80th column, automatic line breaking on "\ !@*+-;:,./?" characters, automatic
  line break if line exceeds 80 colums. This should keep the code nice and tidy.
2015-01-18 14:36:59 +01:00
Pawel "l0ner" Soltys
dba56f1b56 Merge branch 'l0ner' of github.com:l0ner/tmux-mem-cpu-load into l0ner 2015-01-10 18:39:45 +01:00
Pawel "l0ner" Soltys
f59b11971f *BDS port:
- split *BDS files
- add CMake confingure instructions on bsd systems
- add includes to main file
2015-01-10 18:34:37 +01:00
Pawel "l0ner" Soltys
ad096cbac6 Merge branch 'l0ner' of github.com:l0ner/tmux-mem-cpu-load into l0ner 2015-01-10 17:32:45 +01:00
Pawel "l0ner" Soltys
3e743ee1c2 Hide cpu usage graph if graph_lines == 0. 2015-01-10 17:32:08 +01:00
Pawel "l0ner" Soltys
5001bc4fe7 added custom interval test 2015-01-08 20:04:27 +01:00
Pawel "l0ner" Soltys
c6fc061f9d instead of using istringstream to convert form strin to int use stoi() function 2015-01-08 19:53:22 +01:00
Pawel "l0ner" Soltys
d92113644c use version generated by cmake, some vim auto reindent 2015-01-08 19:31:25 +01:00
Pawel "l0ner" Soltys
28040b61da easier to read argv parse using command line argument parser by Michael Hanke 2015-01-07 20:57:25 +01:00
Pawel "l0ner" Soltys
e7ee4279f6 increase sleep time to full sec instead of 1-0.1s 2015-01-07 14:58:47 +01:00
Pawel "l0ner" Soltys
72f1b03078 shorter DEFINES for versioning 2015-01-07 14:31:49 +01:00
Pawel "l0ner" Soltys
8e9033ee1e restore headers 2015-01-07 14:15:08 +01:00
Pawel "l0ner" Soltys
7a9209e243 grime removal: useless includes and code 2015-01-04 18:51:43 +01:00
Pawel "l0ner" Soltys
26e89f95fa wrap lines that exceed 80 columns 2015-01-04 17:33:03 +01:00
Pawel "l0ner" Soltys
223868f554 reindent one line 2015-01-04 17:23:39 +01:00
l0ner
2040736dd6 CPU usage graph generation by getGraphByPercentage function. 2014-04-19 22:36:59 +00:00
l0ner
03040e64f2 rm cpu_percentage function proto from main source
This is useless here, since this proto is provided by
   {linux,osx}/cpu.h
2014-04-19 21:13:36 +00:00
l0ner
643fef3a7c Corrections in CMakeLists.txt 2014-04-14 20:51:46 +02:00
Matt McCormick
4bb0a7676f Add load_line variable for OSX. 2013-06-11 00:12:51 -04:00
Matt McCormick
beea1a7cae Output error on status interval < 1. 2013-06-09 22:24:28 -04:00
Matt McCormick
365502dbf8 Use EXIT_SUCCESS/EXIT_FAILURE. 2013-06-09 21:01:32 -04:00
Matt McCormick
1155ca7c77 Output error on graph_lines < 1. Issue #3. 2013-06-09 20:58:47 -04:00
Matt McCormick
777452a83e Merge remote-tracking branch 'Justastic/master' #1, #2, #5
Add support for Mac OSX from Justastic.  Refactors the code from Justastic so it
works with the Linux code and so it also works for the new colors support.

Still need to test on OSX.

Conflicts:
	tmux-mem-cpu-load.cpp
2013-06-09 20:49:21 -04:00
Justin Crawford
06ebd3e9ab Mac OS X support and BSD function stubs
Reorder the functions, begin OS X specific functions
Load averages and Memory usage now works on OSX (I hope the calculations are correct)
Minor edits
Finish OSX support - Fixes CPU usage
2013-05-20 20:02:13 -07:00
Matt McCormick
b2f26bab3f Add support for colors.
Colors are added for terminals that have 256 color support when the
--colors flag is enabled.  The background colors are varied with different color
maps derived from their matplotlib versions.  The foreground color is a
contrasting black or white.
2013-04-30 06:38:39 -04:00
Matt McCormick
816a26bab5 No using namespace std.
Bad form, as Hook would say.
2013-04-24 22:13:50 -04:00
Justin Crawford
c14c56c7ef Fix the formatting to use tabs instead of spaces, easier to read this way. 2013-04-15 11:35:38 -07:00
Justin Crawford
86bdac97f8 Don't use namespace std. It makes things too confusing. 2013-04-15 11:33:28 -07:00
Matt McCormick
e1754b0d60 Parse a --colors flag. 2013-02-21 00:08:14 -05:00
Matt McCormick
d28fb387ca Improve indentation style consistency. 2013-02-20 23:15:20 -05:00
Matt McCormick
f9f1342280 Add Apache-2.0 license.
Per request of Alex Alexander.
2012-11-25 17:20:31 +00:00
Matt McCormick (thewtex)
b1109a31d9 Make number of bar graph lines optional.
The default is still 10.  If you have a machine with many cores, this can be
used to show how many cores are active.
2010-08-01 10:17:42 -05:00
Matt McCormick (thewtex)
dbd3f8e3c7 Make cpu usage timing interval user option.
Also convert sleep to microseconds so the delay time can always be less than the
tmux status bar update interval.
2010-02-25 08:54:18 -06:00
Matt McCormick (thewtex)
00a85129fa Remove some parameter subscriptions to save space. 2010-02-25 00:03:02 -06:00
Matt McCormick (thewtex)
d83d5e302d Add load average. 2010-02-24 23:49:36 -06:00
Matt McCormick (thewtex)
88938b24c3 Calculate used memory. 2010-02-24 23:37:21 -06:00
Matt McCormick (thewtex)
edc15497e2 Total memory available. 2010-02-24 19:02:55 -06:00
Matt McCormick (thewtex)
83945d1a19 Move cpu usage from screen setup to tmux setup. 2010-02-24 18:49:10 -06:00
Matt McCormick (thewtex)
dc5fe29f1d rename screen-cpu-mem to tmux-mem-cpu-load 2010-02-24 18:04:41 -06:00