1
0
Fork 0
mirror of https://github.com/NixOS/nixos-artwork synced 2024-10-18 00:06:24 -04:00

Add a nix for creating gnome backgrounds

This commit is contained in:
Luca Bruno 2014-12-13 17:15:15 +01:00
parent 7ece535639
commit c95631c557
2 changed files with 52 additions and 0 deletions

40
gnome/default.nix Normal file
View file

@ -0,0 +1,40 @@
{ pkgs }:
rec {
mkBackgroundProperties = { backgroundName, backgroundFile }:
pkgs.substituteAll {
name = "${backgroundName}.xml";
src = ./share/gnome-background-properties/template.xml.in;
inherit backgroundName backgroundFile;
};
mkBackgroundOverride = { name, background }:
pkgs.writeTextFile {
inherit name;
destination = "/share/gsettings-schemas/${name}/org.gnome.desktop.background.nixos.gschema.override";
text = ''
[org.gnome.desktop.background]
picture-uri='file://${background}'
'';
};
mkBackground = { backgroundName, backgroundFile }: rec {
properties = mkBackgroundProperties {
inherit backgroundName backgroundFile;
};
gsettings = mkBackgroundOverride {
name = "nixos-${backgroundName}-background";
background = properties;
};
};
gnomeDark = mkBackground {
backgroundName = "Gnome_Dark";
backgroundFile = ./share/backgrounds/gnome/Gnome_Dark.jpg;
};
}

View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE wallpapers SYSTEM "gnome-wp-list.dtd">
<wallpapers>
<wallpaper deleted="false">
<name>@backgroundName@</name>
<filename>@backgroundFile@</filename>
<options>zoom</options>
<shade_type>solid</shade_type>
<pcolor>#ffffff</pcolor>
<scolor>#000000</scolor>
</wallpaper>
</wallpapers>