Skip to content


Browse files Browse the repository at this point in the history
media-keys: Execute default calculator application defined by schema
Signed-off-by: Zhang Xianwei <>
  • Loading branch information
zhangxianwei8 authored and lukefromdc committed Dec 7, 2018
1 parent da353f2 commit c19fce3
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions plugins/media-keys/msd-media-keys-manager.c
Expand Up @@ -526,6 +526,22 @@ do_media_action (MsdMediaKeysManager *manager)

static void
do_calculator_action (MsdMediaKeysManager *manager)
GSettings *settings;
char *calc;

settings = g_settings_new ("org.mate.applications-calculator");
calc = g_settings_get_string (settings, "exec");

if (calc)
execute (manager, calc, FALSE, FALSE);

g_free (calc);
g_object_unref (settings);

static void
do_shutdown_action (MsdMediaKeysManager *manager)
Expand Down Expand Up @@ -1245,15 +1261,7 @@ do_action (MsdMediaKeysManager *manager,
do_media_action (manager);
if ((cmd = g_find_program_in_path ("galculator"))) {
execute (manager, "galculator", FALSE, FALSE);
} else if ((cmd = g_find_program_in_path ("mate-calc"))) {
execute (manager, "mate-calc", FALSE, FALSE);
} else {
execute (manager, "gnome-calculator", FALSE, FALSE);

g_free (cmd);
do_calculator_action (manager);
case PLAY_KEY:
return do_multimedia_player_action (manager, "Play");
Expand Down

0 comments on commit c19fce3

Please sign in to comment.