├── .gitignore ├── .travis.yml ├── CMakeLists.txt ├── COPYING ├── README.md ├── cysboard.pro ├── deps └── bin │ ├── libsciter-gtk-64.so │ └── packfolder.bin ├── includes ├── sciter │ ├── aux-asset.h │ ├── aux-cvt.h │ ├── aux-platform.h │ ├── aux-slice.h │ ├── behaviors │ │ ├── behavior_camera_capture.cpp │ │ ├── behavior_drawing-gdi.cpp │ │ ├── behavior_drawing-opengl.cpp │ │ ├── behavior_drawing.cpp │ │ ├── behavior_tabs.cpp │ │ ├── behavior_video_generator.cpp │ │ └── camera │ │ │ ├── camera-capture.cpp │ │ │ └── camera-capture.h │ ├── sciter-gtk-main.cpp │ ├── sciter-osx-main.mm │ ├── sciter-win-main.cpp │ ├── sciter-x-api.h │ ├── sciter-x-behavior.h │ ├── sciter-x-debug.h │ ├── sciter-x-def.h │ ├── sciter-x-dom.h │ ├── sciter-x-dom.hpp │ ├── sciter-x-graphics.h │ ├── sciter-x-graphics.hpp │ ├── sciter-x-host-callback.h │ ├── sciter-x-lite.hpp │ ├── sciter-x-msg.h │ ├── sciter-x-request.h │ ├── sciter-x-request.hpp │ ├── sciter-x-script.h │ ├── sciter-x-threads.h │ ├── sciter-x-types.h │ ├── sciter-x-value.h │ ├── sciter-x-video-api.h │ ├── sciter-x-window.hpp │ ├── sciter-x.h │ ├── tiscript-streams.hpp │ ├── tiscript.h │ ├── tiscript.hpp │ ├── value.h │ └── value.hpp └── spdlog │ ├── async_logger.h │ ├── common.h │ ├── details │ ├── async_log_helper.h │ ├── async_logger_impl.h │ ├── file_helper.h │ ├── format.cc │ ├── format.h │ ├── line_logger_fwd.h │ ├── line_logger_impl.h │ ├── log_msg.h │ ├── logger_impl.h │ ├── mpmc_bounded_q.h │ ├── null_mutex.h │ ├── os.h │ ├── pattern_formatter_impl.h │ ├── registry.h │ └── spdlog_impl.h │ ├── formatter.h │ ├── logger.h │ ├── sinks │ ├── android_sink.h │ ├── ansicolor_sink.h │ ├── base_sink.h │ ├── dist_sink.h │ ├── file_sinks.h │ ├── msvc_sink.h │ ├── null_sink.h │ ├── ostream_sink.h │ ├── sink.h │ ├── stdout_sinks.h │ └── syslog_sink.h │ ├── spdlog.h │ └── tweakme.h └── sources ├── call_program.h ├── ccpuid.h ├── cpucoreobject.h ├── cpuinfo.h ├── cpuinfo_linux.cpp ├── cpuinfo_win32.cpp ├── cpuobject.h ├── cysboard.h ├── default_theme.cpp ├── diskinfo.h ├── diskinfo_linux.cpp ├── diskobject.h ├── linuxutil.cpp ├── linuxutil.h ├── main.cpp ├── meminfo.h ├── meminfo_linux.cpp ├── memoryobject.h ├── osinfo.h ├── osinfo_linux.cpp ├── osobject.h ├── resources ├── default.htm └── default_exports.js ├── util.h ├── win32util.cpp └── win32util.h /.gitignore: -------------------------------------------------------------------------------- 1 | debug/ 2 | release/ 3 | .idea/ 4 | *.o 5 | *.user 6 | .qmake.stash 7 | build 8 | Cysboard.cbp 9 | CMakeCache.txt 10 | CMakeFiles 11 | CMakeScripts 12 | Makefile 13 | cmake_install.cmake 14 | install_manifest.txt 15 | compile_commands.json 16 | CTestTestfile.cmake 17 | 18 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: cpp 2 | 3 | sudo: required 4 | 5 | dist: trusty 6 | 7 | before_install: 8 | - sudo apt-get -qq update 9 | - sudo apt-get install libgtk-3-dev 10 | 11 | 12 | addons: 13 | apt: 14 | sources: 15 | - ubuntu-toolchain-r-test 16 | packages: 17 | - g++-6 18 | - gcc-6 19 | 20 | compiler: gcc 21 | 22 | script: 23 | - sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-6 90 24 | - mkdir build 25 | - cmake . && make -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.1) 2 | project (Cysboard) 3 | #version 4 | set(Cysboard_VERSION_MAJOR 1) 5 | set(Cysboard_VERSION_MINOR 2) 6 | set(CMAKE_CXX_STANDARD 14) 7 | 8 | #includes path 9 | include_directories("includes") 10 | 11 | set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "build") 12 | 13 | #header files 14 | set (${HEADERS} 15 | sources/ccpuid.h 16 | sources/cpucoreobject.h 17 | sources/cpuinfo.h 18 | sources/cpuobject.h 19 | sources/cysboard.h 20 | sources/diskinfo.h 21 | sources/diskobject.h 22 | sources/iinfoobject.h 23 | sources/linuxutil.h 24 | sources/meminfo.h 25 | sources/memoryobject.h 26 | sources/osinfo.h 27 | sources/osobject.h 28 | sources/util.h 29 | ) 30 | 31 | set(SOURCES 32 | sources/cpuinfo_linux.cpp 33 | sources/default_theme.cpp 34 | sources/diskinfo_linux.cpp 35 | sources/linuxutil.cpp 36 | sources/meminfo_linux.cpp 37 | sources/osinfo_linux.cpp 38 | sources/main.cpp 39 | ) 40 | 41 | # require gtk on linux 42 | find_package(PkgConfig REQUIRED) 43 | pkg_check_modules(GTK3 REQUIRED gtk+-3.0) 44 | include_directories(${GTK3_INCLUDE_DIRS}) 45 | 46 | 47 | add_executable(Cysboard ${SOURCES}) 48 | target_link_libraries(Cysboard pthread dl ${GTK3_LIBRARIES}) 49 | target_compile_options(Cysboard PRIVATE "-O3" ) 50 | 51 | # compile default theme 52 | execute_process(COMMAND echo "Packing resources...") 53 | execute_process(COMMAND deps/bin/packfolder.bin sources/resources sources/default_theme.cpp) 54 | # add static keyword 55 | execute_process(COMMAND sed -i "1i static" sources/default_theme.cpp) 56 | # add sciter library to build directory 57 | execute_process(COMMAND cp deps/bin/libsciter-gtk-64.so build/) -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Cysboard 2 | ========= 3 | A lightweight system monitor similar to conky but with html and css for themes 4 | 5 | 6 | 7 | ## Usage 8 | 1. Create a theme file called main.html in ~/.config/cysboard/ (There must be a file name 'main.html'). 9 | 2. Add your html code with any of the listed ids below in html tags for device info. 10 | 3. Run cysboard. 11 | 12 | If a 'main.html' file does not exist in the config directory cysboard will start with a default theme. 13 | 14 | ## Compiling 15 | You must have cmake >= 3.1 and gcc >= 5.4 in order to compile 16 | 17 | 1. mkdir build 18 | 2. cmake . 19 | 3. make 20 | 21 | 22 | ## Examples 23 |
24 | 25 | 26 | 27 |
28 | 29 | Use ids like the following 30 | 31 | ```html 32 | 33 | 34 | Cysboard 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 |
45 |
46 |
SYSTEM
47 |
48 |

name:

49 |

distro:

50 |

uptime:

51 |
52 |
53 | 54 |
55 |
CPU
56 |

model:

57 |

vendor:

58 |

arch:

59 |

usage: %

60 |
61 | 62 |
63 |
RAM
64 |

free: KB

65 |

used: KB

66 |
67 |
68 |

Program 1 Output:

69 |

Program 2 Output:

70 |
71 | 72 | 73 |
74 | 75 |
76 |
77 | 78 | 79 | ``` 80 | Please see sources/resources/default.html for a working theme. 81 | 82 | ## IDs 83 | A list of currently supported information from sources. Add any of 84 | them as an *id* attribute for a tag in your theme file. 85 | 86 | ID | Info 87 | -------------- | ----------------- 88 | cpu_name | The CPU's name 89 | cpu_usage | The total usage of the CPU in percentages 90 | cpu_arch | The CPU's architecture 91 | cpu_vendor | The CPU vendor eg. Intel, AMD 92 | cpu_num_cores | The number of physical cores 93 | mem_free | The amount of free memory in KB, MB or GB 94 | mem_used | The amount of used memory in KB, MB or GB 95 | mem_swap_total | The amount of swap memory in KB, MB or GB 96 | mem_total | The total amount of physical memory available 97 | os_name | The name of the OS 98 | os_distro_name | The distribution name (*Linux only*) 99 | os_uptime | The total amount of time since last boot 100 | os_num_procs | The number of running processes 101 | exec_# | Execute a program and display its output eg. *exec_0, exec_1* etc. 102 | cpu_usage_# | Get a cpu core's usage percentage eg. *cpu_usage_0, cpu_usage_1* etc. 103 | 104 | Some IDs require attributes and can be used like this 105 | 106 | ```html 107 |

Free RAM:

108 | ``` 109 | 110 | Atrribute | Description | Applicable ID(s) 111 | ----------------| --------------------------------- | --------------------------------------------- 112 | mul | Display value in MB, KB or GB | mem_free, mem_used, mem_swap_total, mem_total 113 | cmd | Path of program to execute | exec_# 114 | 115 | ## Project structure 116 | The source code for the project is located in the source directory. 117 | The header file `cysboard.h` contains the main update function for the program. 118 | Objects for information from or about the cpu, os, memory and others are initialized in this class. 119 | All the other files house classes for gathering information from various sources. For example `cpuinfo_linux.cpp` has functions for gathering cpu info on a system. The header file `util.h` holds functions for common and repetitive tasks. 120 | 121 | ## Known Issues 122 | 1. Program crashes sometimes when editing themes. 123 | 124 | ## Todo 125 | 1. GPU, Disk and Network information. 126 | 2. Add graph and bar controls like conky. 127 | 3. Run commands from theme file. 128 | -------------------------------------------------------------------------------- /cysboard.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | CONFIG += console c++14 3 | CONFIG -= app_bundle 4 | CONFIG -= qt 5 | CONFIG += link_pkgconfig 6 | QMAKE_CXXFLAGS += -Wall 7 | PKGCONFIG += gtk+-3.0 8 | 9 | HEADERS += sources/*.h \ 10 | sources/call_program.h 11 | 12 | SOURCES += \ 13 | sources/main.cpp \ 14 | 15 | unix:SOURCES += sources/cpuinfo_linux.cpp \ 16 | sources/osinfo_linux.cpp \ 17 | sources/diskinfo_linux.cpp \ 18 | sources/meminfo_linux.cpp \ 19 | 20 | win32:SOURCES += sources/*_win32.cpp 21 | 22 | INCLUDEPATH += includes 23 | 24 | unix:CONFIG(debug, debug|release):LIBS += -L/usr/lib -ldl 25 | unix:CONFIG(release, debug|release):LIBS += -L/usr/lib -ldl 26 | unix:CONFIG(debug, debug|release):LIBS += -L/usr/lib -lpthread 27 | unix:CONFIG(release, debug|release):LIBS += -L/usr/lib -lpthread 28 | 29 | 30 | -------------------------------------------------------------------------------- /deps/bin/libsciter-gtk-64.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mik30s/Cysboard/a5bc7707ec9a0a4bd101bf099e6b2b1b2861dc96/deps/bin/libsciter-gtk-64.so -------------------------------------------------------------------------------- /deps/bin/packfolder.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mik30s/Cysboard/a5bc7707ec9a0a4bd101bf099e6b2b1b2861dc96/deps/bin/packfolder.bin -------------------------------------------------------------------------------- /includes/sciter/aux-platform.h: -------------------------------------------------------------------------------- 1 | #ifndef __aux_platform_h__ 2 | #define __aux_platform_h__ 3 | 4 | /* 5 | * Terra Informatica Sciter and HTMLayout Engines 6 | * http://terrainformatica.com/sciter, http://terrainformatica.com/htmlayout 7 | * 8 | * platform primitives. 9 | * 10 | * The code and information provided "as-is" without 11 | * warranty of any kind, either expressed or implied. 12 | * 13 | * (C) 2003-2015, Andrew Fedoniouk (andrew@terrainformatica.com) 14 | */ 15 | 16 | 17 | #if defined(_WIN32_WCE) || defined(UNDER_CE) 18 | #define PLATFORM_WINCE 19 | #define WINDOWS 20 | #elif defined(WIN64) || defined(_WIN64) || defined(_M_X64) 21 | #define PLATFORM_DESKTOP 22 | #define WINDOWS 23 | #define X64BITS 24 | #elif defined(WIN32) || defined(_WIN32) 25 | #define PLATFORM_DESKTOP 26 | #define WINDOWS 27 | #elif defined(__APPLE__) 28 | #define PLATFORM_OSX 29 | #define OSX 30 | #define UTF8_CHARS // const char* is UTF8 sequence 31 | #ifdef __x86_64__ 32 | #define X64BITS 33 | #endif 34 | #define POSIX 35 | #elif defined( __linux__ ) 36 | #define PLATFORM_LINUX 37 | #define LINUX 38 | #ifdef __x86_64__ 39 | #define X64BITS 40 | #endif 41 | #define POSIX 42 | #define UTF8_CHARS // const char* is UTF8 sequence 43 | #else 44 | #error "Unknown platform" 45 | #endif 46 | 47 | #if defined(WINDOWS) 48 | #define stricmp _stricmp 49 | #define wcsicmp _wcsicmp 50 | #elif defined(POSIX) 51 | #define stricmp strcasecmp 52 | #define wcsicmp wcscasecmp 53 | #endif 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /includes/sciter/behaviors/behavior_camera_capture.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "sciter-x-dom.hpp" 3 | #include "sciter-x-behavior.h" 4 | 5 | #if TRUE // change it to FALSE to disable camera functionality 6 | 7 | #include "camera/camera-capture.h" 8 | #include "camera/camera-capture.cpp" 9 | 10 | namespace sciter 11 | { 12 | /* 13 | 14 | BEHAVIOR: camera_stream 15 | provides video frames from camera 16 | COMMENTS: 17 |