polybar-3.5.7/0000755000175100001710000000000014122403601012526 5ustar runnerdockerpolybar-3.5.7/CMakeLists.txt0000644000175100001710000001063114122403576015302 0ustar runnerdocker# # Build configuration # cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR) # Enable ccache by default and as early as possible because project() performs # checks on the compiler option(ENABLE_CCACHE "Enable ccache support" ON) if(ENABLE_CCACHE) message(STATUS "Trying to enable ccache") find_program(BIN_CCACHE ccache) string(ASCII 27 esc) if(NOT BIN_CCACHE) message(STATUS "${esc}[33mCouldn't locate ccache, disabling ccache...${esc}[0m") else() # Enable only if the binary is found message(STATUS "${esc}[32mUsing compiler cache ${BIN_CCACHE}${esc}[0m") set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${BIN_CCACHE}) endif() endif() project(polybar CXX) # Extract version information from version.txt. The first line that looks like # a version string is used, so the file supports comments file(STRINGS version.txt version_txt REGEX "^[0-9]+\\.[0-9]+\\.[0-9]+.*$" LIMIT_COUNT 1) # If we are in a git repo we can get the version information from git describe execute_process(COMMAND git describe --tags --dirty=-dev WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} RESULT_VARIABLE git_result OUTPUT_VARIABLE git_describe OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET) if(git_result EQUAL "0") set(APP_VERSION "${git_describe}") else() message(STATUS "Could not detect version with git, falling back to built-in version information.") set(APP_VERSION "${version_txt}") endif() set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake ${PROJECT_SOURCE_DIR}/cmake/common ${PROJECT_SOURCE_DIR}/cmake/modules) include(GNUInstallDirs) include(utils) include(01-core) include(02-opts) include(03-libs) include(04-targets) include(05-summary) if(BUILD_DOC) add_subdirectory(doc) endif() add_subdirectory(contrib/bash) add_subdirectory(contrib/zsh) add_subdirectory(include) add_subdirectory(lib) add_subdirectory(src bin) # We need to enable testing in the root folder so that 'ctest' and 'make test' # can be run in the build directory if(BUILD_TESTS) enable_testing() add_subdirectory(tests) endif() # # Generate configuration file # set(MODULES_LEFT "bspwm i3") set(MODULES_CENTER "mpd") set(MODULES_RIGHT "filesystem xbacklight alsa pulseaudio xkeyboard memory cpu wlan eth battery temperature date powermenu") set(FONT_FIXED "fixed:pixelsize=10") set(FONT_UNIFONT "unifont:fontformat=truetype") set(FONT_SIJI "siji:pixelsize=10") queryfont(FONT_FIXED ${FONT_FIXED} FIELDS family pixelsize) queryfont(FONT_UNIFONT ${FONT_UNIFONT} FIELDS family fontformat) queryfont(FONT_SIJI ${FONT_SIJI} FIELDS family pixelsize) # Strip disabled modules {{{ if(NOT ENABLE_PULSEAUDIO) string(REPLACE " pulseaudio" "" MODULES_RIGHT ${MODULES_RIGHT}) endif() if(NOT ENABLE_ALSA) string(REPLACE " alsa" "" MODULES_RIGHT ${MODULES_RIGHT}) endif() if(NOT ENABLE_I3) string(REPLACE " i3" "" MODULES_LEFT ${MODULES_LEFT}) endif() if(NOT ENABLE_MPD) string(REPLACE "mpd" "" MODULES_CENTER ${MODULES_CENTER}) endif() if(NOT ENABLE_NETWORK) string(REPLACE " wlan eth" "" MODULES_RIGHT ${MODULES_RIGHT}) endif() if(NOT WITH_XRANDR) string(REPLACE "xbacklight " "backlight-acpi " MODULES_RIGHT ${MODULES_RIGHT}) endif() if(NOT WITH_XKB) string(REPLACE "xkeyboard " "" MODULES_RIGHT ${MODULES_RIGHT}) endif() # }}} # Get battery/adapter name {{{ string(REGEX REPLACE /%battery%.* "" PATH_BAT ${SETTING_PATH_BATTERY}) string(REGEX REPLACE /%adapter%.* "" PATH_ADP ${SETTING_PATH_ADAPTER}) file(GLOB BAT_LIST RELATIVE ${PATH_BAT} ${PATH_ADP}/B*) file(GLOB ADP_LIST RELATIVE ${PATH_ADP} ${PATH_ADP}/A*) if(BAT_LIST) list(GET BAT_LIST 0 BATTERY) else() set(BATTERY BAT0) endif() if(ADP_LIST) list(GET ADP_LIST 0 ADAPTER) else() set(ADAPTER ADP1) endif() # }}} # Get network interfaces {{{ if(ENABLE_NETWORK) file(GLOB IFLIST RELATIVE /sys/class/net /sys/class/net/*) foreach(INTERFACE ${IFLIST}) if(NOT ${INTERFACE} STREQUAL "lo") file(GLOB IS_WIRELESS /sys/class/net/${INTERFACE}/wireless) if(IS_WIRELESS) set(INTERFACE_WLAN ${INTERFACE}) else() set(INTERFACE_ETH ${INTERFACE}) endif() endif() endforeach() if(NOT INTERFACE_ETH) set(INTERFACE_ETH net0) endif() if(NOT INTERFACE_WLAN) set(INTERFACE_WLAN net1) endif() endif() # }}} # Configure and install {{{ configure_file( ${CMAKE_CURRENT_LIST_DIR}/config.cmake ${CMAKE_CURRENT_LIST_DIR}/config ESCAPE_QUOTES @ONLY) install(FILES config DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT config) # }}} polybar-3.5.7/cmake/0000755000175100001710000000000014122403576013621 5ustar runnerdockerpolybar-3.5.7/cmake/05-summary.cmake0000644000175100001710000000401114122403576016536 0ustar runnerdocker# # Output build summary # message(STATUS " Build:") message_colored(STATUS " Version: ${APP_VERSION}" "32;1") message_colored(STATUS " Type: ${CMAKE_BUILD_TYPE}" "37;2") message_colored(STATUS " CXX: ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE_UPPER}}" "37;2") message_colored(STATUS " LD: ${CMAKE_LINKER} ${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_${CMAKE_BUILD_TYPE_UPPER}}" "37;2") message(STATUS " Install Paths:") message_colored(STATUS " PREFIX: ${CMAKE_INSTALL_PREFIX}" "32") message_colored(STATUS " BINDIR: ${CMAKE_INSTALL_FULL_BINDIR}" "32") message_colored(STATUS " DATADIR: ${CMAKE_INSTALL_FULL_DATADIR}" "32") message_colored(STATUS " DOCDIR: ${CMAKE_INSTALL_FULL_DOCDIR}" "32") message_colored(STATUS " MANDIR: ${CMAKE_INSTALL_FULL_MANDIR}" "32") message(STATUS " Targets:") colored_option(" polybar-msg" BUILD_IPC_MSG) colored_option(" testsuite" BUILD_TESTS) colored_option(" documentation" BUILD_DOC) message(STATUS " Module support:") colored_option(" alsa" ENABLE_ALSA) colored_option(" curl" ENABLE_CURL) colored_option(" i3" ENABLE_I3) colored_option(" mpd" ENABLE_MPD) colored_option(" network (${WIRELESS_LIB})" ENABLE_NETWORK) colored_option(" pulseaudio" ENABLE_PULSEAUDIO) colored_option(" xkeyboard" WITH_XKB) message(STATUS " X extensions:") colored_option(" xcb-randr" WITH_XRANDR) colored_option(" xcb-randr (monitor support)" WITH_XRANDR_MONITORS) colored_option(" xcb-composite" WITH_XCOMPOSITE) colored_option(" xcb-xkb" WITH_XKB) colored_option(" xcb-xrm" WITH_XRM) colored_option(" xcb-cursor" WITH_XCURSOR) message(STATUS " Log options:") colored_option(" Trace logging" DEBUG_LOGGER) if(CMAKE_BUILD_TYPE_UPPER MATCHES DEBUG) message(STATUS " Debug options:") colored_option(" Trace logging (verbose)" DEBUG_LOGGER_VERBOSE) colored_option(" Draw clickable areas" DEBUG_HINTS) colored_option(" Print fc-match details" DEBUG_FONTCONFIG) colored_option(" Enable window shading" DEBUG_SHADED) endif() polybar-3.5.7/cmake/templates/0000755000175100001710000000000014122403576015617 5ustar runnerdockerpolybar-3.5.7/cmake/templates/uninstall.cmake.in0000644000175100001710000000140114122403576021233 0ustar runnerdockerset(INSTALL_MANIFEST "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") if(NOT EXISTS ${INSTALL_MANIFEST}) message(FATAL_ERROR "Cannot find install manifest: ${INSTALL_MANIFEST}") endif() file(READ ${INSTALL_MANIFEST} files) string(REGEX REPLACE "\n" ";" files "${files}") list(REVERSE files) foreach(file ${files}) message(STATUS "Uninstalling $ENV{DESTDIR}${file}") if(EXISTS "$ENV{DESTDIR}${file}") execute_process(COMMAND "@CMAKE_COMMAND@" -E remove "$ENV{DESTDIR}${file}" OUTPUT_VARIABLE rm_out RESULT_VARIABLE rm_retval) if(NOT ${rm_retval} EQUAL 0) message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}") endif() else() message(STATUS "File $ENV{DESTDIR}${file} does not exist") endif() endforeach() polybar-3.5.7/cmake/templates/userconfig.cmake.in0000644000175100001710000000037714122403576021401 0ustar runnerdockerset(USER_CONFIG_HOME "$ENV{XDG_CONFIG_HOME}") if(NOT USER_CONFIG_HOME) set(USER_CONFIG_HOME "$ENV{HOME}/.config") endif() set(USER_CONFIG_HOME "${USER_CONFIG_HOME}/polybar") file(INSTALL "@CMAKE_SOURCE_DIR@/config" DESTINATION "${USER_CONFIG_HOME}") polybar-3.5.7/cmake/modules/0000755000175100001710000000000014122403576015271 5ustar runnerdockerpolybar-3.5.7/cmake/modules/FindLibiw.cmake0000644000175100001710000000077514122403576020153 0ustar runnerdocker# This module defines # LIBIW_FOUND - whether the libiw library was found # LIBIW_LIBRARIES - the libiw library # LIBIW_INCLUDE_DIR - the include path of the libiw library find_library(LIBIW_LIBRARY iw) if(LIBIW_LIBRARY) set(LIBIW_LIBRARIES ${LIBIW_LIBRARY}) endif(LIBIW_LIBRARY) find_path(LIBIW_INCLUDE_DIR NAMES iwlib.h) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(Libiw DEFAULT_MSG LIBIW_LIBRARY LIBIW_INCLUDE_DIR) mark_as_advanced(LIBIW_INCLUDE_DIR LIBIW_LIBRARY) polybar-3.5.7/cmake/02-opts.cmake0000644000175100001710000000627114122403576016035 0ustar runnerdocker# # Build options # set(SPHINX_BUILD "sphinx-build" CACHE STRING "Name/Path of the sphinx-build executable to use.") checklib(BUILD_DOC "binary" "${SPHINX_BUILD}") checklib(ENABLE_ALSA "pkg-config" alsa) checklib(ENABLE_CURL "pkg-config" libcurl) checklib(ENABLE_I3 "binary" i3) checklib(ENABLE_MPD "pkg-config" libmpdclient) checklib(WITH_LIBNL "pkg-config" libnl-genl-3.0) if(WITH_LIBNL) checklib(ENABLE_NETWORK "pkg-config" libnl-genl-3.0) set(WIRELESS_LIB "libnl") else() checklib(ENABLE_NETWORK "cmake" Libiw) set(WIRELESS_LIB "wireless-tools") endif() checklib(ENABLE_PULSEAUDIO "pkg-config" libpulse) checklib(WITH_XKB "pkg-config" xcb-xkb) checklib(WITH_XRM "pkg-config" xcb-xrm) checklib(WITH_XRANDR_MONITORS "pkg-config" "xcb-randr>=1.12") checklib(WITH_XCURSOR "pkg-config" "xcb-cursor") if(NOT DEFINED ENABLE_CCACHE AND CMAKE_BUILD_TYPE_UPPER MATCHES DEBUG) set(ENABLE_CCACHE ON) endif() option(CXXLIB_CLANG "Link against libc++" OFF) option(CXXLIB_GCC "Link against stdlibc++" OFF) option(BUILD_IPC_MSG "Build ipc messager" ON) option(BUILD_TESTS "Build testsuite" OFF) option(BUILD_DOC "Build documentation" ON) option(ENABLE_ALSA "Enable alsa support" ON) option(ENABLE_CURL "Enable curl support" ON) option(ENABLE_I3 "Enable i3 support" ON) option(ENABLE_MPD "Enable mpd support" ON) option(WITH_LIBNL "Use netlink interface for wireless" ON) option(ENABLE_NETWORK "Enable network support" ON) option(ENABLE_XKEYBOARD "Enable xkeyboard support" ON) option(ENABLE_PULSEAUDIO "Enable PulseAudio support" ON) option(WITH_XRANDR "xcb-randr support" ON) option(WITH_XRANDR_MONITORS "xcb-randr monitor support" ON) option(WITH_XCOMPOSITE "xcb-composite support" ON) option(WITH_XKB "xcb-xkb support" ON) option(WITH_XRM "xcb-xrm support" ON) option(WITH_XCURSOR "xcb-cursor support" ON) option(DEBUG_LOGGER "Trace logging" ON) if(CMAKE_BUILD_TYPE_UPPER MATCHES DEBUG) option(DEBUG_LOGGER_VERBOSE "Trace logging (verbose)" OFF) option(DEBUG_HINTS "Debug clickable areas" OFF) option(DEBUG_WHITESPACE "Debug whitespace" OFF) option(DEBUG_FONTCONFIG "Debug fontconfig" OFF) endif() set(SETTING_ALSA_SOUNDCARD "default" CACHE STRING "Name of the ALSA soundcard driver") set(SETTING_BSPWM_SOCKET_PATH "/tmp/bspwm_0_0-socket" CACHE STRING "Path to bspwm socket") set(SETTING_BSPWM_STATUS_PREFIX "W" CACHE STRING "Prefix prepended to the bspwm status line") set(SETTING_CONNECTION_TEST_IP "8.8.8.8" CACHE STRING "Address to ping when testing network connection") set(SETTING_PATH_ADAPTER "/sys/class/power_supply/%adapter%" CACHE STRING "Path to adapter") set(SETTING_PATH_BACKLIGHT "/sys/class/backlight/%card%" CACHE STRING "Path to backlight sysfs folder") set(SETTING_PATH_BATTERY "/sys/class/power_supply/%battery%" CACHE STRING "Path to battery") set(SETTING_PATH_CPU_INFO "/proc/stat" CACHE STRING "Path to file containing cpu info") set(SETTING_PATH_MEMORY_INFO "/proc/meminfo" CACHE STRING "Path to file containing memory info") set(SETTING_PATH_MESSAGING_FIFO "/tmp/polybar_mqueue.%pid%" CACHE STRING "Path to file containing the current temperature") set(SETTING_PATH_TEMPERATURE_INFO "/sys/class/thermal/thermal_zone%zone%/temp" CACHE STRING "Path to file containing the current temperature") polybar-3.5.7/cmake/common/0000755000175100001710000000000014122403576015111 5ustar runnerdockerpolybar-3.5.7/cmake/common/utils.cmake0000644000175100001710000000632314122403576017257 0ustar runnerdocker# # Collection of cmake utility functions # # message_colored {{{ function(message_colored message_level text color) string(ASCII 27 esc) message(${message_level} "${esc}[${color}m${text}${esc}[0m") endfunction() # }}} # colored_option {{{ function(colored_option text flag) # Append version of option, if ${flag}_VERSION is set set(version ${${flag}_VERSION}) if(NOT "${version}" STREQUAL "") set(text "${text} (${version})") endif() if(${flag}) message_colored(STATUS "[X]${text}" "32;1") else() message_colored(STATUS "[ ]${text}" "37;2") endif() endfunction() # }}} # queryfont {{{ function(queryfont output_variable fontname) set(multi_value_args FIELDS) cmake_parse_arguments(ARG "" "" "${multi_value_args}" ${ARGN}) find_program(BIN_FCLIST fc-list) if(NOT BIN_FCLIST) message_colored(WARNING "Failed to locate `fc-list`" "33;1") return() endif() string(REPLACE ";" " " FIELDS "${ARG_FIELDS}") if(NOT FIELDS) set(FIELDS family) endif() execute_process( COMMAND sh -c "${BIN_FCLIST} : ${FIELDS}" RESULT_VARIABLE status OUTPUT_VARIABLE output ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE) STRING(REGEX REPLACE ";" "\\\\;" output "${output}") STRING(REGEX REPLACE "\n" ";" output "${output}") STRING(TOLOWER "${output}" output) foreach(match LISTS ${output}) if(${match} MATCHES ".*${fontname}.*$") list(APPEND matches ${match}) endif() endforeach() if(matches) list(GET matches 0 fst_match) set(${output_variable} "${fst_match}" PARENT_SCOPE) message(STATUS "Found font: ${fst_match}") else() message_colored(STATUS "Font not found: ${fontname}" "33;1") endif() endfunction() # }}} # querylib {{{ function(querylib flag type pkg out_library out_include_dirs) if(${flag}) if(${type} STREQUAL "cmake") find_package(${pkg} REQUIRED) string(TOUPPER ${pkg} pkg_upper) list(APPEND ${out_library} ${${pkg_upper}_LIBRARY}) list(APPEND ${out_include_dirs} ${${pkg_upper}_INCLUDE_DIR}) elseif(${type} STREQUAL "pkg-config") find_package(PkgConfig REQUIRED) pkg_check_modules(PKG_${flag} REQUIRED ${pkg}) # Set packet version so that it can be used in the summary set(${flag}_VERSION ${PKG_${flag}_VERSION} PARENT_SCOPE) list(APPEND ${out_library} ${PKG_${flag}_LIBRARIES}) list(APPEND ${out_include_dirs} ${PKG_${flag}_INCLUDE_DIRS}) else() message(FATAL_ERROR "Invalid lookup type '${type}'") endif() set(${out_library} ${${out_library}} PARENT_SCOPE) set(${out_include_dirs} ${${out_include_dirs}} PARENT_SCOPE) endif() endfunction() # }}} # checklib {{{ function(checklib flag type pkg) if(NOT DEFINED ${flag}) if(${type} STREQUAL "cmake") find_package(${pkg} QUIET) set(${flag} ${${pkg}_FOUND} CACHE BOOL "") elseif(${type} STREQUAL "pkg-config") find_package(PkgConfig REQUIRED) pkg_check_modules(PKG_${flag} QUIET ${pkg}) set(${flag} ${PKG_${flag}_FOUND} CACHE BOOL "") elseif(${type} STREQUAL "binary") find_program(BIN_${flag} ${pkg}) set(${flag} ${BIN_${flag}} CACHE BOOL "") else() message(FATAL_ERROR "Invalid lookup type '${type}'") endif() endif() endfunction() # }}} polybar-3.5.7/cmake/04-targets.cmake0000644000175100001710000000403214122403576016514 0ustar runnerdocker# # Custom targets # # Target: userconfig {{{ configure_file( ${PROJECT_SOURCE_DIR}/cmake/templates/userconfig.cmake.in ${PROJECT_BINARY_DIR}/cmake/userconfig.cmake ESCAPE_QUOTES @ONLY) add_custom_target(userconfig DEPENDS ${PROJECT_NAME} COMMAND ${CMAKE_COMMAND} -P ${PROJECT_BINARY_DIR}/cmake/userconfig.cmake) # }}} # Target: uninstall {{{ configure_file( ${PROJECT_SOURCE_DIR}/cmake/templates/uninstall.cmake.in ${PROJECT_BINARY_DIR}/cmake/uninstall.cmake ESCAPE_QUOTES @ONLY) add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P ${PROJECT_BINARY_DIR}/cmake/uninstall.cmake) # }}} # folders where the clang tools should operate set(CLANG_SEARCH_PATHS ${PROJECT_SOURCE_DIR}/src ${PROJECT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR}/tests) # Target: codeformat (clang-format) {{{ add_custom_target(codeformat) add_custom_command(TARGET codeformat COMMAND ${PROJECT_SOURCE_DIR}/common/clang-format.sh ${CLANG_SEARCH_PATHS}) # }}} # Target: codecheck (clang-tidy) {{{ add_custom_target(codecheck) add_custom_command(TARGET codecheck COMMAND ${PROJECT_SOURCE_DIR}/common/clang-tidy.sh ${PROJECT_BINARY_DIR} ${CLANG_SEARCH_PATHS}) # }}} # Target: codecheck-fix (clang-tidy + clang-format) {{{ add_custom_target(codecheck-fix) add_custom_command(TARGET codecheck-fix COMMAND ${PROJECT_SOURCE_DIR}/common/clang-tidy.sh ${PROJECT_BINARY_DIR} -fix ${CLANG_SEARCH_PATHS}) # }}} # Target: memcheck (valgrind) {{{ add_custom_target(memcheck) add_custom_command(TARGET memcheck COMMAND valgrind --leak-check=summary --suppressions=${PROJECT_SOURCE_DIR}/.valgrind-suppressions ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}/${PROJECT_NAME} example --config=${PROJECT_SOURCE_DIR}/doc/config) add_custom_target(memcheck-full) add_custom_command(TARGET memcheck-full COMMAND valgrind --leak-check=full --track-origins=yes --track-fds=yes --suppressions=${PROJECT_SOURCE_DIR}/.valgrind-suppressions ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}/${PROJECT_NAME} example --config=${PROJECT_SOURCE_DIR}/doc/config) # }}} polybar-3.5.7/cmake/01-core.cmake0000644000175100001710000000737314122403576016003 0ustar runnerdocker# # Core setup # set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) set(THREADS_PREFER_PTHREAD_FLAG ON) # Export compile commands used for custom targets set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # Set default build type if not specified if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "Release") message_colored(STATUS "No build type specified; using ${CMAKE_BUILD_TYPE}" 33) endif() string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_UPPER) # Compiler flags set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wpedantic") if (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") # Need dprintf() for FreeBSD 11.1 and older set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_WITH_DPRINTF") # libinotify uses c99 extension, so suppress this error set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-c99-extensions") # Ensures that libraries from dependencies in LOCALBASE are used set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L/usr/local/lib") endif() if(${CMAKE_CXX_COMPILER_ID} STREQUAL Clang) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=parentheses-equality") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-zero-length-array") endif() set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g2") if(${CMAKE_CXX_COMPILER_ID} STREQUAL GNU) set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -fdata-sections -ffunction-sections") set(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL} -Wl,--gc-sections,--icf=safe") endif() # Check compiler if(${CMAKE_CXX_COMPILER_ID} STREQUAL Clang) if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.4.0") message_colored(FATAL_ERROR "Compiler not supported (Requires clang-3.4+ or gcc-5.1+)" 31) else() message_colored(STATUS "Using supported compiler ${CMAKE_CXX_COMPILER_ID}-${CMAKE_CXX_COMPILER_VERSION}" 32) endif() elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL GNU) if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5.1.0") message_colored(FATAL_ERROR "Compiler not supported (Requires clang-3.4+ or gcc-5.1+)" 31) else() message_colored(STATUS "Using supported compiler ${CMAKE_CXX_COMPILER_ID}-${CMAKE_CXX_COMPILER_VERSION}" 32) endif() else() message_colored(WARNING "Using unsupported compiler ${CMAKE_CXX_COMPILER_ID}-${CMAKE_CXX_COMPILER_VERSION} !" 31) endif() # Set compiler and linker flags for preferred C++ library if(CXXLIB_CLANG) message_colored(STATUS "Linking against libc++" 32) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lc++ -lc++abi") elseif(CXXLIB_GCC) message_colored(STATUS "Linking against libstdc++" 32) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lstdc++") endif() # Custom build type ; SANITIZE SET(CMAKE_CXX_FLAGS_SANITIZE "-O0 -g -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer -fno-optimize-sibling-calls" CACHE STRING "Flags used by the C++ compiler during sanitize builds." FORCE) SET(CMAKE_EXE_LINKER_FLAGS_SANITIZE "" CACHE STRING "Flags used for linking binaries during sanitize builds." FORCE) SET(CMAKE_SHARED_LINKER_FLAGS_SANITIZE "" CACHE STRING "Flags used by the shared libraries linker during sanitize builds." FORCE) MARK_AS_ADVANCED( CMAKE_CXX_FLAGS_SANITIZE CMAKE_EXE_LINKER_FLAGS_SANITIZE CMAKE_SHARED_LINKER_FLAGS_SANITIZE) # Custom build type ; Coverage SET(CMAKE_CXX_FLAGS_COVERAGE "${CMAKE_CXX_FLAGS_DEBUG} ${CMAKE_CXX_FLAGS_COVERAGE} --coverage") SET(CMAKE_EXE_LINKER_FLAGS_COVERAGE "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${CMAKE_EXE_LINKER_FLAGS_COVERAGE}") SET(CMAKE_SHARED_LINKER_FLAGS_COVERAGE "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} ${CMAKE_SHARED_LINKER_FLAGS_COVERAGE}") polybar-3.5.7/cmake/03-libs.cmake0000644000175100001710000000172414122403576016000 0ustar runnerdocker# # Check libraries # find_package(Threads REQUIRED) list(APPEND libs ${CMAKE_THREAD_LIBS_INIT}) querylib(TRUE "pkg-config" cairo-fc libs dirs) querylib(ENABLE_ALSA "pkg-config" alsa libs dirs) querylib(ENABLE_CURL "pkg-config" libcurl libs dirs) querylib(ENABLE_MPD "pkg-config" libmpdclient libs dirs) if(WITH_LIBNL) querylib(ENABLE_NETWORK "pkg-config" libnl-genl-3.0 libs dirs) else() querylib(ENABLE_NETWORK "cmake" Libiw libs dirs) endif() querylib(ENABLE_PULSEAUDIO "pkg-config" libpulse libs dirs) querylib(WITH_XCOMPOSITE "pkg-config" xcb-composite libs dirs) querylib(WITH_XKB "pkg-config" xcb-xkb libs dirs) querylib(WITH_XRANDR "pkg-config" xcb-randr libs dirs) querylib(WITH_XRANDR_MONITORS "pkg-config" "xcb-randr>=1.12" libs dirs) querylib(WITH_XRM "pkg-config" xcb-xrm libs dirs) querylib(WITH_XCURSOR "pkg-config" xcb-cursor libs dirs) # FreeBSD Support if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") querylib(TRUE "pkg-config" libinotify libs dirs) endif() polybar-3.5.7/SUPPORT.md0000644000175100001710000000223314122403576014237 0ustar runnerdockerGetting Help ============ If you need help or troubleshooting tips or just have a question: * If applicable, go through our [debugging guide](https://github.com/polybar/polybar/wiki/Debugging-your-Config). * Read the [Known Issues page](https://github.com/polybar/polybar/wiki/Known-Issues), maybe others had the same issue before. * Read the [Wiki page](https://github.com/polybar/polybar/wiki) for the thing you have problems with. * Join our Gitter room at [gitter.im/polybar/polybar](https://gitter.im/polybar/polybar) * Ask in our reddit community at [r/polybar](https://www.reddit.com/r/polybar) * Join the official IRC channel `#polybar` on the `chat.freenode.net` network. If you don't get an answer try asking on [Gitter](https://gitter.im/polybar/polybar). * Ask on [Unix & Linux StackExchange](https://unix.stackexchange.com/). Though not all questions may be suited over there, make sure you're [on topic](https://unix.stackexchange.com/help/on-topic). Please **do not** use the github issue tracker to ask for help or if you have a question, it is meant for bug reports and feature requests. Issues will be closed and you will be referred to the above resources. polybar-3.5.7/CONTRIBUTING.md0000644000175100001710000001210314122403576014767 0ustar runnerdocker# Contributing First of all, thank you very much for considering contributing to polybar. You are awesome! :tada: **Table of Contents:** * [Bug Reports](#bug-reports) * [Pull Requests](#pull-requests) + [Testing](#testing) + [Documentation](#documentation) + [Style](#style) ## Bug Reports Bugs should be reported at the polybar issue tracker, using the [bug report template](https://github.com/polybar/polybar/issues/new?template=bug_report.md). Make sure you fill out all the required sections. Before opening a bug report, please search our [issue tracker](https://github.com/polybar/polybar/issues?q=is%3Aissue) and [known issues page](https://github.com/polybar/polybar/wiki/Known-Issues) for your problem to avoid duplicates. If your issue has already been reported but is already marked as fixed and the version of polybar you are using includes this supposed fix, feel free to open a new issue. You should also go through our [debugging guide](https://github.com/polybar/polybar/wiki/Debugging-your-Config) to confirm what you are experiencing is indeed a polybar bug and not an issue with your configuration. This will also help you narrow down the issue which, in turn, will help us resolve it, if it turns out to be a bug in polybar. If this bug was not present in a previous version of polybar and you know how to, doing a `git bisect` and providing us with the commit ID that introduced the issue would be immensely helpful. ## Pull Requests If you want to start contributing to polybar, a good place to start are issues labeled with [help wanted](https://github.com/polybar/polybar/labels/help%20wanted) or [good first issue](https://github.com/polybar/polybar/labels/good%20first%20issue). Except for small changes, PRs should always address an already open and accepted issue. Otherwise you run the risk of spending time implementing something and then the PR being rejected because the feature you implemented was not actually something we want in polybar. Issues with any of the following labels are generally safe to start working on, unless someone else has already claimed them: * [bug](https://github.com/polybar/polybar/labels/bug) * [confirmed](https://github.com/polybar/polybar/labels/confirmed) * [good first issue](https://github.com/polybar/polybar/labels/good%20first%20issue) * [help wanted](https://github.com/polybar/polybar/labels/help%20wanted) For anything else, it's a good idea to first comment under the issue to ask whether it is something that can/should be worked on right now. This is especially true for issues labeled with `feature` (and none of the labels listed above), here a feature may depend on some other things being implemented first or it may need to be split into many smaller features, because it is too big otherwise. In particular, this means that you should not open a feature request and immediately start working on that feature, unless you are very sure it will be accepted or accept the risk of it being rejected. Things like documentation changes or refactorings, don't necessarily need an issue associated with them. These changes are less likely to be rejected since they don't change the behavior of polybar. Nevertheless, for bigger changes or when in doubt, open an issue and ask whether such changes would be desirable. To claim an issue, comment under it to let others know that you are working on it. Feel free to ask for feedback about your changes at any time. Especially when implementing features, this can be very useful because it allows us to make sure you are going in the direction we had envisioned for that feature and you don't lose time on something that ultimately has to be rewritten. In that case, a [draft PR](https://github.blog/2019-02-14-introducing-draft-pull-requests/) is a useful tool. When creating a PR, please fill out the PR template. ### Testing Your PR must pass all existing tests. If possible, you should also add tests for the things you write. However, this is not always possible, for example when working on modules. But at least isolated components should be tested. See the [testing page](https://github.com/polybar/polybar/wiki/Testing) on the wiki for more information. Also don't hesitate to ask for help, testing isn't that mature in polybar yet and some things may be harder/impossible to test right now. ### Documentation Right now, documentation for polybar lives in two places: The GitHub wiki and the git repo itself. Ultimately, most of the documentation is supposed to live in the repo itself. For now, if your PR requires documentation changes in the repo, those changes need to be in the PR as well. Changes on the wiki should not be made right away because the wiki should reflect the currently released version and not the development version. In that case, outline the documentation changes that need to be made (for example, which new config options are available). If your PR would introduce a lot of new documentation on the wiki, let us know and we can decide if we want to put some of the documentation directly into the repo. ### Style Please read our [style guide](https://github.com/polybar/polybar/wiki/Style-Guide). polybar-3.5.7/config.cmake0000644000175100001710000002426214122403576015016 0ustar runnerdocker;========================================================== ; ; ; ██████╗ ██████╗ ██╗ ██╗ ██╗██████╗ █████╗ ██████╗ ; ██╔══██╗██╔═══██╗██║ ╚██╗ ██╔╝██╔══██╗██╔══██╗██╔══██╗ ; ██████╔╝██║ ██║██║ ╚████╔╝ ██████╔╝███████║██████╔╝ ; ██╔═══╝ ██║ ██║██║ ╚██╔╝ ██╔══██╗██╔══██║██╔══██╗ ; ██║ ╚██████╔╝███████╗██║ ██████╔╝██║ ██║██║ ██║ ; ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ; ; ; To learn more about how to configure Polybar ; go to https://github.com/polybar/polybar ; ; The README contains a lot of information ; ;========================================================== [colors] ;background = ${xrdb:color0:#222} background = #222 background-alt = #444 ;foreground = ${xrdb:color7:#222} foreground = #dfdfdf foreground-alt = #555 primary = #ffb52a secondary = #e60053 alert = #bd2c40 [bar/example] ;monitor = ${env:MONITOR:HDMI-1} width = 100% height = 27 ;offset-x = 1% ;offset-y = 1% radius = 6.0 fixed-center = false background = ${colors.background} foreground = ${colors.foreground} line-size = 3 line-color = #f00 border-size = 4 border-color = #00000000 padding-left = 0 padding-right = 2 module-margin-left = 1 module-margin-right = 2 font-0 = @FONT_FIXED@;1 font-1 = @FONT_UNIFONT@:size=8:antialias=false;0 font-2 = @FONT_SIJI@;1 modules-left = @MODULES_LEFT@ modules-center = @MODULES_CENTER@ modules-right = @MODULES_RIGHT@ tray-position = right tray-padding = 2 ;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 cursor-click = pointer cursor-scroll = ns-resize [module/xwindow] type = internal/xwindow label = %title:0:30:...% [module/xkeyboard] type = internal/xkeyboard blacklist-0 = num lock format-prefix = " " format-prefix-foreground = ${colors.foreground-alt} format-prefix-underline = ${colors.secondary} label-layout = %layout% label-layout-underline = ${colors.secondary} label-indicator-padding = 2 label-indicator-margin = 1 label-indicator-background = ${colors.secondary} label-indicator-underline = ${colors.secondary} [module/filesystem] type = internal/fs interval = 25 mount-0 = / label-mounted = %{F#0a81f5}%mountpoint%%{F-}: %percentage_used%% label-unmounted = %mountpoint% not mounted label-unmounted-foreground = ${colors.foreground-alt} [module/bspwm] type = internal/bspwm 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 ; Separator in between workspaces ; label-separator = | [module/i3] type = internal/i3 format = index-sort = true wrapping-scroll = false ; Only show workspaces on the same output as the bar ;pin-workspaces = true label-mode-padding = 2 label-mode-foreground = #000 label-mode-background = ${colors.primary} ; focused = Active workspace on focused monitor label-focused = %index% label-focused-background = ${colors.background-alt} label-focused-underline= ${colors.primary} label-focused-padding = 2 ; unfocused = Inactive workspace on any monitor label-unfocused = %index% label-unfocused-padding = 2 ; visible = Active workspace on unfocused monitor label-visible = %index% label-visible-background = ${self.label-focused-background} label-visible-underline = ${self.label-focused-underline} label-visible-padding = ${self.label-focused-padding} ; urgent = Workspace with urgency hint set label-urgent = %index% label-urgent-background = ${colors.alert} label-urgent-padding = 2 ; Separator in between workspaces ; label-separator = | [module/mpd] type = internal/mpd format-online = icon-prev =  icon-stop =  icon-play =  icon-pause =  icon-next =  label-song-maxlen = 25 label-song-ellipsis = true [module/xbacklight] type = internal/xbacklight format =