aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2021-05-01 22:11:18 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2021-05-01 22:11:18 +0200
commit4b8dc2935dd2d2bac497ea1c024a2b39fa0d671c (patch)
tree16224cfa53516516f0de3344a1f73202987db61e
parent01510e1ed880c1fca9e9b86c474ec90a79fc05c9 (diff)
parent75cbf7ac1c3f7688cc13573bacf1ac71582d01cf (diff)
downloadayatana-indicator-session-4b8dc2935dd2d2bac497ea1c024a2b39fa0d671c.tar.gz
ayatana-indicator-session-4b8dc2935dd2d2bac497ea1c024a2b39fa0d671c.tar.bz2
ayatana-indicator-session-4b8dc2935dd2d2bac497ea1c024a2b39fa0d671c.zip
Merge branch 'tari01-pr/budgie-support'
Attributes GH PR #16: https://github.com/AyatanaIndicators/ayatana-indicator-session/pull/16
-rw-r--r--data/ayatana-indicator-session.desktop.in2
-rw-r--r--src/backend-dbus/actions.c54
-rw-r--r--src/service.c5
-rw-r--r--src/utils.c5
-rw-r--r--src/utils.h2
5 files changed, 66 insertions, 2 deletions
diff --git a/data/ayatana-indicator-session.desktop.in b/data/ayatana-indicator-session.desktop.in
index 0ab13df..dffd22b 100644
--- a/data/ayatana-indicator-session.desktop.in
+++ b/data/ayatana-indicator-session.desktop.in
@@ -2,7 +2,7 @@
Type=Application
Name=Ayatana Indicator Session
Exec=@pkglibexecdir@/ayatana-indicator-session-service
-OnlyShowIn=Unity;MATE;XFCE;
+OnlyShowIn=Unity;MATE;XFCE;Budgie:GNOME;
NoDisplay=true
StartupNotify=false
Terminal=false
diff --git a/src/backend-dbus/actions.c b/src/backend-dbus/actions.c
index 9d65202..429b5ec 100644
--- a/src/backend-dbus/actions.c
+++ b/src/backend-dbus/actions.c
@@ -101,6 +101,7 @@ typedef enum
PROMPT_WITH_ZENITY,
PROMPT_WITH_AYATANA,
PROMPT_WITH_MATE,
+ PROMPT_WITH_BUDGIE,
PROMPT_WITH_XFCE,
}
prompt_status_t;
@@ -132,6 +133,20 @@ have_mate_program (const gchar *program)
return FALSE;
}
+static gboolean have_budgie_program(const gchar *program)
+{
+ g_auto(GStrv) desktop_names = NULL;
+
+ if (is_budgie())
+ {
+ g_autofree gchar *path = g_find_program_in_path(program);
+
+ return path != NULL;
+ }
+
+ return FALSE;
+}
+
static gboolean
have_xfce_program (const gchar *program)
{
@@ -157,6 +172,12 @@ get_prompt_status (IndicatorSessionActionsDbus * self)
if ((prompt == PROMPT_NONE) && have_mate_program ("mate-session-save"))
prompt = PROMPT_WITH_MATE;
+ // can we use the BUDGIE (currently GNOME) prompt?
+ if ((prompt == PROMPT_NONE) && have_budgie_program("gnome-session-quit"))
+ {
+ prompt = PROMPT_WITH_BUDGIE;
+ }
+
/* can we use the XFCE prompt? */
if ((prompt == PROMPT_NONE) && have_xfce_program ("xfce4-session-logout"))
prompt = PROMPT_WITH_XFCE;
@@ -873,7 +894,12 @@ my_logout (IndicatorSessionActions * actions)
/* --logout-dialog presents Logout and (if available) Switch User options */
run_outside_app ("mate-session-save --logout-dialog");
break;
+ case PROMPT_WITH_BUDGIE:
+ {
+ run_outside_app("gnome-session-quit --logout");
+ break;
+ }
case PROMPT_WITH_XFCE:
run_outside_app ("xfce4-session-logout");
break;
@@ -919,7 +945,12 @@ my_reboot (IndicatorSessionActions * actions)
/* --shutdown-dialog presents Restart, Shutdown and (if available) Suspend options */
run_outside_app ("mate-session-save --shutdown-dialog");
break;
+ case PROMPT_WITH_BUDGIE:
+ {
+ run_outside_app("gnome-session-quit --reboot");
+ break;
+ }
case PROMPT_WITH_XFCE:
run_outside_app ("xfce4-session-logout");
break;
@@ -960,7 +991,12 @@ my_power_off (IndicatorSessionActions * actions)
/* --shutdown-dialog presents Restart, Shutdown and (if available) Suspend options */
run_outside_app ("mate-session-save --shutdown-dialog");
break;
+ case PROMPT_WITH_BUDGIE:
+ {
+ run_outside_app("gnome-session-quit --power-off");
+ break;
+ }
case PROMPT_WITH_XFCE:
run_outside_app ("xfce4-session-logout");
break;
@@ -1021,7 +1057,11 @@ my_desktop_help (IndicatorSessionActions * self G_GNUC_UNUSED)
{
static char * browser = NULL;
- if (have_gnome_program ("yelp"))
+ if (have_budgie_program ("yelp"))
+ {
+ run_outside_app ("yelp help:gnome-user-guide");
+ }
+ else if (have_gnome_program ("yelp"))
run_outside_app ("yelp help:gnome-user-guide");
else if (have_mate_program ("yelp"))
run_outside_app ("yelp help:mate-user-guide");
@@ -1101,6 +1141,10 @@ my_settings (IndicatorSessionActions * self G_GNUC_UNUSED)
#endif
if (have_unity_control_center ())
run_outside_app ("unity-control-center");
+ else if (have_budgie_program("gnome-control-center"))
+ {
+ run_outside_app("gnome-control-center");
+ }
else if (have_gnome_control_center())
run_outside_app ("gnome-control-center");
else if (have_mate_program ("mate-control-center"))
@@ -1141,6 +1185,10 @@ my_about (IndicatorSessionActions * self G_GNUC_UNUSED)
#endif
if (have_unity_control_center ())
run_outside_app ("unity-control-center info");
+ else if (have_budgie_program("gnome-control-center"))
+ {
+ run_outside_app("gnome-control-center info-overview");
+ }
else if (have_gnome_control_center())
run_outside_app ("gnome-control-center info");
else if (have_mate_program ("mate-system-monitor"))
@@ -1177,6 +1225,10 @@ lock_current_session (IndicatorSessionActions * self, gboolean immediate)
{
run_outside_app ("mate-screensaver-command --lock");
}
+ else if (have_budgie_program("gnome-screensaver-command"))
+ {
+ run_outside_app("gnome-screensaver-command --lock");
+ }
else if (have_xfce_program ("xflock4"))
{
run_outside_app ("xflock4");
diff --git a/src/service.c b/src/service.c
index 0d0cd36..c970c62 100644
--- a/src/service.c
+++ b/src/service.c
@@ -1178,6 +1178,11 @@ indicator_session_service_init (IndicatorSessionService * self)
if (is_mate())
p->keybinding_settings = g_settings_new ("org.mate.SettingsDaemon.plugins.media-keys");
+ else if (is_budgie())
+ {
+ p->keybinding_settings = g_settings_new("org.gnome.settings-daemon.plugins.media-keys");
+ }
+
else if (is_gnome() || is_unity())
p->keybinding_settings = g_settings_new ("org.gnome.settings-daemon.plugins.media-keys");
diff --git a/src/utils.c b/src/utils.c
index 406cafa..7e67bb2 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -55,6 +55,11 @@ is_mate ()
return is_xdg_current_desktop(DESKTOP_MATE);
}
+gboolean is_budgie()
+{
+ return is_xdg_current_desktop(DESKTOP_BUDGIE);
+}
+
gboolean
is_xfce ()
{
diff --git a/src/utils.h b/src/utils.h
index 2d3c932..47bb427 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -26,12 +26,14 @@
*/
#define DESKTOP_UNITY "Unity"
#define DESKTOP_MATE "MATE"
+#define DESKTOP_BUDGIE "Budgie:GNOME"
#define DESKTOP_GNOME "GNOME"
#define DESKTOP_XFCE "XFCE"
gboolean is_unity();
gboolean is_gnome();
gboolean is_mate();
+gboolean is_budgie();
gboolean is_xfce();
const char* get_distro_name();