mirror of
https://github.com/scorpion-26/gBar.git
synced 2024-11-22 11:12:49 +00:00
Make datetime format configurable (#18)
Co-authored-by: Sciu-Crak <sciu-crak@crak-tower.ironyworld> Co-authored-by: FaulTTY <faultty@localhost>
This commit is contained in:
parent
77924b5097
commit
9aa310fd07
4 changed files with 6 additions and 1 deletions
|
@ -43,6 +43,9 @@ UseHyprlandIPC: false
|
|||
# This can cause issues, if there is not enough space on screen (e.g. when opening the text)
|
||||
CenterTime: true
|
||||
|
||||
# Set datetime style
|
||||
# DateTimeStyle: %a %D - %H:%M:%S %Z
|
||||
|
||||
# Adds a audio input(aka. microphone) widget
|
||||
AudioInput: false
|
||||
|
||||
|
|
|
@ -165,6 +165,7 @@ void Config::Load()
|
|||
AddConfigVar("ExitCommand", config.exitCommand, lineView, foundProperty);
|
||||
AddConfigVar("BatteryFolder", config.batteryFolder, lineView, foundProperty);
|
||||
AddConfigVar("DefaultWorkspaceSymbol", config.defaultWorkspaceSymbol, lineView, foundProperty);
|
||||
AddConfigVar("DateTimeStyle", config.dateTimeStyle, lineView, foundProperty);
|
||||
AddConfigVar("CheckPackagesCommand", config.checkPackagesCommand, lineView, foundProperty);
|
||||
for (int i = 1; i < 10; i++)
|
||||
{
|
||||
|
|
|
@ -15,6 +15,7 @@ public:
|
|||
std::string batteryFolder = ""; // this can be BAT0, BAT1, etc. Usually in /sys/class/power_supply
|
||||
std::vector<std::string> workspaceSymbols = std::vector<std::string>(9, "");
|
||||
std::string defaultWorkspaceSymbol = "";
|
||||
std::string dateTimeStyle = "%a %D - %H:%M:%S %Z"; // A sane default
|
||||
|
||||
// Script that returns how many packages are out-of-date. The script should only print a number!
|
||||
// See data/update.sh for a human-readable version
|
||||
|
|
|
@ -604,7 +604,7 @@ namespace System
|
|||
time_t stdTime = time(NULL);
|
||||
tm* localTime = localtime(&stdTime);
|
||||
std::stringstream str;
|
||||
str << std::put_time(localTime, "%a %D - %H:%M:%S %Z");
|
||||
str << std::put_time(localTime, Config::Get().dateTimeStyle.c_str());
|
||||
return str.str();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue