2026-10-13 · 94a7408
Tango Remixer Documentation

How to Use in Qt Project?

Important

Run ./build_icons.py --help for more latest information and full usages.

1. Clone this project into MY_QT_PROJ/resources/

git clone --recursive git@github.com:kuanyui/tango-remixer.git

2. Specify wanted icons via included_icons.txt

cd into MY_QT_PROJ/resources and create included_icons.txt: one icon per line, the theme and the icon name separated by a tab or by 4 or more spaces. For example:

Nome     application-exit
Tango    folder
Tango    folder-open    {16;22;48}

A line can also rename the icon, name its context, pick and convert sizes, and declare extra icon themes: see included_icons.txt Reference.

Note

Then you can test your included_icons.txt like this:

./tango-remixer/build_icons.py --included-icon-file ./included_icons.txt --output-theme-name "CustomizedTango"

The built SVG and PNG files can be found in ./tango-remixer/dist/. PNG is recommended because Qt's SVG renderer is not very well... Some icons may unable to be rendered correctly.

3. Edit CMakeLists.txt, watch the changes of included_icons.txt and build the included icons

Way 1: Use an extra "Stamp File" to track fresh / stale state

# ===============================================
# Build Icons
# ===============================================
find_package(Python3 REQUIRED Interpreter)

set(PROJ_GENERATED_DIR "${CMAKE_SOURCE_DIR}/generated" CACHE PATH
    "Directory for generated, platform independent files (e.g. XDG icon theme, changelogs...etc)")

set(RESOURCES_DIR "${CMAKE_SOURCE_DIR}/resources")
set(ICON_REPO_DIR "${CMAKE_SOURCE_DIR}/resources/tango-remixer")
set(ICON_BUILD_SCRIPT "${ICON_REPO_DIR}/build_icons.py")
set(ICON_THEME_NAME "CustomizedTango")
set(ICON_PNG_XDG_THEME_DIR "${PROJ_GENERATED_DIR}/icon_theme__png/${ICON_THEME_NAME}")
set(ICON_SVG_XDG_THEME_DIR "${PROJ_GENERATED_DIR}/icon_theme__svg/${ICON_THEME_NAME}")

# When included_icons.txt changed, auto execute cmake again.
set(ICON_INCLUDE_FILE "${RESOURCES_DIR}/included_icons.txt")
set(ICON_GENERATED_STAMP_FILE "${RESOURCES_DIR}/icons_built.stamp")
message(STATUS "STAMP ============================+> ${ICON_GENERATED_STAMP_FILE}")

# If qrc does not exist, create empty placeholder
set(ICON_PNG_GENERATED_QRC "${ICON_PNG_XDG_THEME_DIR}/index.qrc")
if(NOT EXISTS ${ICON_PNG_GENERATED_QRC})
    file(WRITE ${ICON_PNG_GENERATED_QRC} "<RCC>\n</RCC>\n")
endif()

add_custom_command(
    OUTPUT ${ICON_GENERATED_STAMP_FILE}
    COMMAND ${Python3_EXECUTABLE} ${ICON_BUILD_SCRIPT}
            --included-icon-file "${RESOURCES_DIR}/included_icons.txt"
            --extra-icon-theme "AppIcon:${RESOURCES_DIR}/appicon"
            --output-theme-name "${ICON_THEME_NAME}"
            --output-png-theme-to-dir "${ICON_PNG_XDG_THEME_DIR}"
            --output-svg-theme-to-dir "${ICON_SVG_XDG_THEME_DIR}"
    COMMAND ${CMAKE_COMMAND} -E touch ${ICON_GENERATED_STAMP_FILE}
    DEPENDS ${ICON_INCLUDE_FILE}
    COMMENT "Generating icon pack..."
    USES_TERMINAL    # immediately output
)
add_custom_target(icontheme DEPENDS ${ICON_GENERATED_STAMP_FILE})


# ==============================================
# Main
# ==============================================
qt_add_executable(myprojectname
     MANUAL_FINALIZATION
     ${PROJECT_SOURCES}
     ${ICON_PNG_GENERATED_QRC}

add_dependencies(myprojectname icontheme)

Way 2: Brute Method (Always execute the build script after cmake)

# ===============================================
# Build Icons
# ===============================================
find_package(Python3 REQUIRED Interpreter)
set(RESOURCES_DIR "${CMAKE_SOURCE_DIR}/resources")
set(ICON_REPO_DIR "${CMAKE_SOURCE_DIR}/resources/tango-remixer")
set(ICON_BUILD_SCRIPT "${ICON_REPO_DIR}/build_icons.py")
execute_process(
    COMMAND ${Python3_EXECUTABLE} ${ICON_BUILD_SCRIPT} --included-icon-file "${RESOURCES_DIR}/included_icons.txt" --output-theme-name "CustomizedTango"
)
set_property(
    DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${RESOURCES_DIR}/included_icons.txt"
)

# ==============================================
# Main
# ==============================================
qt_add_executable(myprojectname
     MANUAL_FINALIZATION
     ${PROJECT_SOURCES}
     resources/tango-remixer/dist/04_FINAL_PNG_THEME/CustomizedTango/index.qrc
)

4. Use in Qt/C++

Now you can get QIcon via QIcon::fromTheme(). Setup mainwindow.cpp like this:

    QIcon::setThemeSearchPaths({ ":/xdg_icon_themes" });   // this `:/xdg_icon_themes` is a `<qresource prefix>` defined in `qrc`
    QIcon::setThemeName("CustomizedTango");    // `--output-theme-name`
    setWindowIcon(QIcon::fromTheme("palettes"));    // The included icon name.
How to Use in Qt Project?
About Tango Remixer

Tango Remixer

Remix Tango-flavoured icon themes into one XDG icon theme for Qt and GTK applications.

This page is README.md at commit 94a7408, generated 2026-10-13.

Source on GitHub
Credits
Written by
  • Tango Remixer: 80% are written manually, the rests are assisted by some LLMs. 100% fully-reviewed by human.
  • LSP server: 100% code are by LLM agent, with rough manual code review.
  • Homepage, Icon viewer: 100% code are written by LLM agent.
  • llselect (@llselect/core): the combo boxes in the Icon Viewer.
Documented by
README.md, which these pages are: rendered by Python-Markdown, its code coloured by Pygments.
Artwork by
Some extra icons and fixes in the forks the icons come from: Tango, Nome, Humanity.
The icon themes' authors
Tango, Nome and the others of Built-in Icon Themes and Licenses. Each with where its files are:
Clearlooks: Richard Stellingwerff, Daniel Borgmann
GNOME 2's theme and its Metacity window frame, redrawn here in CSS.
DMZ-White: Novell, Inc.
The mouse cursors, 2007–2010 (viewer/static/cursors/).
License
Tango Remixer: GNU General Public License, version 3
The build, the viewer, README.md and this website: see Licenses. gnu.org/licenses/gpl-3.0
Parts of this page under licenses of their own
The icons: each theme's own license
In Built-in Icon Themes and Licenses; the viewer's list, with where each theme's files are:
Mouse cursors, DMZ-White: CC BY-SA 3.0 Unported
© 2007–2010 Novell, Inc.; Debian's dmz-cursor-theme package.
License text