summary refs log tree commit diff
path: root/pkgs/build-support/icon-conv-tools/bin/icoFileToHiColorTheme
blob: 192f3bb54c29a1605f914cd66e5f453371a3ee42 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh

SCRIPT_DIR=`cd "$(dirname $0)" && pwd`

# The '*.ico' file that needs to be converted (e.g.: "./my/path/to/file.ico").
icoFile="$1"

# The desired name of created icon files without extension. (e.g.: "my-app").
targetIconName="$2"

# The output directory where the free desktop hierarchy will be created.
# (e.g.: "./path/to/my/out" or usually in nix "$out"). Note that the
# whole directory hierarchy to the icon will be created in the specified
# output directory (e.g.: "$out/share/icons/hicolor/48x48/apps/my-app.png").
out="$3"

# An optional temp directory location (e.g.: ./tmp). If not specified
# a random '/tmp' directory will be created.
tmp="$4"

$SCRIPT_DIR/extractWinRscIconsToStdFreeDesktopDir.sh \
  "$icoFile" \
  '[^\.]+_[0-9]+_([0-9]+x[0-9]+)x[0-9]+\.png' \
  '\1' \
  '([^\.]+).+' \
  "$targetIconName" \
  "$out" \
  "$tmp"