mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
Gate backlight module behind libudev availability
This commit is contained in:
parent
875306804c
commit
e67347f6ad
@ -16,10 +16,12 @@
|
||||
#ifdef HAVE_LIBNL
|
||||
#include "modules/network.hpp"
|
||||
#endif
|
||||
#ifdef HAVE_LIBUDEV
|
||||
#include "modules/backlight.hpp"
|
||||
#endif
|
||||
#ifdef HAVE_LIBPULSE
|
||||
#include "modules/pulseaudio.hpp"
|
||||
#endif
|
||||
#include "modules/backlight.hpp"
|
||||
#include "modules/custom.hpp"
|
||||
|
||||
namespace waybar {
|
||||
|
@ -55,7 +55,7 @@ sigcpp = dependency('sigc++-2.0')
|
||||
libnl = dependency('libnl-3.0', required: get_option('libnl'))
|
||||
libnlgen = dependency('libnl-genl-3.0', required: get_option('libnl'))
|
||||
libpulse = dependency('libpulse', required: get_option('pulseaudio'))
|
||||
libudev = dependency('libudev')
|
||||
libudev = dependency('libudev', required: get_option('libudev'))
|
||||
|
||||
src_files = files(
|
||||
'src/factory.cpp',
|
||||
@ -65,7 +65,6 @@ src_files = files(
|
||||
'src/modules/clock.cpp',
|
||||
'src/modules/custom.cpp',
|
||||
'src/modules/cpu.cpp',
|
||||
'src/modules/backlight.cpp',
|
||||
'src/main.cpp',
|
||||
'src/bar.cpp',
|
||||
'src/client.cpp'
|
||||
@ -101,6 +100,11 @@ if dbusmenu_gtk.found()
|
||||
)
|
||||
endif
|
||||
|
||||
if libudev.found()
|
||||
add_project_arguments('-DHAVE_LIBUDEV', language: 'cpp')
|
||||
src_files += 'src/modules/backlight.cpp'
|
||||
endif
|
||||
|
||||
subdir('protocol')
|
||||
|
||||
executable(
|
||||
|
@ -1,4 +1,5 @@
|
||||
option('libnl', type: 'feature', value: 'auto', description: 'Enable libnl support for network related features')
|
||||
option('libudev', type: 'feature', value: 'auto', description: 'Enable libudev support for udev related features')
|
||||
option('pulseaudio', type: 'feature', value: 'auto', description: 'Enable support for pulseaudio')
|
||||
option('dbusmenu-gtk', type: 'feature', value: 'auto', description: 'Enable support for tray')
|
||||
option('out', type: 'string', value : '/', description: 'output prefix directory')
|
||||
|
@ -43,14 +43,16 @@ waybar::IModule* waybar::Factory::makeModule(const std::string &name) const
|
||||
return new waybar::modules::Network(id, config_[name]);
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_LIBUDEV
|
||||
if (ref == "backlight") {
|
||||
return new waybar::modules::Backlight(id, config_[name]);
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_LIBPULSE
|
||||
if (ref == "pulseaudio") {
|
||||
return new waybar::modules::Pulseaudio(id, config_[name]);
|
||||
}
|
||||
#endif
|
||||
if (ref == "backlight") {
|
||||
return new waybar::modules::Backlight(id, config_[name]);
|
||||
}
|
||||
if (ref.compare(0, 7, "custom/") == 0 && ref.size() > 7) {
|
||||
return new waybar::modules::Custom(ref.substr(7), config_[name]);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user