should build the icon theme
This commit is contained in:
parent
e844794e8a
commit
8378ba87c8
2 changed files with 103 additions and 64 deletions
|
|
@ -25,16 +25,24 @@ in {
|
||||||
dunst
|
dunst
|
||||||
polybar
|
polybar
|
||||||
i3-auto-layout
|
i3-auto-layout
|
||||||
|
xsettingsd
|
||||||
];
|
];
|
||||||
extraSessionCommands = ''
|
extraSessionCommands = ''
|
||||||
${pkgs.feh}/bin/feh --randomize --bg-fill ~/wallpapers/* 2>/dev/null || ${pkgs.feh}/bin/feh --bg-fill ${pkgs.nixos-artwork.wallpapers.nineish-dark-gray}/share/backgrounds/nixos/nineish-dark-gray.png &
|
${pkgs.feh}/bin/feh --randomize --bg-fill ~/wallpapers/* 2>/dev/null || ${pkgs.feh}/bin/feh --bg-fill ${pkgs.nixos-artwork.wallpapers.nineish-dark-gray}/share/backgrounds/nixos/nineish-dark-gray.png &
|
||||||
|
|
||||||
export GSETTINGS_SCHEMA_DIR="${pkgs.gsettings-desktop-schemas}/share/gsettings-schemas/${pkgs.gsettings-desktop-schemas.name}/glib-2.0/schemas"
|
export GSETTINGS_SCHEMA_DIR="${pkgs.gsettings-desktop-schemas}/share/gsettings-schemas/${pkgs.gsettings-desktop-schemas.name}/glib-2.0/schemas"
|
||||||
export XDG_DATA_DIRS="${pkgs.gsettings-desktop-schemas}/share:${pkgs.gtk3}/share/gsettings-schemas/${pkgs.gtk3.name}:${pkgs.tokyonight-gtk-theme}/share:${customPkgs.vivid-icons}/share:$XDG_DATA_DIRS"
|
export XDG_DATA_DIRS="${pkgs.gsettings-desktop-schemas}/share:${pkgs.gtk3}/share/gsettings-schemas/${pkgs.gtk3.name}:${pkgs.tokyonight-gtk-theme}/share:${customPkgs.vivid-icons}/share:${pkgs.hicolor-icon-theme}/share:$XDG_DATA_DIRS"
|
||||||
|
|
||||||
${pkgs.glib}/bin/gsettings set org.gnome.desktop.interface gtk-theme "Tokyonight-Dark" || echo "Failed to set GTK theme" > /tmp/theme-debug.log
|
${pkgs.glib}/bin/gsettings set org.gnome.desktop.interface gtk-theme "Tokyonight-Dark"
|
||||||
${pkgs.glib}/bin/gsettings set org.gnome.desktop.interface icon-theme "Vivid-Magna-Glassy-Dark-Icons" || ${pkgs.glib}/bin/gsettings set org.gnome.desktop.interface icon-theme "Papirus-Dark" || echo "Failed to set icon theme" > /tmp/theme-debug.log
|
${pkgs.glib}/bin/gsettings set org.gnome.desktop.interface icon-theme "Vivid-Magna-Glassy-Dark-Icons"
|
||||||
${pkgs.glib}/bin/gsettings set org.gnome.desktop.interface cursor-theme "capitaine-cursors" || echo "Failed to set cursor theme" > /tmp/theme-debug.log
|
${pkgs.glib}/bin/gsettings set org.gnome.desktop.interface cursor-theme "capitaine-cursors"
|
||||||
|
mkdir -p $HOME/.config
|
||||||
|
cat > $HOME/.config/xsettingsd << EOF
|
||||||
|
Net/ThemeName "Tokyonight-Dark"
|
||||||
|
Net/IconThemeName "Vivid-Magna-Glassy-Dark-Icons"
|
||||||
|
Gtk/CursorThemeName "capitaine-cursors"
|
||||||
|
EOF
|
||||||
|
${pkgs.xsettingsd}/bin/xsettingsd &
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -92,18 +100,18 @@ in {
|
||||||
[Settings]
|
[Settings]
|
||||||
gtk-application-prefer-dark-theme=1
|
gtk-application-prefer-dark-theme=1
|
||||||
gtk-theme-name=Tokyonight-Dark
|
gtk-theme-name=Tokyonight-Dark
|
||||||
gtk-icon-theme-name="Vivid-Magna-Glassy-Dark-Icons"
|
gtk-icon-theme-name=Vivid-Magna-Glassy-Dark-Icons
|
||||||
gtk-font-name=Clear Sans 10
|
gtk-font-name=Clear Sans 10
|
||||||
gtk-cursor-theme-name="capitaine-cursors"
|
gtk-cursor-theme-name=capitaine-cursors
|
||||||
gtk-cursor-theme-size=24
|
gtk-cursor-theme-size=24
|
||||||
'';
|
'';
|
||||||
"gtk-4.0/settings.ini".text = ''
|
"gtk-4.0/settings.ini".text = ''
|
||||||
[Settings]
|
[Settings]
|
||||||
gtk-application-prefer-dark-theme=1
|
gtk-application-prefer-dark-theme=1
|
||||||
gtk-theme-name=Tokyonight-Dark
|
gtk-theme-name=Tokyonight-Dark
|
||||||
gtk-icon-theme-name="Vivid-Magna-Glassy-Dark-Icons"
|
gtk-icon-theme-name=Vivid-Magna-Glassy-Dark-Icons
|
||||||
gtk-font-name=Clear Sans 10
|
gtk-font-name=Clear Sans 10
|
||||||
gtk-cursor-theme-name="capitaine-cursors"
|
gtk-cursor-theme-name=capitaine-cursors
|
||||||
gtk-cursor-theme-size=24
|
gtk-cursor-theme-size=24
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
@ -131,14 +139,22 @@ in {
|
||||||
capitaine-cursors
|
capitaine-cursors
|
||||||
tokyonight-gtk-theme
|
tokyonight-gtk-theme
|
||||||
nix-prefetch-git
|
nix-prefetch-git
|
||||||
|
hicolor-icon-theme
|
||||||
|
adwaita-icon-theme
|
||||||
|
xsettingsd
|
||||||
] ++ (with customPkgs; [
|
] ++ (with customPkgs; [
|
||||||
vivid-icons
|
vivid-icons
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
environment.pathsToLink = [
|
||||||
|
"/share/icons"
|
||||||
|
"/share/pixmaps"
|
||||||
|
];
|
||||||
|
|
||||||
services.xserver.desktopManager.session = [{
|
services.xserver.desktopManager.session = [{
|
||||||
name = "xfce+i3";
|
name = "xfce+i3";
|
||||||
start = ''
|
start = ''
|
||||||
export XDG_DATA_DIRS="${pkgs.tokyonight-gtk-theme}/share:${customPkgs.vivid-icons}/share:$XDG_DATA_DIRS"
|
export XDG_DATA_DIRS="${pkgs.tokyonight-gtk-theme}/share:${customPkgs.vivid-icons}/share:${pkgs.hicolor-icon-theme}/share:${pkgs.adwaita-icon-theme}/share:$XDG_DATA_DIRS"
|
||||||
${pkgs.xfce.xfce4-session}/bin/xfce4-session --with-ck-launch &
|
${pkgs.xfce.xfce4-session}/bin/xfce4-session --with-ck-launch &
|
||||||
${pkgs.i3-gaps}/bin/i3
|
${pkgs.i3-gaps}/bin/i3
|
||||||
'';
|
'';
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@
|
||||||
lib,
|
lib,
|
||||||
stdenv,
|
stdenv,
|
||||||
fetchFromGitHub,
|
fetchFromGitHub,
|
||||||
|
hicolor-icon-theme,
|
||||||
|
candy-icons,
|
||||||
}:
|
}:
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
pname = "vivid-icons";
|
pname = "vivid-icons";
|
||||||
|
|
@ -12,64 +14,85 @@ stdenv.mkDerivation {
|
||||||
rev = "fe8b8f1bdd3784dc838c125bb9e1b2d713f40e67";
|
rev = "fe8b8f1bdd3784dc838c125bb9e1b2d713f40e67";
|
||||||
sha256 = "UlZkxeWb2n5TexaQymeyEqAjKwDfonTXO2OYjICHl+U=";
|
sha256 = "UlZkxeWb2n5TexaQymeyEqAjKwDfonTXO2OYjICHl+U=";
|
||||||
};
|
};
|
||||||
buildInputs = [ ];
|
propagatedBuildInputs = [ hicolor-icon-theme candy-icons ];
|
||||||
|
dontBuild = true;
|
||||||
|
dontFixup = true;
|
||||||
|
dontUpdateIconCache = true;
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
echo "Source contents at root:"
|
|
||||||
ls -la .
|
|
||||||
mkdir -p $out/share/icons
|
mkdir -p $out/share/icons
|
||||||
cd "Vivid Icons Themes"
|
cd "Vivid Icons Themes"
|
||||||
echo "Contents of Vivid Icons Themes:"
|
|
||||||
ls -la .
|
|
||||||
for dir in Vivid-Dark-Icons Vivid-Glassy-Dark-Icons Vivid-Magna-Glassy-Dark-Icons; do
|
for dir in Vivid-Dark-Icons Vivid-Glassy-Dark-Icons Vivid-Magna-Glassy-Dark-Icons; do
|
||||||
if [ -d "$dir" ]; then
|
if [ -d "$dir" ]; then
|
||||||
echo "Processing: $dir"
|
dest_dir="$out/share/icons/$dir"
|
||||||
theme_name="$dir"
|
|
||||||
dest_dir="$out/share/icons/$theme_name"
|
|
||||||
mkdir -p "$dest_dir"
|
mkdir -p "$dest_dir"
|
||||||
find "$dir" -type d -regex ".*/[0-9]+" | while read -r size_dir; do
|
cp -r "$dir"/* "$dest_dir/" || true
|
||||||
size=$(basename "$size_dir")
|
mkdir -p "$dest_dir/actions/16" "$dest_dir/actions/22" "$dest_dir/actions/24" "$dest_dir/actions/32"
|
||||||
category=$(basename "$(dirname "$size_dir")")
|
mkdir -p "$dest_dir/status/16" "$dest_dir/status/22" "$dest_dir/status/24" "$dest_dir/status/32"
|
||||||
target_dir="$dest_dir/''${size}x''${size}/$category"
|
essential_icons=(
|
||||||
mkdir -p "$target_dir"
|
"help-about" "window-close" "gtk-apply" "go-previous" "go-next" "process-stop"
|
||||||
cp -rv "$size_dir"/* "$target_dir/"
|
"list-add" "list-remove" "edit-cut" "edit-copy" "edit-paste" "document-new"
|
||||||
done
|
"document-open" "document-save" "document-save-as" "folder-new" "folder"
|
||||||
echo "[Icon Theme]" > "$dest_dir/index.theme"
|
"edit-delete" "edit-find" "edit-redo" "edit-undo" "view-refresh" "system-run"
|
||||||
echo "Name=$theme_name" >> "$dest_dir/index.theme"
|
"dialog-ok" "dialog-cancel" "dialog-close" "dialog-error" "image-missing"
|
||||||
echo "Comment=$theme_name icons" >> "$dest_dir/index.theme"
|
)
|
||||||
directories=""
|
for size in 16 22 24 32; do
|
||||||
for size_dir in "$dest_dir"/*; do
|
mkdir -p "$dest_dir/actions/$size"
|
||||||
if [ -d "$size_dir" ]; then
|
mkdir -p "$dest_dir/status/$size"
|
||||||
size=$(basename "$size_dir") # e.g., "22x22"
|
for icon in ''${essential_icons[@]}; do
|
||||||
if [[ "$size" =~ ^[0-9]+x[0-9]+$ ]]; then
|
if [ ! -f "$dest_dir/actions/$size/$icon.svg" ] && [ ! -f "$dest_dir/actions/$size/$icon.png" ]; then
|
||||||
directories="$directories''${directories:+,}$size"
|
for candy_size in $size 16 22 24 32 48 64; do
|
||||||
echo "[$size]" >> "$dest_dir/index.theme"
|
for ext in svg png; do
|
||||||
echo "Size=''${size%%x*}" >> "$dest_dir/index.theme"
|
for category in actions status apps; do
|
||||||
echo "Context=Actions" >> "$dest_dir/index.theme"
|
if [ -f "${candy-icons}/share/icons/candy-icons/$candy_size/$category/$icon.$ext" ]; then
|
||||||
echo "Type=Fixed" >> "$dest_dir/index.theme"
|
ln -sf "${candy-icons}/share/icons/candy-icons/$candy_size/$category/$icon.$ext" "$dest_dir/actions/$size/$icon.$ext"
|
||||||
fi
|
break 3
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
if [ -z "$directories" ]; then
|
done
|
||||||
echo "No size dirs found for $theme_name, adding fallback"
|
done
|
||||||
directories="scalable"
|
|
||||||
echo "[scalable]" >> "$dest_dir/index.theme"
|
|
||||||
echo "Size=48" >> "$dest_dir/index.theme"
|
|
||||||
echo "Context=Actions" >> "$dest_dir/index.theme"
|
|
||||||
echo "Type=Scalable" >> "$dest_dir/index.theme"
|
|
||||||
fi
|
fi
|
||||||
echo "Directories=$directories" >> "$dest_dir/index.theme"
|
if [ ! -f "$dest_dir/status/$size/$icon.svg" ] && [ ! -f "$dest_dir/status/$size/$icon.png" ]; then
|
||||||
|
for candy_size in $size 16 22 24 32 48 64; do
|
||||||
|
for ext in svg png; do
|
||||||
|
for category in status actions apps; do
|
||||||
|
if [ -f "${candy-icons}/share/icons/candy-icons/$candy_size/$category/$icon.$ext" ]; then
|
||||||
|
ln -sf "${candy-icons}/share/icons/candy-icons/$candy_size/$category/$icon.$ext" "$dest_dir/status/$size/$icon.$ext"
|
||||||
|
break 3
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
done
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
done
|
||||||
|
if [ -f "$dest_dir/index.theme" ]; then
|
||||||
|
if grep -q "^Inherits=" "$dest_dir/index.theme"; then
|
||||||
|
sed -i 's/^Inherits=.*/Inherits=candy-icons,hicolor/' "$dest_dir/index.theme"
|
||||||
else
|
else
|
||||||
echo "Warning: $dir not found in Vivid Icons Themes"
|
echo "Inherits=candy-icons,hicolor" >> "$dest_dir/index.theme"
|
||||||
|
fi
|
||||||
|
if grep -q "^Name=" "$dest_dir/index.theme"; then
|
||||||
|
sed -i 's/^Name=.*/Name=Vivid-Magna-Glassy-Dark-Icons/' "$dest_dir/index.theme"
|
||||||
|
else
|
||||||
|
echo "Name=Vivid-Magna-Glassy-Dark-Icons" >> "$dest_dir/index.theme"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
cat > "$dest_dir/index.theme" << EOF
|
||||||
|
[Icon Theme]
|
||||||
|
Name=Vivid-Magna-Glassy-Dark-Icons
|
||||||
|
Comment=$dir Icon Theme
|
||||||
|
Inherits=candy-icons,hicolor
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
touch "$dest_dir/.icon-theme.cache"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
echo "Installed themes:"
|
|
||||||
ls -la $out/share/icons/
|
|
||||||
'';
|
'';
|
||||||
meta = with lib; {
|
meta = {
|
||||||
description = "Vivid Icons Theme";
|
description = "Vivid Icons Theme";
|
||||||
homepage = "https://github.com/L4ki/Vivid-Plasma-Themes";
|
homepage = "https://github.com/L4ki/Vivid-Plasma-Themes";
|
||||||
license = licenses.gpl3;
|
license = lib.licenses.gpl3;
|
||||||
platforms = platforms.all;
|
platforms = lib.platforms.all;
|
||||||
maintainers = with maintainers; [ "Cobray" ];
|
maintainers = [ "Cobray" ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue