1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-04-29 15:19:44 +02:00
audacity/images/degimpify.sh
Emily Mabrey cabd66d8e7
Move and update degimpify script(s)
* Move and rename `degimpify.sh` script to make it easier to find and use the `degimpify` script.
* Make `degimpify.sh` script use `sed` in place.
* Make `degimpify.sh` script use default directories if none are provided.
* Make `degimpify.sh` script support processing all XPM (Pixmap) files in multiple directories.

Signed-off-by: Emily Mabrey <emabrey@tenacityaudio.org>
Reference-to: https://github.com/tenacityteam/tenacity/pull/407
2021-07-31 00:13:24 -04:00

27 lines
691 B
Bash

#!/bin/bash
# Run this script on a directory to "degimpify" all XPM files
# within that directory (meaning any file ending with .XPM)
#
# If you run this script with no arguments, it uses the default
# directories, which are the original three directories that were
# being "degimpified" pre-fork.
shopt -s nullglob
input_dirs="$*"
if [ $# -eq 0 ]; then
input_dirs[0]="./EditButtons"
input_dirs[1]="./TranscriptionImages"
input_dirs[2]="./ControlButtons"
fi
for dir in "${input_dirs[@]}"
do
for xpm_file in "${dir}"/*.xpm; do
echo "Degimpify: ${xpm_file}"
sed -e 's/\_xpm\[\]/\[\]/' -e 's/^static char \*/static const char \*/' -i "$xpm_file"
done
done