Skip to content

Commit

Permalink
Add shortcut to start mate-control-center
Browse files Browse the repository at this point in the history
Some laptops have a setting hotkey. This is bound by default to
XF86Tools. Add shortcut to start mate-control-center to support it.

Signed-off-by: Zhang Xianwei <zhang.xianwei8@zte.com.cn>
  • Loading branch information
zhangxianwei8 authored and lukefromdc committed Oct 18, 2018
1 parent 11f25cd commit 765208e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@
<summary>Launch email client</summary>
<description>Binding to launch the email client.</description>
</key>
<key name="control-center" type="s">
<default>'XF86Tools'</default>
<summary>Launch settings</summary>
<description>Binding to launch MATE settings.</description>
</key>
<key name="screensaver" type="s">
<default>'&lt;Control&gt;&lt;Alt&gt;l'</default>
<summary>Lock screen</summary>
Expand Down
2 changes: 2 additions & 0 deletions plugins/media-keys/acme.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ enum {
CALCULATOR_KEY,
SEARCH_KEY,
EMAIL_KEY,
CONTROL_CENTER_KEY,
SCREENSAVER_KEY,
HELP_KEY,
WWW_KEY,
Expand Down Expand Up @@ -77,6 +78,7 @@ static struct {
{ CALCULATOR_KEY, "calculator", NULL, NULL },
{ SEARCH_KEY, "search", NULL, NULL },
{ EMAIL_KEY, "email", NULL, NULL },
{ CONTROL_CENTER_KEY, "control-center", NULL, NULL },
{ SCREENSAVER_KEY, "screensaver", NULL, NULL },
{ HELP_KEY, "help", NULL, NULL },
{ WWW_KEY, "www", NULL, NULL },
Expand Down
6 changes: 6 additions & 0 deletions plugins/media-keys/msd-media-keys-manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -976,6 +976,12 @@ do_action (MsdMediaKeysManager *manager,
case EMAIL_KEY:
do_url_action (manager, "mailto");
break;
case CONTROL_CENTER_KEY:
if ((cmd = g_find_program_in_path ("mate-control-center")))
execute (manager, "mate-control-center", FALSE, FALSE);

g_free (cmd);
break;
case SCREENSAVER_KEY:
if ((cmd = g_find_program_in_path ("mate-screensaver-command"))) {
execute (manager, "mate-screensaver-command --lock", FALSE, FALSE);
Expand Down

0 comments on commit 765208e

Please sign in to comment.