Packaging/Icons/zh: Difference between revisions
Appearance
Created page with "== 应用图标 ==" |
Created page with "应用图标应该被安装于 <code>$out/share/icons/hicolor</code>。" Tags: Mobile edit Mobile web edit |
||
| Line 2: | Line 2: | ||
== 应用图标 == | == 应用图标 == | ||
应用图标应该被安装于 <code>$out/share/icons/hicolor</code>。 | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
Revision as of 18:56, 28 August 2025
应用图标
应用图标应该被安装于 $out/share/icons/hicolor。
Example code for the now outdated scribus v1.4 app:
{ lib
, stdenv
, fetchurl
, imagemagick
}:
let
icon = fetchurl {
url = "https://gist.githubusercontent.com/ejpcmac/a74b762026c9bc4000be624c3d085517/raw/18edc497c5cb6fdeef1c8aede37a0ee68413f9d3/scribus-icon-centered.svg";
sha256 = "0hq3i7c2l50445an9glhhg47kj26y16svfajc6naqn307ph9vzc3";
};
in
stdenv.mkDerivation rec {
pname = "scribus";
nativeBuildInputs = [
imagemagick # convert
];
# ...
postInstall = ''
for i in 16 24 48 64 96 128 256 512; do
mkdir -p $out/share/icons/hicolor/''${i}x''${i}/apps
convert -background none -resize ''${i}x''${i} ${icon} $out/share/icons/hicolor/''${i}x''${i}/apps/${pname}.png
done
'';
}
-background none will create transparent icons.
Alternative: -background white.
See also
Another example handling icons obsidian.