Skip to content
This repository has been archived by the owner on May 14, 2020. It is now read-only.

Commit

Permalink
autotools fixes (#155)
Browse files Browse the repository at this point in the history
* Fix image path names in GTK+3 gresource files

Turns out it cares about the whole path, not just the filename, even
if you embed the pixdata.

* Fix change_color.sh following autotools changes

* Add --jobs option to change_color.sh to pass to make

This defaults to nproc.

* Update HACKING document following autotools changes

* Note in README which engines require sassc, optipng, and inkscape
  • Loading branch information
chewi authored and fossfreedom committed Oct 21, 2018
1 parent a8a66c0 commit 5444ac7
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 19 deletions.
14 changes: 5 additions & 9 deletions HACKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,24 @@ This theme uses node-sass/libsass to process the various .scss files. Never edit

* Go to `common/gtk-2.0`

* The colors and includes are defined in `gtkrc`, `gtkrc-dark` and `gtkrc-darker` for each theme variant
* The colors and includes are defined in `light/gtkrc`, `dark/gtkrc` and `darker/gtkrc` for each theme variant

* `main.rc` contains the major part of the theme

* `panel.rc` contains the panel styling for Xfce and MATE

* `apps.rc` contains some application specific rules

Because this theme is heavily based on the pixmap engine, a lot of the styling comes from the images in the `assets` and `assets-dark` folders. Don't edit these images directly. See the next section.
Because this theme is heavily based on the pixmap engine, a lot of the styling comes from the images in the `light/assets` and `dark/assets` folders. Don't edit these images directly. See the next section.

--

#### Editing the images for the GTK 2 and GTK 3 themes

* Go to the `common/gtk-2.0` or `common/gtk-3.0/$gtk-version` directory
* Go to the `common/gtk-2.0/light`, `common/gtk-2.0/dark`, or `common/gtk-3.0/$gtk-version` directory.

* Open the `assets.svg` or `assets-dark.svg` file in inkscape. Each object in the .svg file corresponds to an image in the `assets` or `assets-dark` folder
* Open the `assets.svg` file in inkscape. Each object in the .svg file corresponds to an image in the `assets` folder.

* Find the object you want to edit and make your changes. Important: Don't change the object id!

* Save `assets.svg` and delete the images corresponding to the edited .svg objects from the `assets` folder (or just delete everything in the `assets` folder)

* Run `./render-assets.sh` or `./render-dark-assets.sh` from a terminal

* N.B. If you are making color changes then remove the contents of the folders gtk-2.0/assets/* gtk-2.0/assets-dark and the assets folder under the GTK+3 folder that the theme is compiled for
* Save `assets.svg` and run `make` (or `make -j$(nproc)` if you're in a hurry) from a terminal in the parent directory.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ It is strongly encouraged to submit pull-requests to suggest fixes and enhanceme
To build the theme the following packages are required
* `autoconf`
* `automake`
* `sassc`
* `sassc` for GTK 3, Cinnamon, or GNOME Shell
* `pkg-config` or `pkgconfig` for Fedora
* `git` to clone the source directory
* `optipng`
* `inkscape`
* `optipng` for GTK 2, GTK 3, or XFWM
* `inkscape` for GTK 2, GTK 3, or XFWM

The following packages are optionally required
* `gnome-shell`for auto-detecting the GNOME Shell version
Expand Down
15 changes: 10 additions & 5 deletions change_color.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,18 @@ is_dark() {


print_usage() {
echo "usage: $0 [-o OUTPUT_THEME_NAME] [-a AUTOGEN_OPTS] PATH_TO_PRESET"
echo "usage: $0 [-o OUTPUT_THEME_NAME] [-a AUTOGEN_OPTS] [-j JOBS] PATH_TO_PRESET"
echo
echo "examples:"
# shellcheck disable=SC2028 # This is meant to be usage text.
echo " $0 --output my-theme-name <(echo -e \"BG=d8d8d8\\nFG=101010\\nMENU_BG=3c3c3c\\nMENU_FG=e6e6e6\\nSEL_BG=ad7fa8\\nSEL_FG=ffffff\\nTXT_BG=ffffff\\nTXT_FG=1a1a1a\\nBTN_BG=f5f5f5\\nBTN_FG=111111\\n\")"
echo " $0 ../colors/retro/twg"
echo " $0 --autogen-opts '--disable-cinnamon --disable-gnome-shell' ../colors/retro/clearlooks"
echo " $0 --autogen-opts '--disable-cinnamon --disable-gnome-shell' --jobs 4 ../colors/retro/clearlooks"
exit 1
}

AUTOGEN_OPTS=""
unset JOBS

while [[ "$#" -gt 0 ]]; do
case "$1" in
Expand All @@ -44,6 +45,10 @@ while [[ "$#" -gt 0 ]]; do
-a|--autogen-opts)
AUTOGEN_OPTS="${2}"
shift
;;
-j|--jobs)
JOBS="${2}"
shift
;;
*)
if [[ "$1" == -* ]] || [[ "${THEME-}" ]]; then
Expand Down Expand Up @@ -223,8 +228,8 @@ for template_file in $(find ./common -name '*.thpl') ; do
done

ASSETS_FILES=(
'./common/gtk-2.0/assets.svg'
'./common/gtk-2.0/assets-dark.svg'
'./common/gtk-2.0/light/assets.svg'
'./common/gtk-2.0/dark/assets.svg'
'./common/gtk-3.0/3.18/assets.svg'
'./common/gtk-3.0/3.20/assets.svg'
)
Expand Down Expand Up @@ -292,7 +297,7 @@ fi
echo "== Making theme..."
mkdir distrib
./autogen.sh --prefix=$(readlink -e ./distrib/) --disable-light --disable-dark ${AUTOGEN_OPTS}
make install
make --jobs="${JOBS:-$(nproc || echo 1)}" install
echo

echo
Expand Down
7 changes: 5 additions & 2 deletions common/gtk-3.0/3.20/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@ dark/gtk-main-dark.css: | dark
%/gtk.css %/gtk-dark.css: | %
echo '@import url("resource:///org/gnome/arc-theme/$(subst gtk,gtk-main,$(notdir $@))");' > "$@"

%/gtk.gresource.xml: | %
echo "<?xml version='1.0' encoding='UTF-8'?><gresources><gresource prefix='/org/gnome/arc-theme'>$(patsubst %,<file preprocess='to-pixdata'>../%</file>,$(normal) $(hidpi))<file>gtk-main.css</file>$(if $(filter $(dir $@),dark/),,<file>gtk-main-dark.css</file>)</gresource></gresources>" > "$@"
%/assets: | %
(cd "$(dir $@)" && $(LN_S) ../assets assets)

%/gtk.gresource.xml: | %/assets
echo "<?xml version='1.0' encoding='UTF-8'?><gresources><gresource prefix='/org/gnome/arc-theme'>$(patsubst %,<file preprocess='to-pixdata'>%</file>,$(normal) $(hidpi))<file>gtk-main.css</file>$(if $(filter $(dir $@),dark/),,<file>gtk-main-dark.css</file>)</gresource></gresources>" > "$@"

%/gtk.gresource: %/gtk.gresource.xml %/gtk-main.css %/gtk-main-dark.css $(normal) $(hidpi)
glib-compile-resources --sourcedir="$(dir $<)" --target="$@" "$<"
Expand Down
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ AC_INIT(
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([no-dist-gzip dist-xz foreign])
AC_PROG_LN_S
AC_PROG_MKDIR_P

ARC_ENABLE([LIGHT], [light], [Arc Light], [disable])
Expand Down

0 comments on commit 5444ac7

Please sign in to comment.