Unverified Commit d9293111 authored by Bobby Rong's avatar Bobby Rong Committed by GitHub
Browse files

Merge pull request #227526 from FedericoSchonborn/more-budgie

budgie: add plugin support, update default settings
parents 304b0c53 45d0a21c
Loading
Loading
Loading
Loading
+37 −3
Original line number Diff line number Diff line
@@ -12,10 +12,37 @@ let
    inherit (cfg) extraGSettingsOverrides extraGSettingsOverridePackages;
    inherit nixos-background-dark nixos-background-light;
  };

  nixos-background-info = pkgs.writeTextFile {
    name = "nixos-background-info";
    text = ''
      <?xml version="1.0"?>
      <!DOCTYPE wallpapers SYSTEM "gnome-wp-list.dtd">
      <wallpapers>
        <wallpaper deleted="false">
          <name>Nineish</name>
          <filename>${nixos-background-light.gnomeFilePath}</filename>
          <options>zoom</options>
          <shade_type>solid</shade_type>
          <pcolor>#d1dcf8</pcolor>
          <scolor>#e3ebfe</scolor>
        </wallpaper>
        <wallpaper deleted="false">
          <name>Nineish Dark Gray</name>
          <filename>${nixos-background-dark.gnomeFilePath}</filename>
          <options>zoom</options>
          <shade_type>solid</shade_type>
          <pcolor>#151515</pcolor>
          <scolor>#262626</scolor>
        </wallpaper>
      </wallpapers>
    '';
    destination = "/share/gnome-background-properties/nixos.xml";
  };
in {
  options = {
    services.xserver.desktopManager.budgie = {
      enable = mkEnableOption (mdDoc "Budgie desktop");
      enable = mkEnableOption (mdDoc "the Budgie desktop");

      sessionPath = mkOption {
        description = mdDoc "Additional list of packages to be added to the session search path. Useful for GSettings-conditional autostart.";
@@ -35,6 +62,12 @@ in {
        type = with types; listOf path;
        default = [];
      };

      extraPlugins = mkOption {
        description = mdDoc "Extra plugins for the Budgie desktop";
        type = with types; listOf package;
        default = [];
      };
    };

    environment.budgie.excludePackages = mkOption {
@@ -76,7 +109,7 @@ in {
        # Budgie Desktop.
        budgie.budgie-backgrounds
        budgie.budgie-control-center
        budgie.budgie-desktop
        (budgie.budgie-desktop-with-plugins.override { plugins = cfg.extraPlugins; })
        budgie.budgie-desktop-view
        budgie.budgie-screensaver

@@ -106,6 +139,7 @@ in {
          # Desktop themes.
          qogir-theme
          qogir-icon-theme
          nixos-background-info

          # Default settings.
          nixos-gsettings-overrides
+6 −1
Original line number Diff line number Diff line
@@ -20,7 +20,12 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: {
      };
    };

    services.xserver.desktopManager.budgie.enable = true;
    services.xserver.desktopManager.budgie = {
      enable = true;
      extraPlugins = [
        pkgs.budgie.budgie-analogue-clock-applet
      ];
    };
  };

  testScript = { nodes, ... }:
+44 −0
Original line number Diff line number Diff line
{ lib
, stdenv
, fetchFromGitHub
, meson
, ninja
, pkg-config
, vala
, budgie-desktop
, gtk3
, libpeas
}:

stdenv.mkDerivation rec {
  pname = "budgie-analogue-clock-applet";
  version = "2.0";

  src = fetchFromGitHub {
    owner = "samlane-ma";
    repo = "analogue-clock-applet";
    rev = "v${version}";
    hash = "sha256-yId5bbdmELinBmZ5eISa5hQSYkeZCkix2FJ287GdcCs=";
  };

  nativeBuildInputs = [
    meson
    ninja
    pkg-config
    vala
  ];

  buildInputs = [
    budgie-desktop
    gtk3
    libpeas
  ];

  meta = with lib; {
    description = "Analogue Clock Applet for the Budgie desktop";
    homepage = "https://github.com/samlane-ma/analogue-clock-applet";
    license = licenses.gpl3Plus;
    maintainers = [ maintainers.federicoschonborn ];
    platforms = platforms.linux;
  };
}
+4 −0
Original line number Diff line number Diff line
@@ -46,6 +46,10 @@ stdenv.mkDerivation rec {
    sha256 = "sha256-ww65J9plixbxFza6xCfaz1WYtT9giKkLVH1XYxH41+0=";
  };

  patches = [
    ./plugins.patch
  ];

  nativeBuildInputs = [
    docbook-xsl-nons
    gtk-doc
+66 −0
Original line number Diff line number Diff line
diff --git a/src/panel/plugin_manager.vala b/src/panel/plugin_manager.vala
index d3cdb65c..9d569bd1 100644
--- a/src/panel/plugin_manager.vala
+++ b/src/panel/plugin_manager.vala
@@ -40,10 +40,26 @@ namespace Budgie {
 			}
 
 			/* System path */
-			var dir = Environment.get_user_data_dir();
-			engine.add_search_path(Budgie.MODULE_DIRECTORY, Budgie.MODULE_DATA_DIRECTORY);
+			var libdir = Environment.get_variable("BUDGIE_PLUGIN_LIBDIR");
+			if (libdir != null) {
+				debug("BUDGIE_PLUGIN_LIBDIR is set to %s", libdir);
+			} else {
+				debug("BUDGIE_PLUGIN_LIBDIR is unset, defaulting to %s", Budgie.MODULE_DIRECTORY);
+				libdir = Budgie.MODULE_DIRECTORY;
+			}
+
+			var datadir = Environment.get_variable("BUDGIE_PLUGIN_DATADIR");
+			if (datadir != null) {
+				debug("BUDGIE_PLUGIN_DATADIR is set to %s", datadir);
+			} else {
+				debug("BUDGIE_PLUGIN_DATADIR is unset, defaulting to %s", Budgie.MODULE_DATA_DIRECTORY);
+				datadir = Budgie.MODULE_DATA_DIRECTORY;
+			}
+
+			engine.add_search_path(libdir, datadir);
 
 			/* User path */
+			var dir = Environment.get_user_data_dir();
 			var user_mod = Path.build_path(Path.DIR_SEPARATOR_S, dir, "budgie-desktop", "plugins");
 			var hdata = Path.build_path(Path.DIR_SEPARATOR_S, dir, "budgie-desktop", "data");
 			engine.add_search_path(user_mod, hdata);
diff --git a/src/raven/plugin_manager.vala b/src/raven/plugin_manager.vala
index b0814693..d671109a 100644
--- a/src/raven/plugin_manager.vala
+++ b/src/raven/plugin_manager.vala
@@ -51,10 +51,26 @@ namespace Budgie {
 			}
 
 			/* System path */
-			var dir = Environment.get_user_data_dir();
-			engine.add_search_path(Budgie.RAVEN_PLUGIN_LIBDIR, Budgie.RAVEN_PLUGIN_DATADIR);
+			var libdir = Environment.get_variable("RAVEN_PLUGIN_LIBDIR");
+			if (libdir != null) {
+				debug("RAVEN_PLUGIN_LIBDIR is set to %s", libdir);
+			} else {
+				debug("RAVEN_PLUGIN_LIBDIR is unset, defaulting to %s", Budgie.RAVEN_PLUGIN_LIBDIR);
+				libdir = Budgie.RAVEN_PLUGIN_LIBDIR;
+			}
+
+			var datadir = Environment.get_variable("RAVEN_PLUGIN_DATADIR");
+			if (datadir != null) {
+				debug("RAVEN_PLUGIN_DATADIR is set to %s", datadir);
+			} else {
+				debug("RAVEN_PLUGIN_DATADIR is unset, defaulting to %s", Budgie.RAVEN_PLUGIN_DATADIR);
+				datadir = Budgie.RAVEN_PLUGIN_DATADIR;
+			}
+
+			engine.add_search_path(libdir, datadir);
 
 			/* User path */
+			var dir = Environment.get_user_data_dir();
 			var user_mod = Path.build_path(Path.DIR_SEPARATOR_S, dir, "budgie-desktop", "raven-plugins");
 			var hdata = Path.build_path(Path.DIR_SEPARATOR_S, dir, "budgie-desktop", "raven-data");
 			engine.add_search_path(user_mod, hdata);
Loading