2016-05-31 03:58:58 +00:00
|
|
|
#pragma once
|
2016-05-19 14:41:06 +00:00
|
|
|
|
2016-06-15 03:32:35 +00:00
|
|
|
#include <iostream>
|
2016-11-20 22:04:31 +00:00
|
|
|
#include <vector>
|
2016-06-15 03:32:35 +00:00
|
|
|
|
|
|
|
#include "version.hpp"
|
|
|
|
|
2016-05-24 04:30:06 +00:00
|
|
|
#define APP_NAME "@PROJECT_NAME@"
|
2016-11-26 14:30:08 +00:00
|
|
|
#cmakedefine APP_VERSION "@APP_VERSION@"
|
|
|
|
#ifndef APP_VERSION
|
|
|
|
#define APP_VERSION GIT_TAG
|
|
|
|
#endif
|
2016-06-15 03:32:35 +00:00
|
|
|
#define BASE_PATH "@PROJECT_SOURCE_DIR@"
|
2016-05-24 04:30:06 +00:00
|
|
|
|
2016-06-27 19:52:21 +00:00
|
|
|
#cmakedefine01 ENABLE_ALSA
|
|
|
|
#cmakedefine01 ENABLE_MPD
|
|
|
|
#cmakedefine01 ENABLE_NETWORK
|
|
|
|
#cmakedefine01 ENABLE_I3
|
2016-12-19 21:01:37 +00:00
|
|
|
#cmakedefine01 ENABLE_CURL
|
2016-05-19 14:41:06 +00:00
|
|
|
|
2016-11-30 11:46:26 +00:00
|
|
|
#cmakedefine01 WITH_XRANDR
|
|
|
|
#cmakedefine01 WITH_XRENDER
|
|
|
|
#cmakedefine01 WITH_XDAMAGE
|
|
|
|
#cmakedefine01 WITH_XSYNC
|
|
|
|
#cmakedefine01 WITH_XCOMPOSITE
|
|
|
|
#cmakedefine01 WITH_XKB
|
2016-11-30 09:06:16 +00:00
|
|
|
#cmakedefine XPP_EXTENSION_LIST @XPP_EXTENSION_LIST@
|
2016-06-15 03:32:35 +00:00
|
|
|
|
2016-11-02 19:22:45 +00:00
|
|
|
#cmakedefine DEBUG_LOGGER
|
|
|
|
#cmakedefine VERBOSE_TRACELOG
|
2016-11-25 03:10:26 +00:00
|
|
|
#cmakedefine DEBUG_HINTS
|
2016-10-25 11:10:34 +00:00
|
|
|
|
2016-12-05 19:41:00 +00:00
|
|
|
static const size_t EVENT_SIZE{64U};
|
|
|
|
|
2016-12-20 04:05:43 +00:00
|
|
|
static const int SIGN_PRIORITY_CONTROLLER{1};
|
|
|
|
static const int SIGN_PRIORITY_SCREEN{2};
|
|
|
|
static const int SIGN_PRIORITY_BAR{3};
|
|
|
|
static const int SIGN_PRIORITY_RENDERER{4};
|
|
|
|
static const int SIGN_PRIORITY_TRAY{5};
|
2016-12-05 19:41:00 +00:00
|
|
|
|
2016-12-03 12:00:40 +00:00
|
|
|
static const int SINK_PRIORITY_BAR{1};
|
|
|
|
static const int SINK_PRIORITY_SCREEN{2};
|
|
|
|
static const int SINK_PRIORITY_TRAY{3};
|
|
|
|
static const int SINK_PRIORITY_MODULE{4};
|
|
|
|
|
2016-11-25 03:10:26 +00:00
|
|
|
#ifdef DEBUG_HINTS
|
|
|
|
static const int DEBUG_HINTS_OFFSET_X{@DEBUG_HINTS_OFFSET_X@};
|
|
|
|
static const int DEBUG_HINTS_OFFSET_Y{@DEBUG_HINTS_OFFSET_Y@};
|
2016-10-11 01:01:12 +00:00
|
|
|
#endif
|
2016-11-19 14:42:31 +00:00
|
|
|
|
2016-11-25 03:10:26 +00:00
|
|
|
static constexpr const char* ALSA_SOUNDCARD{"@SETTING_ALSA_SOUNDCARD@"};
|
|
|
|
static constexpr const char* BSPWM_SOCKET_PATH{"@SETTING_BSPWM_SOCKET_PATH@"};
|
|
|
|
static constexpr const char* BSPWM_STATUS_PREFIX{"@SETTING_BSPWM_STATUS_PREFIX@"};
|
|
|
|
static constexpr const char* CONNECTION_TEST_IP{"@SETTING_CONNECTION_TEST_IP@"};
|
|
|
|
static constexpr const char* PATH_ADAPTER{"@SETTING_PATH_ADAPTER@"};
|
|
|
|
static constexpr const char* PATH_BACKLIGHT_MAX{"@SETTING_PATH_BACKLIGHT_MAX@"};
|
|
|
|
static constexpr const char* PATH_BACKLIGHT_VAL{"@SETTING_PATH_BACKLIGHT_VAL@"};
|
|
|
|
static constexpr const char* PATH_BATTERY{"@SETTING_PATH_BATTERY@"};
|
|
|
|
static constexpr const char* PATH_CPU_INFO{"@SETTING_PATH_CPU_INFO@"};
|
|
|
|
static constexpr const char* PATH_MEMORY_INFO{"@SETTING_PATH_MEMORY_INFO@"};
|
|
|
|
static constexpr const char* PATH_MESSAGING_FIFO{"@SETTING_PATH_MESSAGING_FIFO@"};
|
|
|
|
static constexpr const char* PATH_TEMPERATURE_INFO{"@SETTING_PATH_TEMPERATURE_INFO@"};
|
2016-11-24 18:24:47 +00:00
|
|
|
|
2016-11-25 03:10:26 +00:00
|
|
|
static constexpr const char* BUILDER_SPACE_TOKEN{"%__"};
|
2016-06-15 03:32:35 +00:00
|
|
|
|
2016-11-20 22:04:31 +00:00
|
|
|
auto version_details = [](const std::vector<std::string>& args) {
|
|
|
|
for (auto&& arg : args) {
|
2016-12-26 09:27:30 +00:00
|
|
|
if (arg.compare(0, 3, "-vv") == 0)
|
2016-11-20 22:04:31 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
};
|
|
|
|
|
|
|
|
// clang-format off
|
|
|
|
auto print_build_info = [](bool extended = false) {
|
2016-11-26 14:30:08 +00:00
|
|
|
std::cout << APP_NAME << " " << APP_VERSION << " " << "\n"
|
2016-11-20 22:04:31 +00:00
|
|
|
<< "\n"
|
|
|
|
<< "Features: "
|
|
|
|
<< (ENABLE_ALSA ? "+" : "-") << "alsa "
|
2016-12-19 21:01:37 +00:00
|
|
|
<< (ENABLE_CURL ? "+" : "-") << "curl "
|
2016-11-20 22:04:31 +00:00
|
|
|
<< (ENABLE_I3 ? "+" : "-") << "i3 "
|
|
|
|
<< (ENABLE_MPD ? "+" : "-") << "mpd "
|
|
|
|
<< (ENABLE_NETWORK ? "+" : "-") << "network "
|
|
|
|
<< "\n";
|
|
|
|
if (!extended)
|
|
|
|
return;
|
|
|
|
std::cout << "\n"
|
|
|
|
<< "Build type: @CMAKE_BUILD_TYPE@" << "\n"
|
2016-12-20 05:08:04 +00:00
|
|
|
<< "Compiler: @CMAKE_CXX_COMPILER@" << "\n"
|
2016-11-20 22:04:31 +00:00
|
|
|
<< "Compiler flags: @CMAKE_CXX_FLAGS@" << "\n"
|
|
|
|
<< "Linker flags: @CMAKE_EXE_LINKER_FLAGS@" << "\n"
|
|
|
|
<< "\n"
|
2016-11-19 14:42:31 +00:00
|
|
|
<< "ALSA_SOUNDCARD " << ALSA_SOUNDCARD << "\n"
|
|
|
|
<< "BSPWM_SOCKET_PATH " << BSPWM_SOCKET_PATH << "\n"
|
|
|
|
<< "BSPWM_STATUS_PREFIX " << BSPWM_STATUS_PREFIX << "\n"
|
|
|
|
<< "BUILDER_SPACE_TOKEN " << BUILDER_SPACE_TOKEN << "\n"
|
|
|
|
<< "CONNECTION_TEST_IP " << CONNECTION_TEST_IP << "\n"
|
2016-11-21 07:22:12 +00:00
|
|
|
<< "PATH_ADAPTER " << PATH_ADAPTER << "\n"
|
2016-11-19 14:42:31 +00:00
|
|
|
<< "PATH_BACKLIGHT_MAX " << PATH_BACKLIGHT_MAX << "\n"
|
|
|
|
<< "PATH_BACKLIGHT_VAL " << PATH_BACKLIGHT_VAL << "\n"
|
2016-11-21 07:22:12 +00:00
|
|
|
<< "PATH_BATTERY " << PATH_BATTERY << "\n"
|
2016-11-19 14:42:31 +00:00
|
|
|
<< "PATH_CPU_INFO " << PATH_CPU_INFO << "\n"
|
|
|
|
<< "PATH_MEMORY_INFO " << PATH_MEMORY_INFO << "\n"
|
|
|
|
<< "PATH_TEMPERATURE_INFO " << PATH_TEMPERATURE_INFO << "\n";
|
2016-06-15 03:32:35 +00:00
|
|
|
};
|
2016-11-20 22:04:31 +00:00
|
|
|
// clang-format on
|
2016-06-15 03:32:35 +00:00
|
|
|
|
|
|
|
// vim:ft=cpp
|