all repos — fluxbox @ e71892d99cbe99e2335aa6eb3771ffbb72c5303f

custom fork of the fluxbox windowmanager

allow restart with no argument from fluxbox-remote
Mark Tiefenbruck mark@fluxbox.org
commit

e71892d99cbe99e2335aa6eb3771ffbb72c5303f

parent

2cdb04cc1e33308d6a414f792093bf4abf6b9f93

2 files changed, 10 insertions(+), 1 deletions(-)

jump to
M src/FbCommands.ccsrc/FbCommands.cc

@@ -243,7 +243,14 @@ void SaveResources::execute() {

Fluxbox::instance()->save_rc(); } -REGISTER_UNTRUSTED_COMMAND_WITH_ARGS(restart, FbCommands::RestartFluxboxCmd, void); +REGISTER_COMMAND_PARSER(restart, RestartFluxboxCmd::parse, void); + +FbTk::Command<void> *RestartFluxboxCmd::parse(const string &command, + const string &args, bool trusted) { + if (!trusted && !args.empty()) + return 0; + return new RestartFluxboxCmd(args); +} RestartFluxboxCmd::RestartFluxboxCmd(const string &cmd):m_cmd(cmd){ }
M src/FbCommands.hhsrc/FbCommands.hh

@@ -77,6 +77,8 @@ class RestartFluxboxCmd: public FbTk::Command<void> {

public: RestartFluxboxCmd(const std::string &cmd); void execute(); + static FbTk::Command<void> *parse(const std::string &command, + const std::string &args, bool trusted); private: std::string m_cmd; };