themes: Generate unfocused/inactive icons automatically
Additionally, use the alpha channel so that the unfocused icons look good on any background, not just black. This adds ImageMagick as a build dependency. Signed-off-by: Johan Kiviniemi <devel@johan.kiviniemi.name> Signed-off-by: Julien Danjou <julien@danjou.info>
|
@ -280,6 +280,46 @@ if(GENERATE_LUADOC)
|
|||
endif()
|
||||
# }}}
|
||||
|
||||
# {{{ Theme icons
|
||||
file(GLOB icon_sources ${SOURCE_DIR}/themes/*/titlebar/*.png)
|
||||
set(ALL_ICONS ${icon_sources})
|
||||
|
||||
macro(a_icon_convert match replacement input)
|
||||
string(REPLACE ${match} ${replacement} output ${input})
|
||||
|
||||
if(NOT ${input} STREQUAL ${output})
|
||||
if(NOT ${output} MATCHES ${BUILD_DIR})
|
||||
string(REPLACE ${SOURCE_DIR} ${BUILD_DIR} output ${output})
|
||||
endif()
|
||||
|
||||
set(ALL_ICONS ${ALL_ICONS} ${output})
|
||||
|
||||
get_filename_component(output_path ${output} PATH)
|
||||
file(MAKE_DIRECTORY ${output_path})
|
||||
|
||||
add_custom_command(
|
||||
COMMAND ${CONVERT_EXECUTABLE} ${input} ${ARGN} ${output}
|
||||
OUTPUT ${output}
|
||||
DEPENDS ${input}
|
||||
VERBATIM)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
foreach(icon ${ALL_ICONS})
|
||||
# Make unfocused icons translucent
|
||||
a_icon_convert("_focus" "_normal" ${icon}
|
||||
-evaluate Pow 2 -channel A -evaluate Multiply 0.4)
|
||||
endforeach()
|
||||
|
||||
foreach(icon ${ALL_ICONS})
|
||||
# Make inactive icons grayscale
|
||||
a_icon_convert("_active" "_inactive" ${icon}
|
||||
-colorspace Gray)
|
||||
endforeach()
|
||||
|
||||
add_custom_target(generated_icons ALL DEPENDS ${ALL_ICONS})
|
||||
# }}}
|
||||
|
||||
# {{{ Dist tarball
|
||||
if(BUILD_FROM_GIT)
|
||||
add_custom_target(dist
|
||||
|
|
3
README
|
@ -18,6 +18,9 @@ In order to build awesome itself, you need header files and libs of:
|
|||
- dbus (optional, use -DWITH_DBUS=OFF with cmake to disable)
|
||||
- gperf
|
||||
|
||||
As well as the following tools to build theme icons:
|
||||
- ImageMagick
|
||||
|
||||
In order to build the awesome man pages and documentation,
|
||||
you need these tools:
|
||||
- asciidoc
|
||||
|
|
|
@ -58,6 +58,8 @@ a_find_program(GZIP_EXECUTABLE gzip FALSE)
|
|||
# lua documentation
|
||||
a_find_program(LUA_EXECUTABLE lua FALSE)
|
||||
a_find_program(LUADOC_EXECUTABLE luadoc FALSE)
|
||||
# theme graphics
|
||||
a_find_program(CONVERT_EXECUTABLE convert TRUE)
|
||||
# doxygen
|
||||
include(FindDoxygen)
|
||||
# pkg-config
|
||||
|
|
Before Width: | Height: | Size: 358 B |
Before Width: | Height: | Size: 431 B |
Before Width: | Height: | Size: 611 B |
Before Width: | Height: | Size: 414 B |
Before Width: | Height: | Size: 386 B |
Before Width: | Height: | Size: 349 B |
Before Width: | Height: | Size: 816 B |
Before Width: | Height: | Size: 738 B |
Before Width: | Height: | Size: 682 B |
Before Width: | Height: | Size: 669 B |
Before Width: | Height: | Size: 565 B |
Before Width: | Height: | Size: 590 B |
Before Width: | Height: | Size: 659 B |
Before Width: | Height: | Size: 611 B |
Before Width: | Height: | Size: 597 B |