Skip to content

Instantly share code, notes, and snippets.

@bulletmark
Last active September 1, 2023 00:50
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bulletmark/0b278a1ce321b960ad3fccb2d4634b55 to your computer and use it in GitHub Desktop.
Save bulletmark/0b278a1ce321b960ad3fccb2d4634b55 to your computer and use it in GitHub Desktop.
Bash script to extract GNOME shell javascript files
#!/bin/bash
if [[ $# -ne 1 ]]; then
echo "usage $0 dir" >&2
exit 1
fi
dir="$1"
if [[ -e $dir ]]; then
echo "Error: $dir already exists" >&2
exit 1
fi
mkdir -p "$dir"
cd "$dir"
GS=/usr/lib/gnome-shell/libgnome-shell.so
for r in $(gresource list $GS); do
t="${r/#\/org\/gnome\/shell\/}"
mkdir -p $(dirname $t)
echo Extracting $t
gresource extract $GS $r >$t
done
echo
echo "Now add the following to /etc/environment and restart gnome-shell"
echo "if you want to run with these extracted source files."
echo "GNOME_SHELL_JS=$PWD"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment