From 27d8dca6ab3ebc8f909552086da7f4f6ff9c1ad6 Mon Sep 17 00:00:00 2001 From: Robert Tari Date: Mon, 22 Mar 2021 10:43:31 +0100 Subject: Whitespace fix --- tests/tst_utils.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/tst_utils.cpp b/tests/tst_utils.cpp index d7a4946..c38629f 100644 --- a/tests/tst_utils.cpp +++ b/tests/tst_utils.cpp @@ -22,15 +22,15 @@ extern "C" { } class XdgCurrentDesktopUtilsTest : public ::testing::Test -{ -public: - XdgCurrentDesktopUtilsTest() {} +{ +public: + XdgCurrentDesktopUtilsTest() {} - void SetUp() { + void SetUp() { unsetenv("XDG_CURRENT_DESKTOP"); } - void TearDown() { + void TearDown() { unsetenv("XDG_CURRENT_DESKTOP"); } }; -- cgit v1.2.3 From cd6d7b26ef7a82c52e0836b120720cba0636168e Mon Sep 17 00:00:00 2001 From: Robert Tari Date: Mon, 22 Mar 2021 10:45:38 +0100 Subject: Add Budgie desktop support --- src/utils.c | 6 ++++++ src/utils.h | 2 ++ tests/tst_utils.cpp | 6 ++++++ 3 files changed, 14 insertions(+) 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()); +} -- cgit v1.2.3 From 18179a11648f23599e7c3a27d56680884d7c0f0f Mon Sep 17 00:00:00 2001 From: Robert Tari Date: Mon, 22 Mar 2021 10:47:31 +0100 Subject: Add us to the copyright headers --- src/utils.c | 1 + src/utils.h | 1 + tests/tst_utils.cpp | 1 + 3 files changed, 3 insertions(+) diff --git a/src/utils.c b/src/utils.c index 0a419fd..152f226 100644 --- a/src/utils.c +++ b/src/utils.c @@ -1,5 +1,6 @@ /* * Copyright 2021 Marius Gripsgard + * Copyright 2021 Robert Tari * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License version 3, as published diff --git a/src/utils.h b/src/utils.h index 308e60f..60c5ed4 100644 --- a/src/utils.h +++ b/src/utils.h @@ -1,5 +1,6 @@ /* * Copyright 2021 Marius Gripsgard + * Copyright 2021 Robert Tari * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License version 3, as published diff --git a/tests/tst_utils.cpp b/tests/tst_utils.cpp index b1e676d..503afc9 100644 --- a/tests/tst_utils.cpp +++ b/tests/tst_utils.cpp @@ -1,5 +1,6 @@ /* * Copyright 2021 Marius Gripsgard + * Copyright 2021 Robert Tari * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License version 3, as published -- cgit v1.2.3