Skip to content

Commit

Permalink
core: Make exit binding configurable (#2457)
Browse files Browse the repository at this point in the history
Fixes #2402.
  • Loading branch information
soreau authored Aug 29, 2024
1 parent 772bf12 commit c0621a3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions metadata/core.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,10 @@
<_long>Whether to pass buttons through to the client when switching the focus via clicking</_long>
<default>true</default>
</option>
<option name="exit" type="key">
<_short>Wayfire Shutdown</_short>
<_long>Calls the shutdown routines for wayfire.</_long>
<default>&lt;ctrl&gt; &lt;alt&gt; KEY_BACKSPACE</default>
</option>
</plugin>
</wayfire>
5 changes: 3 additions & 2 deletions src/core/wm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ static void idle_shutdown(void *data)

void wayfire_exit::init()
{
wf::option_wrapper_t<wf::keybinding_t> wayifre_exit_binding{"core/exit"};

key = [] (const wf::keybinding_t&)
{
auto output_impl = static_cast<wf::output_impl_t*>(wf::get_core().seat->get_active_output());
Expand All @@ -35,8 +37,7 @@ void wayfire_exit::init()
return true;
};

output->add_key(wf::create_option_string<wf::keybinding_t>(
"<ctrl> <alt> KEY_BACKSPACE"), &key);
output->add_key(wayifre_exit_binding, &key);
}

void wayfire_exit::fini()
Expand Down

0 comments on commit c0621a3

Please sign in to comment.