Last active
September 1, 2023 00:50
-
-
Save bulletmark/0b278a1ce321b960ad3fccb2d4634b55 to your computer and use it in GitHub Desktop.
Bash script to extract GNOME shell javascript files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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