mirror of
https://github.com/hyprwm/hyprlock.git
synced 2024-12-22 13:29:48 +01:00
parent
f85287a523
commit
4c68780143
1 changed files with 6 additions and 1 deletions
|
@ -48,8 +48,13 @@ static std::string getTime() {
|
|||
|
||||
IWidget::SFormatResult IWidget::formatString(std::string in) {
|
||||
|
||||
char* username = getlogin();
|
||||
|
||||
if (!username)
|
||||
Debug::log(ERR, "Error in formatString, username null. Errno: ", errno);
|
||||
|
||||
IWidget::SFormatResult result;
|
||||
replaceAll(in, "$USER", std::string{getlogin()});
|
||||
replaceAll(in, "$USER", std::string{username ? username : ""});
|
||||
replaceAll(in, "<br/>", std::string{"\n"});
|
||||
|
||||
if (in.contains("$TIME")) {
|
||||
|
|
Loading…
Reference in a new issue