2023-01-13 15:13:56 +00:00
|
|
|
#pragma once
|
2023-01-14 22:18:34 +00:00
|
|
|
#include <functional>
|
2023-01-13 15:13:56 +00:00
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
namespace System
|
|
|
|
{
|
|
|
|
// From 0-1, all cores
|
|
|
|
double GetCPUUsage();
|
|
|
|
// Tctl
|
|
|
|
double GetCPUTemp();
|
|
|
|
|
2023-01-28 22:47:55 +00:00
|
|
|
double GetBatteryPercentage();
|
|
|
|
|
2023-01-13 15:13:56 +00:00
|
|
|
struct RAMInfo
|
|
|
|
{
|
|
|
|
double totalGiB;
|
|
|
|
double freeGiB;
|
|
|
|
};
|
|
|
|
RAMInfo GetRAMInfo();
|
|
|
|
|
|
|
|
#ifdef HAS_NVIDIA
|
|
|
|
struct GPUInfo
|
|
|
|
{
|
|
|
|
double utilisation;
|
|
|
|
double coreTemp;
|
|
|
|
};
|
|
|
|
GPUInfo GetGPUInfo();
|
|
|
|
|
|
|
|
struct VRAMInfo
|
|
|
|
{
|
|
|
|
double totalGiB;
|
|
|
|
double usedGiB;
|
|
|
|
};
|
|
|
|
VRAMInfo GetVRAMInfo();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
struct DiskInfo
|
|
|
|
{
|
|
|
|
double totalGiB;
|
|
|
|
double usedGiB;
|
|
|
|
};
|
|
|
|
DiskInfo GetDiskInfo();
|
|
|
|
|
|
|
|
#ifdef HAS_BLUEZ
|
|
|
|
struct BluetoothDevice
|
|
|
|
{
|
2023-01-14 22:18:34 +00:00
|
|
|
bool connected;
|
|
|
|
bool paired;
|
|
|
|
std::string mac;
|
2023-01-13 15:13:56 +00:00
|
|
|
std::string name;
|
|
|
|
// Known types: input-[keyboard,mouse]; audio-headset
|
|
|
|
std::string type;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct BluetoothInfo
|
|
|
|
{
|
|
|
|
std::string defaultController;
|
|
|
|
std::vector<BluetoothDevice> devices;
|
|
|
|
};
|
|
|
|
BluetoothInfo GetBluetoothInfo();
|
2023-01-15 10:09:06 +00:00
|
|
|
void StartBTScan();
|
|
|
|
void StopBTScan();
|
2023-01-14 22:18:34 +00:00
|
|
|
|
|
|
|
// MT functions, callback, is from different thread
|
2023-01-15 10:09:06 +00:00
|
|
|
void ConnectBTDevice(BluetoothDevice& device, std::function<void(bool, BluetoothDevice&)> onFinish);
|
|
|
|
void DisconnectBTDevice(BluetoothDevice& device, std::function<void(bool, BluetoothDevice&)> onFinish);
|
2023-01-14 22:18:34 +00:00
|
|
|
|
|
|
|
void OpenBTWidget();
|
2023-01-15 10:09:06 +00:00
|
|
|
|
|
|
|
std::string BTTypeToIcon(const BluetoothDevice& dev);
|
2023-01-13 15:13:56 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
struct AudioInfo
|
|
|
|
{
|
|
|
|
double volume;
|
|
|
|
bool muted;
|
|
|
|
};
|
|
|
|
AudioInfo GetAudioInfo();
|
|
|
|
void SetVolume(double volume);
|
|
|
|
|
|
|
|
#ifdef HAS_HYPRLAND
|
|
|
|
enum class WorkspaceStatus
|
|
|
|
{
|
|
|
|
Dead,
|
|
|
|
Inactive,
|
|
|
|
Visible,
|
|
|
|
Current,
|
|
|
|
Active
|
|
|
|
};
|
|
|
|
WorkspaceStatus GetWorkspaceStatus(uint32_t monitor, uint32_t workspace);
|
|
|
|
void GotoWorkspace(uint32_t workspace);
|
2023-01-29 11:07:24 +00:00
|
|
|
std::string GetWorkspaceSymbol(int index);
|
2023-01-13 15:13:56 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
std::string GetTime();
|
|
|
|
|
|
|
|
void Shutdown();
|
|
|
|
void Reboot();
|
|
|
|
void ExitWM();
|
|
|
|
void Lock();
|
|
|
|
void Suspend();
|
|
|
|
|
|
|
|
void Init();
|
|
|
|
void FreeResources();
|
|
|
|
}
|