From 92424f0d4962843f15acdc2bd8796c865cdb9cbb Mon Sep 17 00:00:00 2001 From: Michael Carlberg Date: Fri, 23 Dec 2016 18:10:19 +0100 Subject: [PATCH] refactor(cmake): Install components --- CMakeLists.txt | 2 +- cmake/templates/userconfig.cmake.in | 2 +- cmake/utils.cmake | 6 +- {examples => doc}/CMakeLists.txt | 6 +- doc/config | 356 ++++++++++++++++++++++++++++ {examples => doc}/config.cmake | 0 man/CMakeLists.txt | 7 +- man/Makefile | 7 +- man/polybar.1 | 11 +- man/polybar_config.5 | 129 ---------- src/components/controller.cpp | 11 +- 11 files changed, 379 insertions(+), 158 deletions(-) rename {examples => doc}/CMakeLists.txt (93%) create mode 100644 doc/config rename {examples => doc}/config.cmake (100%) delete mode 100644 man/polybar_config.5 diff --git a/CMakeLists.txt b/CMakeLists.txt index a93151c1..8ffb3622 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,7 @@ include(build/summary) add_subdirectory(${PROJECT_SOURCE_DIR}/man) add_subdirectory(${PROJECT_SOURCE_DIR}/src ${PROJECT_BINARY_DIR}/bin) -add_subdirectory(${PROJECT_SOURCE_DIR}/examples ${PROJECT_BINARY_DIR}/examples) +add_subdirectory(${PROJECT_SOURCE_DIR}/doc ${PROJECT_BINARY_DIR}/doc) if(BUILD_TESTS) add_subdirectory(${PROJECT_SOURCE_DIR}/tests ${PROJECT_BINARY_DIR}/tests) diff --git a/cmake/templates/userconfig.cmake.in b/cmake/templates/userconfig.cmake.in index 1dd573eb..5b64b0b6 100644 --- a/cmake/templates/userconfig.cmake.in +++ b/cmake/templates/userconfig.cmake.in @@ -4,4 +4,4 @@ if(NOT USER_CONFIG_HOME) endif() set(USER_CONFIG_HOME ${USER_CONFIG_HOME}/polybar) -file(INSTALL @CMAKE_SOURCE_DIR@/examples/config DESTINATION ${USER_CONFIG_HOME}) +file(INSTALL @CMAKE_SOURCE_DIR@/doc/config DESTINATION ${USER_CONFIG_HOME}) diff --git a/cmake/utils.cmake b/cmake/utils.cmake index 790404f9..c56c2fa6 100644 --- a/cmake/utils.cmake +++ b/cmake/utils.cmake @@ -69,7 +69,8 @@ function(make_executable target_name) install(TARGETS ${target_name} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + COMPONENT runtime) endfunction() # }}} @@ -154,7 +155,8 @@ function(make_library target_name) install(TARGETS ${LIBRARY_TARGETS} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + COMPONENT library) endforeach() endfunction() diff --git a/examples/CMakeLists.txt b/doc/CMakeLists.txt similarity index 93% rename from examples/CMakeLists.txt rename to doc/CMakeLists.txt index bbf99c54..cfab987c 100644 --- a/examples/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -74,12 +74,12 @@ endif() # Configure and install {{{ configure_file( - ${PROJECT_SOURCE_DIR}/examples/config.cmake - ${CMAKE_SOURCE_DIR}/examples/config + ${PROJECT_SOURCE_DIR}/doc/config.cmake + ${CMAKE_SOURCE_DIR}/doc/config ESCAPE_QUOTES @ONLY) install(FILES config - DESTINATION share/examples/polybar + DESTINATION share/doc/polybar COMPONENT config) # }}} diff --git a/doc/config b/doc/config new file mode 100644 index 00000000..6f96bb7b --- /dev/null +++ b/doc/config @@ -0,0 +1,356 @@ +;===================================================== +; +; To learn more about how to configure Polybar +; go to https://github.com/jaagr/polybar +; +; The README contains alot of information +; +;===================================================== + +[colors] +background = #222 +background-alt = #444 +foreground = #dfdfdf +foreground-alt = #55 +primary = #ffb52a +secondary = #e60053 +alert = #bd2c40 + +[global/wm] +margin-top = 5 +margin-bottom = 5 + +[bar/example] +;monitor = ${env:MONITOR:HDMI-1} +width = 100% +height = 27 +offset-x = 0 +offset-y = 0 + +;background = ${xrdb:color9} +background = ${colors.background} +foreground = ${colors.foreground} + +overline-size = 2 +overline-color = #f00 +underline-size = 2 +underline-color = #00f + +border-bottom = 2 +border-bottom-color = #333 + +spacing = 1 +padding-left = 0 +padding-right = 2 +module-margin-left = 1 +module-margin-right = 2 + +font-0 = fixed:pixelsize=10;0 +font-1 = unifont:size=6:heavy:fontformat=truetype;-2 +font-2 = siji:pixelsize=10;0 + +modules-left = bspwm i3 xwindow +modules-center = +modules-right = backlight volume xkeyboard memory cpu wlan eth battery temperature date powermenu + +tray-position = right +tray-padding = 2 +;tray-transparent = true +;tray-background = #0063ff + +;wm-restack = bspwm +;wm-restack = i3 + +;override-redirect = true + +;scroll-up = bspwm-desknext +;scroll-down = bspwm-deskprev + +;scroll-up = i3wm-wsnext +;scroll-down = i3wm-wsprev + + +[module/xwindow] +type = internal/xwindow +label = %title:0:30:...% + +[module/xkeyboard] +type = internal/xkeyboard +blacklist-0 = num lock + +format-underline = ${colors.secondary} +format-prefix = " " +format-prefix-foreground = ${colors.foreground-alt} + +label-layout = %layout% + +label-indicator-padding = 2 +label-indicator-background = ${colors.secondary} +label-indicator-underline = ${colors.secondary} + +[module/filesystem] +type = internal/fs +interval = 25 + +mount-0 = / +mount-1 = /home +mount-2 = /invalid/mountpoint + +label-mounted = %mountpoint%: %percentage_free% + +label-unmounted = %mountpoint%: not mounted +label-unmounted-foreground = ${colors.foreground-alt} + +[module/bspwm] +type = internal/bspwm +ws-icon-default = x + +label-focused = %index% +label-focused-background = ${colors.background-alt} +label-focused-underline= ${colors.primary} +label-focused-padding = 2 + +label-occupied = %index% +label-occupied-padding = 2 + +label-urgent = %index%! +label-urgent-background = ${colors.alert} +label-urgent-padding = 2 + +label-empty = %index% +label-empty-foreground = ${colors.foreground-alt} +label-empty-padding = 2 + +[module/i3] +type = internal/i3 +format = +index-sort = true +wrapping-scroll = false + +label-mode-padding = 2 +label-mode-foreground = #000 +label-mode-background = ${colors.primary} + +label-focused = %index% +label-focused-background = ${module/bspwm.label-focused-background} +label-focused-underline = ${module/bspwm.label-focused-underline} +label-focused-padding = ${module/bspwm.label-focused-padding} + +label-unfocused = %index% +label-unfocused-padding = ${module/bspwm.label-occupied-padding} + +label-urgent = %index%! +label-urgent-background = ${module/bspwm.label-urgent-background} +label-urgent-padding = ${module/bspwm.label-urgent-padding} + +label-visible = %index% +label-visible-background = ${self.label-focused-background} +label-visible-underline = ${self.label-focused-underline} +label-visible-padding = ${self.label-focused-padding} + +[module/mpd] +type = internal/mpd + +format-online = + +label-song-maxlen = 25 +label-song-ellipsis = true + +icon-prev =  +icon-seekb =  +icon-stop =  +icon-play =  +icon-pause =  +icon-next =  +icon-seekf =  + +icon-random =  +icon-repeat =  + +toggle-on-foreground = ${colors.primary} +toggle-off-foreground = #66 + +[module/backlight] +type = internal/xbacklight + +format =