From 36e4847dd12b6dccd5eb239ba8107924980983d3 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Mon, 10 Nov 2008 11:57:20 +0100 Subject: [PATCH] themes: move theme icons to themes/ Signed-off-by: Julien Danjou --- CMakeLists.txt | 6 ++- awesomeConfig.cmake | 2 +- awesomerc.lua.in | 2 +- lib/awful/menu.lua.in | 4 +- lib/awful/widget.lua.in | 15 ++++--- .../background.png} | Bin {icons => themes/default}/layouts/dwindle.png | Bin .../default}/layouts/dwindlew.png | Bin {icons => themes/default}/layouts/fairh.png | Bin {icons => themes/default}/layouts/fairhw.png | Bin {icons => themes/default}/layouts/fairv.png | Bin {icons => themes/default}/layouts/fairvw.png | Bin .../default}/layouts/floating.png | Bin .../default}/layouts/floatingw.png | Bin .../default}/layouts/magnifier.png | Bin .../default}/layouts/magnifierw.png | Bin {icons => themes/default}/layouts/max.png | Bin {icons => themes/default}/layouts/maxw.png | Bin {icons => themes/default}/layouts/spiral.png | Bin {icons => themes/default}/layouts/spiralw.png | Bin {icons => themes/default}/layouts/tile.png | Bin .../default}/layouts/tilebottom.png | Bin .../default}/layouts/tilebottomw.png | Bin .../default}/layouts/tileleft.png | Bin .../default}/layouts/tileleftw.png | Bin {icons => themes/default}/layouts/tiletop.png | Bin .../default}/layouts/tiletopw.png | Bin {icons => themes/default}/layouts/tilew.png | Bin {icons => themes/default}/submenu.png | Bin .../default}/taglist/squarefw.png | Bin {icons => themes/default}/taglist/squarew.png | Bin .../default}/tasklist/floating.png | Bin .../default}/tasklist/floatingw.png | Bin themes/{default.in => default/theme.in} | 39 ++++++++++-------- {icons => themes/default}/titlebar/close.png | Bin {icons => themes/default}/titlebar/closer.png | Bin 36 files changed, 37 insertions(+), 31 deletions(-) rename themes/{default-background.png => default/background.png} (100%) rename {icons => themes/default}/layouts/dwindle.png (100%) rename {icons => themes/default}/layouts/dwindlew.png (100%) rename {icons => themes/default}/layouts/fairh.png (100%) rename {icons => themes/default}/layouts/fairhw.png (100%) rename {icons => themes/default}/layouts/fairv.png (100%) rename {icons => themes/default}/layouts/fairvw.png (100%) rename {icons => themes/default}/layouts/floating.png (100%) rename {icons => themes/default}/layouts/floatingw.png (100%) rename {icons => themes/default}/layouts/magnifier.png (100%) rename {icons => themes/default}/layouts/magnifierw.png (100%) rename {icons => themes/default}/layouts/max.png (100%) rename {icons => themes/default}/layouts/maxw.png (100%) rename {icons => themes/default}/layouts/spiral.png (100%) rename {icons => themes/default}/layouts/spiralw.png (100%) rename {icons => themes/default}/layouts/tile.png (100%) rename {icons => themes/default}/layouts/tilebottom.png (100%) rename {icons => themes/default}/layouts/tilebottomw.png (100%) rename {icons => themes/default}/layouts/tileleft.png (100%) rename {icons => themes/default}/layouts/tileleftw.png (100%) rename {icons => themes/default}/layouts/tiletop.png (100%) rename {icons => themes/default}/layouts/tiletopw.png (100%) rename {icons => themes/default}/layouts/tilew.png (100%) rename {icons => themes/default}/submenu.png (100%) rename {icons => themes/default}/taglist/squarefw.png (100%) rename {icons => themes/default}/taglist/squarew.png (100%) rename {icons => themes/default}/tasklist/floating.png (100%) rename {icons => themes/default}/tasklist/floatingw.png (100%) rename themes/{default.in => default/theme.in} (51%) rename {icons => themes/default}/titlebar/close.png (100%) rename {icons => themes/default}/titlebar/closer.png (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index cb9dc732..b610f66a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -181,6 +181,8 @@ add_custom_target(generated_sources ${BUILD_DIR}/common/tokenize.c ${BUILD_DIR}/common/tokenize.h) +# Default theme directory +file(MAKE_DIRECTORY ${BUILD_DIR}/themes/default) add_dependencies(${PROJECT_AWE_NAME} generated_sources) add_dependencies(${PROJECT_AWECLIENT_NAME} generated_sources) # }}} @@ -323,7 +325,9 @@ if(GENERATE_MANPAGES) install(FILES ${AWE_MAN5_FILES} DESTINATION ${AWESOME_MAN_PATH}/man5) endif() install(DIRECTORY ${AWE_ICON_DIR} DESTINATION ${AWESOME_DATA_PATH}) -install(FILES ${AWE_THEMES_DIR}/default-background.png ${BUILD_DIR}/themes/default DESTINATION ${AWESOME_THEMES_PATH}) +install(DIRECTORY ${BUILD_DIR}/themes DESTINATION ${AWESOME_DATA_PATH}) +install(DIRECTORY ${SOURCE_DIR}/themes DESTINATION ${AWESOME_DATA_PATH} + PATTERN "*.in" EXCLUDE) install(FILES ${AWE_DOC_FILES} DESTINATION ${AWESOME_DOC_PATH}) install(FILES "awesome.desktop" DESTINATION ${AWESOME_XSESSION_PATH}) if(GENERATE_LUADOC) diff --git a/awesomeConfig.cmake b/awesomeConfig.cmake index 1663f611..f9a9c4c5 100644 --- a/awesomeConfig.cmake +++ b/awesomeConfig.cmake @@ -272,7 +272,7 @@ set(AWESOME_CONFIGURE_FILES ${awesome_lua_configure_files} config.h.in awesomerc.lua.in - themes/default.in + themes/default/theme.in awesome-version-internal.h.in awesome.doxygen.in) diff --git a/awesomerc.lua.in b/awesomerc.lua.in index f8d75fc5..62c6cc29 100644 --- a/awesomerc.lua.in +++ b/awesomerc.lua.in @@ -4,7 +4,7 @@ require("beautiful") -- {{{ Variable definitions -- This is a file path to a theme file which will defines colors. -theme_path = "@AWESOME_THEMES_PATH@/default" +theme_path = "@AWESOME_THEMES_PATH@/default/theme" -- This is used later as the default terminal and editor to run. terminal = "xterm" diff --git a/lib/awful/menu.lua.in b/lib/awful/menu.lua.in index 52cc1512..e5f26231 100644 --- a/lib/awful/menu.lua.in +++ b/lib/awful/menu.lua.in @@ -32,7 +32,7 @@ local function load_theme(custom) theme.fg_normal = custom.fg_normal or beautiful.menu_fg_normal or beautiful.fg_normal theme.bg_normal = custom.bg_normal or beautiful.menu_bg_normal or beautiful.bg_normal - theme.submenu_icon = custom.submenu_icon or beautiful.menu_submenu_icon or "@AWESOME_ICON_PATH@/submenu.png" + theme.submenu_icon = custom.submenu_icon or beautiful.menu_submenu_icon theme.menu_height = custom.height or beautiful.menu_height or 15 theme.menu_width = custom.width or beautiful.menu_width or 100 @@ -142,7 +142,7 @@ local function add_item(data, num, item_info) local submenu if type(item_info[2]) == "table" then submenu = widget({ type = "imagebox", align = "right" }) - submenu.image = image(data.theme.submenu_icon) + submenu.image = data.theme.submenu_icon and image(data.theme.submenu_icon) submenu:buttons(bindings) function submenu.mouse_enter() mouse_enter(item, data.theme) end diff --git a/lib/awful/widget.lua.in b/lib/awful/widget.lua.in index 30ac0161..e880bd83 100644 --- a/lib/awful/widget.lua.in +++ b/lib/awful/widget.lua.in @@ -93,7 +93,6 @@ end -- fg_focus The foreground color for selected tag. -- bg_urgent The background color for urgent tags. -- fg_urgent The foreground color for urgent tags. --- taglist_squares Optional: set "true" or nil to display the taglist squares. -- taglist_squares_sel Optional: an user provided image for selected squares. -- taglist_squares_unsel Optional: an user provided image for unselected squares. -- @return A string to print. @@ -104,9 +103,8 @@ function taglist.label.all(t, args) local bg_focus = args.bg_focus or theme.taglist_bg_focus or theme.bg_focus local fg_urgent = args.fg_urgent or theme.taglist_fg_urgent or theme.fg_urgent local bg_urgent = args.bg_urgent or theme.taglist_bg_urgent or theme.bg_urgent - local taglist_squares = args.taglist_squares or theme.taglist_squares or "true" - local taglist_squares_sel = args.squares_sel or theme.squares_sel or "@AWESOME_ICON_PATH@/taglist/squarefw.png" - local taglist_squares_unsel = args.squares_unsel or theme.squares_unsel or "@AWESOME_ICON_PATH@/taglist/squarew.png" + local taglist_squares_sel = args.squares_sel or theme.taglist_squares_sel + local taglist_squares_unsel = args.squares_unsel or theme.taglist_squares_unsel local text local background = "" local sel = capi.client.focus @@ -117,12 +115,12 @@ function taglist.label.all(t, args) fg_color = fg_focus end if sel and sel:tags()[t] then - if taglist_squares == "true" then + if taglist_squares_sel then background = "resize=\"true\" image=\"" .. taglist_squares_sel .. "\"" end else local cls = t:clients() - if #cls > 0 and taglist_squares == "true" then + if #cls > 0 and taglist_squares_unsel then background = "resize=\"true\" image=\"" .. taglist_squares_unsel .. "\"" end for k, c in pairs(cls) do @@ -269,11 +267,12 @@ local function widget_tasklist_label_common(c, args) local bg_focus = args.bg_focus or theme.tasklist_bg_focus or theme.bg_focus local fg_urgent = args.fg_urgent or theme.tasklist_fg_urgent or theme.fg_urgent local bg_urgent = args.bg_urgent or theme.tasklist_bg_urgent or theme.bg_urgent + local floating_icon = args.floating_icon or theme.tasklist_floating_icon local bg = nil local text = "" local name - if c.floating then - text = text.."" + if c.floating and floating_icon then + text = text.."" end if c.minimized then name = util.escape(c.icon_name) or "" diff --git a/themes/default-background.png b/themes/default/background.png similarity index 100% rename from themes/default-background.png rename to themes/default/background.png diff --git a/icons/layouts/dwindle.png b/themes/default/layouts/dwindle.png similarity index 100% rename from icons/layouts/dwindle.png rename to themes/default/layouts/dwindle.png diff --git a/icons/layouts/dwindlew.png b/themes/default/layouts/dwindlew.png similarity index 100% rename from icons/layouts/dwindlew.png rename to themes/default/layouts/dwindlew.png diff --git a/icons/layouts/fairh.png b/themes/default/layouts/fairh.png similarity index 100% rename from icons/layouts/fairh.png rename to themes/default/layouts/fairh.png diff --git a/icons/layouts/fairhw.png b/themes/default/layouts/fairhw.png similarity index 100% rename from icons/layouts/fairhw.png rename to themes/default/layouts/fairhw.png diff --git a/icons/layouts/fairv.png b/themes/default/layouts/fairv.png similarity index 100% rename from icons/layouts/fairv.png rename to themes/default/layouts/fairv.png diff --git a/icons/layouts/fairvw.png b/themes/default/layouts/fairvw.png similarity index 100% rename from icons/layouts/fairvw.png rename to themes/default/layouts/fairvw.png diff --git a/icons/layouts/floating.png b/themes/default/layouts/floating.png similarity index 100% rename from icons/layouts/floating.png rename to themes/default/layouts/floating.png diff --git a/icons/layouts/floatingw.png b/themes/default/layouts/floatingw.png similarity index 100% rename from icons/layouts/floatingw.png rename to themes/default/layouts/floatingw.png diff --git a/icons/layouts/magnifier.png b/themes/default/layouts/magnifier.png similarity index 100% rename from icons/layouts/magnifier.png rename to themes/default/layouts/magnifier.png diff --git a/icons/layouts/magnifierw.png b/themes/default/layouts/magnifierw.png similarity index 100% rename from icons/layouts/magnifierw.png rename to themes/default/layouts/magnifierw.png diff --git a/icons/layouts/max.png b/themes/default/layouts/max.png similarity index 100% rename from icons/layouts/max.png rename to themes/default/layouts/max.png diff --git a/icons/layouts/maxw.png b/themes/default/layouts/maxw.png similarity index 100% rename from icons/layouts/maxw.png rename to themes/default/layouts/maxw.png diff --git a/icons/layouts/spiral.png b/themes/default/layouts/spiral.png similarity index 100% rename from icons/layouts/spiral.png rename to themes/default/layouts/spiral.png diff --git a/icons/layouts/spiralw.png b/themes/default/layouts/spiralw.png similarity index 100% rename from icons/layouts/spiralw.png rename to themes/default/layouts/spiralw.png diff --git a/icons/layouts/tile.png b/themes/default/layouts/tile.png similarity index 100% rename from icons/layouts/tile.png rename to themes/default/layouts/tile.png diff --git a/icons/layouts/tilebottom.png b/themes/default/layouts/tilebottom.png similarity index 100% rename from icons/layouts/tilebottom.png rename to themes/default/layouts/tilebottom.png diff --git a/icons/layouts/tilebottomw.png b/themes/default/layouts/tilebottomw.png similarity index 100% rename from icons/layouts/tilebottomw.png rename to themes/default/layouts/tilebottomw.png diff --git a/icons/layouts/tileleft.png b/themes/default/layouts/tileleft.png similarity index 100% rename from icons/layouts/tileleft.png rename to themes/default/layouts/tileleft.png diff --git a/icons/layouts/tileleftw.png b/themes/default/layouts/tileleftw.png similarity index 100% rename from icons/layouts/tileleftw.png rename to themes/default/layouts/tileleftw.png diff --git a/icons/layouts/tiletop.png b/themes/default/layouts/tiletop.png similarity index 100% rename from icons/layouts/tiletop.png rename to themes/default/layouts/tiletop.png diff --git a/icons/layouts/tiletopw.png b/themes/default/layouts/tiletopw.png similarity index 100% rename from icons/layouts/tiletopw.png rename to themes/default/layouts/tiletopw.png diff --git a/icons/layouts/tilew.png b/themes/default/layouts/tilew.png similarity index 100% rename from icons/layouts/tilew.png rename to themes/default/layouts/tilew.png diff --git a/icons/submenu.png b/themes/default/submenu.png similarity index 100% rename from icons/submenu.png rename to themes/default/submenu.png diff --git a/icons/taglist/squarefw.png b/themes/default/taglist/squarefw.png similarity index 100% rename from icons/taglist/squarefw.png rename to themes/default/taglist/squarefw.png diff --git a/icons/taglist/squarew.png b/themes/default/taglist/squarew.png similarity index 100% rename from icons/taglist/squarew.png rename to themes/default/taglist/squarew.png diff --git a/icons/tasklist/floating.png b/themes/default/tasklist/floating.png similarity index 100% rename from icons/tasklist/floating.png rename to themes/default/tasklist/floating.png diff --git a/icons/tasklist/floatingw.png b/themes/default/tasklist/floatingw.png similarity index 100% rename from icons/tasklist/floatingw.png rename to themes/default/tasklist/floatingw.png diff --git a/themes/default.in b/themes/default/theme.in similarity index 51% rename from themes/default.in rename to themes/default/theme.in index a47892de..b14a5b4f 100644 --- a/themes/default.in +++ b/themes/default/theme.in @@ -25,16 +25,19 @@ border_marked = #91231c # Example: #taglist_bg_focus = #ff0000 +# Display the taglist squares +taglist_squares_sel = @AWESOME_THEMES_PATH@/default/taglist/squarefw.png +taglist_squares_unsel = @AWESOME_THEMES_PATH@/default/taglist/squarew.png + +tasklist_floating_icon = @AWESOME_THEMES_PATH@/default/tasklist/floatingw.png + # Variables set for theming menu # menu_[bg|fg]_[normal|focus] # menu_[border_color|border_width] -# menu_submenu_icon = @AWESOME_ICON_PATH@/submenu.png +menu_submenu_icon = @AWESOME_THEMES_PATH@/default/submenu.png menu_height = 15 menu_width = 100 -# Display the taglist squares -taglist_squares = true - # You can add as many variables as # you wish and access them by using # beautiful.variable in your rc.lua @@ -45,26 +48,26 @@ titlebar_close_button = true # Define the image to load @ (if titlebar_close_button_[normal|focus] these values are ignored) -#titlebar_close_button_img_normal = @AWESOME_ICON_PATH@/titlebar/closea.png -#titlebar_close_button_img_focus = @AWESOME_ICON_PATH@/titlebar/closera.png +#titlebar_close_button_img_normal = @AWESOME_THEMES_PATH@/titlebar/closea.png +#titlebar_close_button_img_focus = @AWESOME_THEMES_PATH@/titlebar/closera.png # Or create your own close button #titlebar_close_button_normal = ... #titlebar_close_button_focus = ... # You can use your own command to set your wallpaper -wallpaper_cmd = awsetbg @AWESOME_THEMES_PATH@/default-background.png +wallpaper_cmd = awsetbg @AWESOME_THEMES_PATH@/theme/background.png # You can use your own layout icons like this: -layout_dwindle = @AWESOME_ICON_PATH@/layouts/dwindlew.png -layout_fairh = @AWESOME_ICON_PATH@/layouts/fairhw.png -layout_fairv = @AWESOME_ICON_PATH@/layouts/fairvw.png -layout_floating = @AWESOME_ICON_PATH@/layouts/floatingw.png -layout_magnifier = @AWESOME_ICON_PATH@/layouts/magnifierw.png -layout_max = @AWESOME_ICON_PATH@/layouts/maxw.png -layout_spiral = @AWESOME_ICON_PATH@/layouts/spiralw.png -layout_tilebottom = @AWESOME_ICON_PATH@/layouts/tilebottomw.png -layout_tileleft = @AWESOME_ICON_PATH@/layouts/tileleftw.png -layout_tile = @AWESOME_ICON_PATH@/layouts/tilew.png -layout_tiletop = @AWESOME_ICON_PATH@/layouts/tiletopw.png +layout_dwindle = @AWESOME_THEMES_PATH@/default/layouts/dwindlew.png +layout_fairh = @AWESOME_THEMES_PATH@/default/layouts/fairhw.png +layout_fairv = @AWESOME_THEMES_PATH@/default/layouts/fairvw.png +layout_floating = @AWESOME_THEMES_PATH@/default/layouts/floatingw.png +layout_magnifier = @AWESOME_THEMES_PATH@/default/layouts/magnifierw.png +layout_max = @AWESOME_THEMES_PATH@/default/layouts/maxw.png +layout_spiral = @AWESOME_THEMES_PATH@/default/layouts/spiralw.png +layout_tilebottom = @AWESOME_THEMES_PATH@/default/layouts/tilebottomw.png +layout_tileleft = @AWESOME_THEMES_PATH@/default/layouts/tileleftw.png +layout_tile = @AWESOME_THEMES_PATH@/default/layouts/tilew.png +layout_tiletop = @AWESOME_THEMES_PATH@/default/layouts/tiletopw.png awesome_icon = @AWESOME_ICON_PATH@/awesome16.png diff --git a/icons/titlebar/close.png b/themes/default/titlebar/close.png similarity index 100% rename from icons/titlebar/close.png rename to themes/default/titlebar/close.png diff --git a/icons/titlebar/closer.png b/themes/default/titlebar/closer.png similarity index 100% rename from icons/titlebar/closer.png rename to themes/default/titlebar/closer.png