mirror of
https://github.com/aristocratos/btop.git
synced 2026-06-11 09:14:22 -04:00
Added definition GPU_SUPPORT to toggle GPU related code
This commit is contained in:
@@ -271,11 +271,18 @@ namespace Input {
|
||||
}
|
||||
else if (key.size() == 1 and isint(key)) {
|
||||
auto intKey = stoi(key);
|
||||
#ifdef GPU_SUPPORT
|
||||
static const array<string, 10> boxes = {"gpu5", "cpu", "mem", "net", "proc", "gpu0", "gpu1", "gpu2", "gpu3", "gpu4"};
|
||||
if ((intKey == 0 and Gpu::gpu_names.size() < 5) or (intKey >= 5 and std::cmp_less(Gpu::gpu_names.size(), intKey - 4)))
|
||||
return;
|
||||
#else
|
||||
static const array<string, 10> boxes = {"", "cpu", "mem", "net", "proc"};
|
||||
if (intKey == 0 or intKey > 4)
|
||||
return;
|
||||
#endif
|
||||
atomic_wait(Runner::active);
|
||||
Config::current_preset = -1;
|
||||
static const array<string, 10> boxes = {"gpu5", "cpu", "mem", "net", "proc", "gpu0", "gpu1", "gpu2", "gpu3", "gpu4"};
|
||||
|
||||
Config::toggle_box(boxes.at(intKey));
|
||||
Draw::calcSizes();
|
||||
Runner::run("all", false, true);
|
||||
|
||||
Reference in New Issue
Block a user