1
0
Fork 0
mirror of https://github.com/otakuto/crazydiskinfo.git synced 2025-08-07 06:33:17 +00:00
This commit is contained in:
Paul Wise 2021-11-29 12:11:44 -05:00 committed by GitHub
commit bcb3c86f13
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 19 deletions

View file

@ -2,9 +2,9 @@ cmake_minimum_required(VERSION 2.8.0)
option(RAW_VALUES_DEC "Display Raw Values in Decimal instead of Hex" OFF)
project(CrazyDiskInfo CXX)
add_executable(CrazyDiskInfo main.cpp)
set(CMAKE_CXX_FLAGS "-Wall -std=c++11")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++11")
SET_TARGET_PROPERTIES(CrazyDiskInfo PROPERTIES OUTPUT_NAME crazy)
target_link_libraries(CrazyDiskInfo atasmart)
target_link_libraries(CrazyDiskInfo tinfow)
target_link_libraries(CrazyDiskInfo ncursesw)
INSTALL(TARGETS CrazyDiskInfo RUNTIME DESTINATION /usr/sbin)
include(GNUInstallDirs)
INSTALL(TARGETS CrazyDiskInfo RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR})

View file

@ -1,5 +1,5 @@
# CrazyDiskInfo
![](http://raw.github.com/wiki/otakuto/CrazyDiskInfo/images/0.png)
![](https://raw.github.com/wiki/otakuto/CrazyDiskInfo/images/0.png)
## Introduction
CrazyDiskInfo is an interactive TUI S.M.A.R.T viewer for Unix systems.
@ -14,23 +14,28 @@ CrazyDiskInfo is an interactive TUI S.M.A.R.T viewer for Unix systems.
#### Debian(or derivative) Systems
```
# apt-get install libatasmart-dev libncurses5-dev libncursesw5-dev
# apt install libatasmart-dev libncurses-dev
```
## Build and Run
```
$ mkdir build
$ cmake -B build
$ cd build
$ cmake ..
$ make && make install
$ make && sudo make install
$ sudo crazy
```
### Binary Package
Debian package is available from [OBS(Open Build Service)](https://build.opensuse.org/package/show/home:tsuroot/CrazyDiskInfo)
Direct Links:
[Debian_8.0](http://download.opensuse.org/repositories/home:/tsuroot/Debian_8.0/)
Ubuntu [14.04](http://download.opensuse.org/repositories/home:/tsuroot/xUbuntu_14.04/)/[16.04](http://download.opensuse.org/repositories/home:/tsuroot/xUbuntu_16.04/)/[16.10](http://download.opensuse.org/repositories/home:/tsuroot/xUbuntu_16.10/)
CrazyDiskInfo binary packages are available in several distributions,
[versions are listed on Repology](https://repology.org/project/crazydiskinfo/versions).
<a href="https://repology.org/project/crazydiskinfo/versions">
<img src="https://repology.org/badge/vertical-allrepos/crazydiskinfo.svg" alt="Packaging status" align="right">
</a>
Debian package is available from [OBS(Open Build Service)](https://build.opensuse.org/package/show/home:tsuroot/CrazyDiskInfo)
Direct Links:
[Debian_8.0](https://download.opensuse.org/repositories/home:/tsuroot/Debian_8.0/)
Ubuntu [14.04](https://download.opensuse.org/repositories/home:/tsuroot/xUbuntu_14.04/)/[16.04](https://download.opensuse.org/repositories/home:/tsuroot/xUbuntu_16.04/)/[16.10](https://download.opensuse.org/repositories/home:/tsuroot/xUbuntu_16.10/)
I requested for tSU-RooT.
Thank you very much for your accept with my request.

View file

@ -214,7 +214,7 @@ void drawVersion(WINDOW * window)
auto title = " " + TITLE + "-" + VERSION + " ";
wattrset(window, COLOR_PAIR(TITLE_COLOR));
mvwprintw(window, 0, (width - title.length()) / 2, title.c_str());
mvwprintw(window, 0, (width - title.length()) / 2, "%s", title.c_str());
wattroff(window, COLOR_PAIR(TITLE_COLOR));
wnoutrefresh(window);
@ -232,7 +232,7 @@ void drawDeviceBar(WINDOW * window, std::vector<SMART> const & smartList, int se
if (std::get<0>(smartList[i].temperature))
{
wattrset(window, COLOR_PAIR(HEALTH_INV_COLOR + static_cast<int>(temperatureToHealth(std::get<1>(smartList[i].temperature)))));
mvwprintw(window, 1, x, "%.1f ", smartList[i].temperature);
mvwprintw(window, 1, x, "%.1f ", std::get<1>(smartList[i].temperature));
waddch(window, ACS_DEGREE);
waddstr(window, "C");
wattroff(window, COLOR_PAIR(HEALTH_INV_COLOR + static_cast<int>(temperatureToHealth(std::get<1>(smartList[i].temperature)))));
@ -247,7 +247,7 @@ void drawDeviceBar(WINDOW * window, std::vector<SMART> const & smartList, int se
if (i == select)
{
wattrset(window, COLOR_PAIR(HEALTH_COLOR) | A_BOLD);
mvwprintw(window, 2, x, smartList[i].deviceName.c_str());
mvwprintw(window, 2, x, "%s", smartList[i].deviceName.c_str());
wattroff(window, COLOR_PAIR(HEALTH_COLOR) | A_BOLD);
wattrset(window, COLOR_PAIR(HEALTH_COLOR));
@ -256,7 +256,7 @@ void drawDeviceBar(WINDOW * window, std::vector<SMART> const & smartList, int se
}
else
{
mvwprintw(window, 2, x, smartList[i].deviceName.c_str());
mvwprintw(window, 2, x, "%s", smartList[i].deviceName.c_str());
mvwhline(window, 3, x, ' ', smartList[i].deviceName.length());
}
x += smartList[i].deviceName.length() + 1;
@ -355,7 +355,7 @@ void drawStatus(WINDOW * window, SMART const & smart, Option const & option)
mvwprintw(window, 2, (int)(STATUS_WIDTH * (3.0 / 5)), "Power On Count:");
wattroff(window, COLOR_PAIR(HEALTH_COLOR));
wattrset(window, COLOR_PAIR(HEALTH_COLOR) | A_BOLD);
wprintw(window, " %llu ", std::get<1>(smart.powerOnCount));
wprintw(window, " %" PRIu64 " ", std::get<1>(smart.powerOnCount));
wattroff(window, COLOR_PAIR(HEALTH_COLOR) | A_BOLD);
wattrset(window, COLOR_PAIR(HEALTH_COLOR));
wprintw(window, "count");
@ -372,7 +372,7 @@ void drawStatus(WINDOW * window, SMART const & smart, Option const & option)
mvwprintw(window, 3, (int)(STATUS_WIDTH * (3.0 / 5)), "Power On Hours:");
wattroff(window, COLOR_PAIR(HEALTH_COLOR));
wattrset(window, COLOR_PAIR(HEALTH_COLOR) | A_BOLD);
wprintw(window, " %llu ", std::get<1>(smart.powerOnHour));
wprintw(window, " %" PRIu64 " ", std::get<1>(smart.powerOnHour));
wattroff(window, COLOR_PAIR(HEALTH_COLOR) | A_BOLD);
wattrset(window, COLOR_PAIR(HEALTH_COLOR));
wprintw(window, "hours");
@ -507,7 +507,8 @@ int main()
update();
{
struct sigaction s = {{actionWINCH}};
struct sigaction s = {0};
s.sa_handler = actionWINCH;
sigaction(SIGWINCH, &s, nullptr);
}