aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRobert Tari <robert@tari.in>2021-05-25 15:14:26 +0200
committerRobert Tari <robert@tari.in>2021-05-25 15:14:26 +0200
commit43bbe9bc01ec31856bfadece8630b5f021e11129 (patch)
tree2c5690cb7b928384fb3c2e79c2a7f5ee556d4b56 /src
parent3989df8c9102fe761c1815fa4be2d8414d766e55 (diff)
parent9fc7eaadbf24f1091b89b1c4c6bda382456b7537 (diff)
downloadlibayatana-common-43bbe9bc01ec31856bfadece8630b5f021e11129.tar.gz
libayatana-common-43bbe9bc01ec31856bfadece8630b5f021e11129.tar.bz2
libayatana-common-43bbe9bc01ec31856bfadece8630b5f021e11129.zip
Merge branch 'sunweaver-pr/provide-have-desktopenv-program-functions'
Attributes GH PR #21: https://github.com/AyatanaIndicators/libayatana-common/pull/21
Diffstat (limited to 'src')
-rw-r--r--src/utils.c55
-rw-r--r--src/utils.h7
2 files changed, 62 insertions, 0 deletions
diff --git a/src/utils.c b/src/utils.c
index b5a9690..d735172 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -89,6 +89,61 @@ ayatana_common_utils_is_budgie ()
return is_xdg_current_desktop(DESKTOP_BUDGIE);
}
+gboolean
+ayatana_common_utils_have_unity_program (const gchar *program)
+{
+ if (!ayatana_common_utils_is_unity())
+ return FALSE;
+
+ return ayatana_common_utils_have_program(program);
+}
+
+gboolean
+ayatana_common_utils_have_gnome_program (const gchar *program)
+{
+ if (!ayatana_common_utils_is_gnome())
+ return FALSE;
+
+ return ayatana_common_utils_have_program(program);
+}
+
+gboolean
+ayatana_common_utils_have_mate_program (const gchar *program)
+{
+ if (!ayatana_common_utils_is_mate())
+ return FALSE;
+
+ return ayatana_common_utils_have_program(program);
+}
+
+gboolean
+ayatana_common_utils_have_xfce_program (const gchar *program)
+{
+ if (!ayatana_common_utils_is_xfce())
+ return FALSE;
+
+ return ayatana_common_utils_have_program(program);
+}
+
+gboolean
+ayatana_common_utils_have_pantheon_program (const gchar *program)
+{
+ if (!ayatana_common_utils_is_pantheon())
+ return FALSE;
+
+ return ayatana_common_utils_have_program(program);
+}
+
+gboolean
+ayatana_common_utils_have_budgie_program (const gchar *program)
+{
+ if (!ayatana_common_utils_is_budgie())
+ return FALSE;
+
+ return ayatana_common_utils_have_program(program);
+}
+
+
// Bit of a hacky way? should use xdg open
char *
find_browser ()
diff --git a/src/utils.h b/src/utils.h
index 7301499..0fa643b 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -36,6 +36,13 @@ gboolean ayatana_common_utils_is_xfce();
gboolean ayatana_common_utils_is_pantheon();
gboolean ayatana_common_utils_is_budgie();
+gboolean ayatana_common_utils_have_unity_program (const gchar *program);
+gboolean ayatana_common_utils_have_gnome_program (const gchar *program);
+gboolean ayatana_common_utils_have_mate_program (const gchar *program);
+gboolean ayatana_common_utils_have_xfce_program (const gchar *program);
+gboolean ayatana_common_utils_have_pantheon_program (const gchar *program);
+gboolean ayatana_common_utils_have_budgie_program (const gchar *program);
+
gboolean ayatana_common_utils_execute_command(const gchar * cmd);
gboolean ayatana_common_utils_open_url(const gchar * url);
gboolean ayatana_common_utils_have_program(const gchar * program);