aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/utils.c6
-rw-r--r--src/utils.h2
-rw-r--r--tests/tst_utils.cpp6
3 files changed, 14 insertions, 0 deletions
diff --git a/src/utils.c b/src/utils.c
index 38ad1d8..0a419fd 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -82,6 +82,12 @@ is_pantheon ()
return is_xdg_current_desktop(DESKTOP_PANTHEON);
}
+gboolean
+is_budgie ()
+{
+ return is_xdg_current_desktop(DESKTOP_BUDGIE);
+}
+
// Bit of a hacky way? should use xdg open
char *
find_browser ()
diff --git a/src/utils.h b/src/utils.h
index 52e491f..308e60f 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -25,6 +25,7 @@
#define DESKTOP_GNOME "GNOME"
#define DESKTOP_XFCE "XFCE"
#define DESKTOP_PANTHEON "PANTHEON"
+#define DESKTOP_BUDGIE "Budgie"
gboolean is_lomiri();
gboolean is_unity();
@@ -32,6 +33,7 @@ gboolean is_gnome();
gboolean is_mate();
gboolean is_xfce();
gboolean is_pantheon();
+gboolean is_budgie();
gboolean execute_command(const gchar * cmd);
gboolean open_url(const gchar * url);
diff --git a/tests/tst_utils.cpp b/tests/tst_utils.cpp
index c38629f..b1e676d 100644
--- a/tests/tst_utils.cpp
+++ b/tests/tst_utils.cpp
@@ -72,3 +72,9 @@ TEST_F(XdgCurrentDesktopUtilsTest, isPantheon)
setenv("XDG_CURRENT_DESKTOP", "PANTHEON", 1);
EXPECT_TRUE(is_pantheon());
}
+TEST_F(XdgCurrentDesktopUtilsTest, isBudgie)
+{
+ EXPECT_FALSE(is_budgie());
+ setenv("XDG_CURRENT_DESKTOP", "Budgie:GNOME", 1);
+ EXPECT_TRUE(is_budgie());
+}