diff options
-rw-r--r-- | data/org.mate.SettingsDaemon.plugins.media-keys.gschema.xml.in | 5 | ||||
-rw-r--r-- | plugins/media-keys/acme.h | 2 | ||||
-rw-r--r-- | plugins/media-keys/msd-media-keys-manager.c | 19 |
3 files changed, 26 insertions, 0 deletions
diff --git a/data/org.mate.SettingsDaemon.plugins.media-keys.gschema.xml.in b/data/org.mate.SettingsDaemon.plugins.media-keys.gschema.xml.in index 2d62556..9677b6a 100644 --- a/data/org.mate.SettingsDaemon.plugins.media-keys.gschema.xml.in +++ b/data/org.mate.SettingsDaemon.plugins.media-keys.gschema.xml.in @@ -110,6 +110,11 @@ <summary>Launch calculator</summary> <description>Binding to launch the calculator.</description> </key> + <key name="messenger" type="s"> + <default>'XF86Messenger'</default> + <summary>Launch instant messenger</summary> + <description>Binding to launch the instant messenger.</description> + </key> <key name="www" type="s"> <default>'XF86WWW'</default> <summary>Launch web browser</summary> diff --git a/plugins/media-keys/acme.h b/plugins/media-keys/acme.h index fa64cbb..412ad59 100644 --- a/plugins/media-keys/acme.h +++ b/plugins/media-keys/acme.h @@ -41,6 +41,7 @@ enum { HOME_KEY, MEDIA_KEY, CALCULATOR_KEY, + MESSENGER_KEY, SEARCH_KEY, EMAIL_KEY, CONTROL_CENTER_KEY, @@ -87,6 +88,7 @@ static struct { { HOME_KEY, "home", NULL, NULL }, { MEDIA_KEY, "media", NULL, NULL }, { CALCULATOR_KEY, "calculator", NULL, NULL }, + { MESSENGER_KEY, "messenger", NULL, NULL }, { SEARCH_KEY, "search", NULL, NULL }, { EMAIL_KEY, "email", NULL, NULL }, { CONTROL_CENTER_KEY, "control-center", NULL, NULL }, diff --git a/plugins/media-keys/msd-media-keys-manager.c b/plugins/media-keys/msd-media-keys-manager.c index fc9bee7..a68835f 100644 --- a/plugins/media-keys/msd-media-keys-manager.c +++ b/plugins/media-keys/msd-media-keys-manager.c @@ -543,6 +543,22 @@ do_calculator_action (MsdMediaKeysManager *manager) } static void +do_messenger_action (MsdMediaKeysManager *manager) +{ + GSettings *settings; + char *messenger; + + settings = g_settings_new ("org.mate.applications-messenger"); + messenger = g_settings_get_string (settings, "exec"); + + if (messenger) + execute (manager, messenger, FALSE, FALSE); + + g_free (messenger); + g_object_unref (settings); +} + +static void do_shutdown_action (MsdMediaKeysManager *manager) { execute (manager, "mate-session-save --shutdown-dialog", FALSE, FALSE); @@ -1263,6 +1279,9 @@ do_action (MsdMediaKeysManager *manager, case CALCULATOR_KEY: do_calculator_action (manager); break; + case MESSENGER_KEY: + do_messenger_action (manager); + break; case PLAY_KEY: return do_multimedia_player_action (manager, "Play"); case PAUSE_KEY: |