Merge pull request #227526 from FedericoSchonborn/more-budgie

budgie: add plugin support, update default settings
This commit is contained in:
Bobby Rong 2023-04-26 11:11:24 +08:00 committed by GitHub
commit d9293111a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 216 additions and 9 deletions

View file

@ -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,12 +109,12 @@ 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
# Required by the Budgie Desktop session.
(gnome.gnome-session.override {gnomeShellSupport = false;})
(gnome.gnome-session.override { gnomeShellSupport = false; })
# Required by Budgie Menu.
gnome-menus
@ -106,6 +139,7 @@ in {
# Desktop themes.
qogir-theme
qogir-icon-theme
nixos-background-info
# Default settings.
nixos-gsettings-overrides

View file

@ -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, ... }:

View file

@ -0,0 +1,44 @@
{ 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;
};
}

View file

@ -46,6 +46,10 @@ stdenv.mkDerivation rec {
sha256 = "sha256-ww65J9plixbxFza6xCfaz1WYtT9giKkLVH1XYxH41+0=";
};
patches = [
./plugins.patch
];
nativeBuildInputs = [
docbook-xsl-nons
gtk-doc

View file

@ -0,0 +1,66 @@
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);

View file

@ -0,0 +1,53 @@
{ lib
, stdenv
, glib
, xorg
, wrapGAppsHook
, budgie-desktop
, plugins ? []
}:
stdenv.mkDerivation {
pname = "${budgie-desktop.pname}-with-plugins";
inherit (budgie-desktop) version;
src = null;
paths = [
budgie-desktop
] ++ plugins;
passAsFile = [ "paths" ];
nativeBuildInputs = [
glib
wrapGAppsHook
];
buildInputs = lib.forEach plugins (plugin: plugin.buildInputs) ++ plugins;
dontUnpack = true;
dontConfigure = true;
dontBuild = true;
preferLocalBuild = true;
allowSubstitutes = false;
installPhase = ''
mkdir -p $out
for i in $(cat $pathsPath); do
${xorg.lndir}/bin/lndir -silent $i $out
done
'';
preFixup = ''
gappsWrapperArgs+=(
--set BUDGIE_PLUGIN_LIBDIR "$out/lib/budgie-desktop/plugins"
--set BUDGIE_PLUGIN_DATADIR "$out/share/budgie-desktop/plugins"
--set RAVEN_PLUGIN_LIBDIR "$out/lib/budgie-desktop/raven-plugins"
--set RAVEN_PLUGIN_DATADIR "$out/share/budgie-desktop/raven-plugins"
)
'';
inherit (budgie-desktop) meta;
}

View file

@ -31,24 +31,23 @@ let
font-name="Noto Sans 10"
document-font-name="Noto Sans 10"
monospace-font-name="Hack 10"
enable-hot-corners=true
[org.gnome.desktop.wm.preferences:Budgie]
titlebar-font="Noto Sans Bold 10"
[org.gnome.mutter:Budgie]
workspaces-only-on-primary=true
[com.solus-project.budgie-menu:Budgie]
use-default-menu-icon=true
[com.solus-project.budgie-panel:Budgie]
dark-theme=false
builtin-theme=false
[com.solus-project.icon-tasklist:Budgie]
pinned-launchers=["nemo.desktop", "vlc.desktop", "mate-terminal.desktop"]
pinned-launchers=["nemo.desktop", "firefox.desktop", "vlc.desktop"]
[org.buddiesofbudgie.budgie-desktop-view:Budgie]
show=true
click-policy="double"
show-active-mounts=true
terminal="${mate.mate-terminal}/bin/mate-terminal"
${extraGSettingsOverrides}

View file

@ -1,10 +1,12 @@
{ lib, pkgs }:
lib.makeScope pkgs.newScope (self: with self; {
budgie-analogue-clock-applet = callPackage ./budgie-analogue-clock-applet { };
budgie-backgrounds = callPackage ./budgie-backgrounds { };
budgie-control-center = callPackage ./budgie-control-center { };
budgie-desktop = callPackage ./budgie-desktop { };
budgie-desktop-view = callPackage ./budgie-desktop-view { };
budgie-desktop-with-plugins = callPackage ./budgie-desktop/wrapper.nix { };
budgie-gsettings-overrides = callPackage ./budgie-gsettings-overrides { };
budgie-screensaver = callPackage ./budgie-screensaver { };
})