User kill signal config keys: Use underscore instead of dash

This commit is contained in:
Martynas Maciulevičius
2025-06-26 18:41:23 +03:00
parent 7463be9b6a
commit b7ff47fb05
2 changed files with 7 additions and 7 deletions

View File

@ -151,14 +151,14 @@ The visual display elements for waybar use a CSS stylesheet, see *waybar-styles(
default: *false* ++ default: *false* ++
Option to enable reloading the css style if a modification is detected on the style sheet file or any imported css files. Option to enable reloading the css style if a modification is detected on the style sheet file or any imported css files.
*on_sigusr1* ++ *on-sigusr1* ++
typeof: string ++ typeof: string ++
default: *toggle* ++ default: *toggle* ++
Action that is performed when receiving SIGUSR1 kill signal. ++ Action that is performed when receiving SIGUSR1 kill signal. ++
Possible values: *show*, *hide*, *toggle*, *reload*, *noop*. ++ Possible values: *show*, *hide*, *toggle*, *reload*, *noop*. ++
Default value: *toggle*. Default value: *toggle*.
*on_sigusr2* ++ *on-sigusr2* ++
typeof: string ++ typeof: string ++
default: *reload* ++ default: *reload* ++
Action that is performed when receiving SIGUSR2 kill signal. ++ Action that is performed when receiving SIGUSR2 kill signal. ++
@ -230,7 +230,7 @@ For example, to toggle the bar programmatically, you can invoke `killall -SIGUSR
## User signal configuration ## User signal configuration
Config parameters *on_sigusr1* and *on_sigusr2* change what happens when bars receive Config parameters *on-sigusr1* and *on-sigusr2* change what happens when bars receive
*SIGUSR1* and *SIGUSR2* signals. *SIGUSR1* and *SIGUSR2* signals.
This means that commands `killall -SIGUSR1 waybar` and `killall -SIGUSR2 waybar` This means that commands `killall -SIGUSR1 waybar` and `killall -SIGUSR2 waybar`

View File

@ -280,7 +280,7 @@ waybar::Bar::Bar(struct waybar_output* w_output, const Json::Value& w_config)
#endif #endif
waybar::util::EnumParser<util::KillSignalAction> m_signalActionEnumParser; waybar::util::EnumParser<util::KillSignalAction> m_signalActionEnumParser;
const auto& configSigusr1 = config["on_sigusr1"]; const auto& configSigusr1 = config["on-sigusr1"];
if (configSigusr1.isString()) { if (configSigusr1.isString()) {
auto strSigusr1 = configSigusr1.asString(); auto strSigusr1 = configSigusr1.asString();
try { try {
@ -289,10 +289,10 @@ waybar::Bar::Bar(struct waybar_output* w_output, const Json::Value& w_config)
} catch (const std::invalid_argument& e) { } catch (const std::invalid_argument& e) {
onSigusr1 = util::SIGNALACTION_DEFAULT_SIGUSR1; onSigusr1 = util::SIGNALACTION_DEFAULT_SIGUSR1;
spdlog::warn( spdlog::warn(
"Invalid string representation for on_sigusr1. Falling back to default mode (toggle)."); "Invalid string representation for on-sigusr1. Falling back to default mode (toggle).");
} }
} }
const auto& configSigusr2 = config["on_sigusr2"]; const auto& configSigusr2 = config["on-sigusr2"];
if (configSigusr2.isString()) { if (configSigusr2.isString()) {
auto strSigusr2 = configSigusr2.asString(); auto strSigusr2 = configSigusr2.asString();
try { try {
@ -301,7 +301,7 @@ waybar::Bar::Bar(struct waybar_output* w_output, const Json::Value& w_config)
} catch (const std::invalid_argument& e) { } catch (const std::invalid_argument& e) {
onSigusr2 = util::SIGNALACTION_DEFAULT_SIGUSR2; onSigusr2 = util::SIGNALACTION_DEFAULT_SIGUSR2;
spdlog::warn( spdlog::warn(
"Invalid string representation for on_sigusr2. Falling back to default mode (reload)."); "Invalid string representation for on-sigusr2. Falling back to default mode (reload).");
} }
} }