mirror of
https://github.com/otakuto/crazydiskinfo.git
synced 2025-08-12 16:56:00 +00:00
Merge 8563aa8636
into 803a58571b
This commit is contained in:
commit
bcb3c86f13
3 changed files with 25 additions and 19 deletions
|
@ -2,9 +2,9 @@ cmake_minimum_required(VERSION 2.8.0)
|
||||||
option(RAW_VALUES_DEC "Display Raw Values in Decimal instead of Hex" OFF)
|
option(RAW_VALUES_DEC "Display Raw Values in Decimal instead of Hex" OFF)
|
||||||
project(CrazyDiskInfo CXX)
|
project(CrazyDiskInfo CXX)
|
||||||
add_executable(CrazyDiskInfo main.cpp)
|
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)
|
SET_TARGET_PROPERTIES(CrazyDiskInfo PROPERTIES OUTPUT_NAME crazy)
|
||||||
target_link_libraries(CrazyDiskInfo atasmart)
|
target_link_libraries(CrazyDiskInfo atasmart)
|
||||||
target_link_libraries(CrazyDiskInfo tinfow)
|
|
||||||
target_link_libraries(CrazyDiskInfo ncursesw)
|
target_link_libraries(CrazyDiskInfo ncursesw)
|
||||||
INSTALL(TARGETS CrazyDiskInfo RUNTIME DESTINATION /usr/sbin)
|
include(GNUInstallDirs)
|
||||||
|
INSTALL(TARGETS CrazyDiskInfo RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR})
|
||||||
|
|
19
README.md
19
README.md
|
@ -1,5 +1,5 @@
|
||||||
# CrazyDiskInfo
|
# CrazyDiskInfo
|
||||||

|

|
||||||
|
|
||||||
## Introduction
|
## Introduction
|
||||||
CrazyDiskInfo is an interactive TUI S.M.A.R.T viewer for Unix systems.
|
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
|
#### Debian(or derivative) Systems
|
||||||
```
|
```
|
||||||
# apt-get install libatasmart-dev libncurses5-dev libncursesw5-dev
|
# apt install libatasmart-dev libncurses-dev
|
||||||
```
|
```
|
||||||
|
|
||||||
## Build and Run
|
## Build and Run
|
||||||
```
|
```
|
||||||
$ mkdir build
|
$ cmake -B build
|
||||||
$ cd build
|
$ cd build
|
||||||
$ cmake ..
|
$ make && sudo make install
|
||||||
$ make && make install
|
|
||||||
$ sudo crazy
|
$ sudo crazy
|
||||||
```
|
```
|
||||||
|
|
||||||
### Binary Package
|
### Binary Package
|
||||||
|
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)
|
Debian package is available from [OBS(Open Build Service)](https://build.opensuse.org/package/show/home:tsuroot/CrazyDiskInfo)
|
||||||
Direct Links:
|
Direct Links:
|
||||||
[Debian_8.0](http://download.opensuse.org/repositories/home:/tsuroot/Debian_8.0/)
|
[Debian_8.0](https://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/)
|
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.
|
I requested for tSU-RooT.
|
||||||
Thank you very much for your accept with my request.
|
Thank you very much for your accept with my request.
|
||||||
|
|
15
main.cpp
15
main.cpp
|
@ -214,7 +214,7 @@ void drawVersion(WINDOW * window)
|
||||||
auto title = " " + TITLE + "-" + VERSION + " ";
|
auto title = " " + TITLE + "-" + VERSION + " ";
|
||||||
|
|
||||||
wattrset(window, COLOR_PAIR(TITLE_COLOR));
|
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));
|
wattroff(window, COLOR_PAIR(TITLE_COLOR));
|
||||||
|
|
||||||
wnoutrefresh(window);
|
wnoutrefresh(window);
|
||||||
|
@ -232,7 +232,7 @@ void drawDeviceBar(WINDOW * window, std::vector<SMART> const & smartList, int se
|
||||||
if (std::get<0>(smartList[i].temperature))
|
if (std::get<0>(smartList[i].temperature))
|
||||||
{
|
{
|
||||||
wattrset(window, COLOR_PAIR(HEALTH_INV_COLOR + static_cast<int>(temperatureToHealth(std::get<1>(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);
|
waddch(window, ACS_DEGREE);
|
||||||
waddstr(window, "C");
|
waddstr(window, "C");
|
||||||
wattroff(window, COLOR_PAIR(HEALTH_INV_COLOR + static_cast<int>(temperatureToHealth(std::get<1>(smartList[i].temperature)))));
|
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)
|
if (i == select)
|
||||||
{
|
{
|
||||||
wattrset(window, COLOR_PAIR(HEALTH_COLOR) | A_BOLD);
|
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);
|
wattroff(window, COLOR_PAIR(HEALTH_COLOR) | A_BOLD);
|
||||||
|
|
||||||
wattrset(window, COLOR_PAIR(HEALTH_COLOR));
|
wattrset(window, COLOR_PAIR(HEALTH_COLOR));
|
||||||
|
@ -256,7 +256,7 @@ void drawDeviceBar(WINDOW * window, std::vector<SMART> const & smartList, int se
|
||||||
}
|
}
|
||||||
else
|
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());
|
mvwhline(window, 3, x, ' ', smartList[i].deviceName.length());
|
||||||
}
|
}
|
||||||
x += smartList[i].deviceName.length() + 1;
|
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:");
|
mvwprintw(window, 2, (int)(STATUS_WIDTH * (3.0 / 5)), "Power On Count:");
|
||||||
wattroff(window, COLOR_PAIR(HEALTH_COLOR));
|
wattroff(window, COLOR_PAIR(HEALTH_COLOR));
|
||||||
wattrset(window, COLOR_PAIR(HEALTH_COLOR) | A_BOLD);
|
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);
|
wattroff(window, COLOR_PAIR(HEALTH_COLOR) | A_BOLD);
|
||||||
wattrset(window, COLOR_PAIR(HEALTH_COLOR));
|
wattrset(window, COLOR_PAIR(HEALTH_COLOR));
|
||||||
wprintw(window, "count");
|
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:");
|
mvwprintw(window, 3, (int)(STATUS_WIDTH * (3.0 / 5)), "Power On Hours:");
|
||||||
wattroff(window, COLOR_PAIR(HEALTH_COLOR));
|
wattroff(window, COLOR_PAIR(HEALTH_COLOR));
|
||||||
wattrset(window, COLOR_PAIR(HEALTH_COLOR) | A_BOLD);
|
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);
|
wattroff(window, COLOR_PAIR(HEALTH_COLOR) | A_BOLD);
|
||||||
wattrset(window, COLOR_PAIR(HEALTH_COLOR));
|
wattrset(window, COLOR_PAIR(HEALTH_COLOR));
|
||||||
wprintw(window, "hours");
|
wprintw(window, "hours");
|
||||||
|
@ -507,7 +507,8 @@ int main()
|
||||||
update();
|
update();
|
||||||
|
|
||||||
{
|
{
|
||||||
struct sigaction s = {{actionWINCH}};
|
struct sigaction s = {0};
|
||||||
|
s.sa_handler = actionWINCH;
|
||||||
sigaction(SIGWINCH, &s, nullptr);
|
sigaction(SIGWINCH, &s, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue