Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: Make exit binding configurable #2457

Merged
merged 1 commit into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading