2023-01-29 15:47:50 +00:00
|
|
|
#pragma once
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
2023-05-03 19:01:18 +00:00
|
|
|
#include <cstdint>
|
2023-05-04 14:14:18 +00:00
|
|
|
#include <unordered_map>
|
2023-09-01 22:05:08 +00:00
|
|
|
#include <map>
|
2023-01-29 15:47:50 +00:00
|
|
|
|
2023-02-10 16:20:26 +00:00
|
|
|
class Config
|
2023-01-29 15:47:50 +00:00
|
|
|
{
|
|
|
|
public:
|
2023-10-21 16:32:51 +00:00
|
|
|
std::vector<std::string> widgetsLeft = {"Workspaces"};
|
|
|
|
std::vector<std::string> widgetsCenter = {"Time"};
|
|
|
|
std::vector<std::string> widgetsRight = {"Tray", "Sound", "Bluetooth", "Network", "Disk", "VRAM", "GPU", "CPU", "Battery", "Power"};
|
|
|
|
|
2023-02-10 16:20:26 +00:00
|
|
|
std::string cpuThermalZone = ""; // idk, no standard way of doing this.
|
|
|
|
std::string networkAdapter = "eno1"; // Is this standard?
|
2023-01-29 15:47:50 +00:00
|
|
|
std::string suspendCommand = "systemctl suspend";
|
2023-02-10 16:20:26 +00:00
|
|
|
std::string lockCommand = ""; // idk, no standard way of doing this.
|
|
|
|
std::string exitCommand = ""; // idk, no standard way of doing this.
|
2023-01-29 15:47:50 +00:00
|
|
|
std::string batteryFolder = ""; // this can be BAT0, BAT1, etc. Usually in /sys/class/power_supply
|
2023-09-01 22:05:08 +00:00
|
|
|
std::map<uint32_t, std::string> workspaceSymbols;
|
2023-01-29 15:47:50 +00:00
|
|
|
std::string defaultWorkspaceSymbol = "";
|
2023-05-26 06:57:02 +00:00
|
|
|
std::string dateTimeStyle = "%a %D - %H:%M:%S %Z"; // A sane default
|
2023-09-01 22:05:08 +00:00
|
|
|
std::string dateTimeLocale = ""; // use system locale
|
2023-09-08 14:34:17 +00:00
|
|
|
std::string diskPartition = "/"; // should be expectable on every linux system
|
2023-01-29 15:47:50 +00:00
|
|
|
|
2023-05-03 16:37:36 +00:00
|
|
|
// Script that returns how many packages are out-of-date. The script should only print a number!
|
2023-05-05 10:47:40 +00:00
|
|
|
// See data/update.sh for a human-readable version
|
2023-08-21 16:19:46 +00:00
|
|
|
std::string checkPackagesCommand =
|
|
|
|
"p=\"$(checkupdates)\"; e=$?; if [ $e -eq 127 ] ; then exit 127; fi; if [ $e -eq 2 ] ; then echo \"0\" && exit 0; fi; echo \"$p\" | wc -l";
|
2023-05-03 16:37:36 +00:00
|
|
|
|
2023-01-29 20:31:00 +00:00
|
|
|
bool centerTime = true;
|
2023-02-04 14:07:05 +00:00
|
|
|
bool audioRevealer = false;
|
2023-02-22 15:45:29 +00:00
|
|
|
bool audioInput = false;
|
2023-08-21 16:19:46 +00:00
|
|
|
bool audioNumbers = false; // Affects both audio sliders
|
2023-02-10 16:20:26 +00:00
|
|
|
bool networkWidget = true;
|
2023-02-12 13:57:32 +00:00
|
|
|
bool workspaceScrollOnMonitor = true; // Scroll through workspaces on monitor instead of all
|
2023-02-22 15:45:29 +00:00
|
|
|
bool workspaceScrollInvert = false; // Up = +1, instead of Up = -1
|
2023-09-01 15:53:17 +00:00
|
|
|
bool useHyprlandIPC = true; // Use Hyprland IPC instead of ext_workspaces protocol (Less buggy, but also less performant)
|
2023-05-03 18:57:24 +00:00
|
|
|
bool enableSNI = true; // Enable tray icon
|
2023-09-07 15:24:41 +00:00
|
|
|
bool sensorTooltips = false; // Use tooltips instead of sliders for the sensors
|
2023-02-10 16:20:26 +00:00
|
|
|
|
|
|
|
// Controls for color progression of the network widget
|
|
|
|
uint32_t minUploadBytes = 0; // Bottom limit of the network widgets upload. Everything below it is considered "under"
|
|
|
|
uint32_t maxUploadBytes = 4 * 1024 * 1024; // 4 MiB Top limit of the network widgets upload. Everything above it is considered "over"
|
|
|
|
uint32_t minDownloadBytes = 0; // Bottom limit of the network widgets download. Everything above it is considered "under"
|
|
|
|
uint32_t maxDownloadBytes = 10 * 1024 * 1024; // 10 MiB Top limit of the network widgets download. Everything above it is considered "over"
|
2023-01-29 15:47:50 +00:00
|
|
|
|
2023-09-01 22:05:08 +00:00
|
|
|
uint32_t audioScrollSpeed = 5; // 5% each scroll
|
2023-05-03 16:37:36 +00:00
|
|
|
uint32_t checkUpdateInterval = 5 * 60; // Interval to run the "checkPackagesCommand". In seconds
|
2023-09-01 22:05:08 +00:00
|
|
|
uint32_t timeSpace = 300; // How much time should be reserved for the time widget.
|
|
|
|
uint32_t numWorkspaces = 9; // How many workspaces to display
|
2023-06-10 21:44:28 +00:00
|
|
|
|
2023-07-18 23:07:32 +00:00
|
|
|
char location = 'T'; // The Location of the bar. Can be L,R,T,B
|
|
|
|
|
2023-05-04 14:14:18 +00:00
|
|
|
// SNIIconSize: ["Title String"], ["Size"]
|
|
|
|
std::unordered_map<std::string, uint32_t> sniIconSizes;
|
|
|
|
std::unordered_map<std::string, int32_t> sniPaddingTop;
|
|
|
|
|
2023-03-21 21:09:56 +00:00
|
|
|
// Only affects outputs (i.e.: speakers, not microphones). This remaps the range of the volume; In percent
|
|
|
|
double audioMinVolume = 0.f; // Map the minimum volume to this value
|
|
|
|
double audioMaxVolume = 100.f; // Map the maximum volume to this value
|
|
|
|
|
2023-01-29 15:47:50 +00:00
|
|
|
static void Load();
|
|
|
|
static const Config& Get();
|
|
|
|
};
|
2023-01-30 15:57:15 +00:00
|
|
|
|
2023-03-03 19:44:51 +00:00
|
|
|
// Configs, that rely on specific files to be available(e.g. BlueZ running)
|
2023-01-30 15:57:15 +00:00
|
|
|
class RuntimeConfig
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
#ifdef WITH_NVIDIA
|
|
|
|
bool hasNvidia = true;
|
|
|
|
#else
|
|
|
|
bool hasNvidia = false;
|
|
|
|
#endif
|
2023-01-30 16:23:28 +00:00
|
|
|
#ifdef WITH_AMD
|
|
|
|
bool hasAMD = true;
|
|
|
|
#else
|
|
|
|
bool hasAMD = false;
|
|
|
|
#endif
|
2023-01-30 15:57:15 +00:00
|
|
|
|
2023-03-03 19:44:51 +00:00
|
|
|
#ifdef WITH_WORKSPACES
|
|
|
|
bool hasWorkspaces = true;
|
2023-01-30 15:57:15 +00:00
|
|
|
#else
|
2023-03-03 19:44:51 +00:00
|
|
|
bool hasWorkspaces = false;
|
2023-01-30 15:57:15 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef WITH_BLUEZ
|
|
|
|
bool hasBlueZ = true;
|
|
|
|
#else
|
|
|
|
bool hasBlueZ = false;
|
|
|
|
#endif
|
|
|
|
|
2023-05-03 18:57:24 +00:00
|
|
|
#if defined WITH_SNI && defined HAS_STB
|
|
|
|
bool hasSNI = true;
|
|
|
|
#else
|
|
|
|
bool hasSNI = false;
|
|
|
|
#endif
|
|
|
|
|
2023-02-12 19:45:05 +00:00
|
|
|
bool hasNet = true;
|
|
|
|
|
2023-05-03 16:37:36 +00:00
|
|
|
bool hasPackagesScript = true;
|
|
|
|
|
2023-01-30 15:57:15 +00:00
|
|
|
static RuntimeConfig& Get();
|
|
|
|
};
|