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:
parent
7ece535639
commit
c95631c557
40
gnome/default.nix
Normal file
40
gnome/default.nix
Normal 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;
|
||||
};
|
||||
|
||||
}
|
12
gnome/share/gnome-background-properties/template.xml.in
Normal file
12
gnome/share/gnome-background-properties/template.xml.in
Normal 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>
|
Loading…
Reference in a new issue