mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
Merge pull request #78 from mithodin/filesystem-experimental
add option for when filesystem still lives in the experimental namespace
This commit is contained in:
commit
5ece0d98ee
@ -1,6 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include <filesystem>
|
||||
#ifdef FILESYSTEM_EXPERIMENTAL
|
||||
#include <experimental/filesystem>
|
||||
#else
|
||||
#include <filesystem>
|
||||
#endif
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <fmt/format.h>
|
||||
@ -11,7 +15,11 @@
|
||||
|
||||
namespace waybar::modules {
|
||||
|
||||
#ifdef FILESYSTEM_EXPERIMENTAL
|
||||
namespace fs = std::experimental::filesystem;
|
||||
#else
|
||||
namespace fs = std::filesystem;
|
||||
#endif
|
||||
|
||||
class Battery : public ALabel {
|
||||
public:
|
||||
|
@ -3,7 +3,11 @@
|
||||
#include <dbus-status-notifier-item.h>
|
||||
#include <gtkmm.h>
|
||||
#include <json/json.h>
|
||||
#include <filesystem>
|
||||
#ifdef FILESYSTEM_EXPERIMENTAL
|
||||
#include <experimental/filesystem>
|
||||
#else
|
||||
#include <filesystem>
|
||||
#endif
|
||||
|
||||
namespace waybar::modules::SNI {
|
||||
|
||||
|
@ -83,6 +83,12 @@ if dbusmenu_gtk.found()
|
||||
)
|
||||
endif
|
||||
|
||||
compiler = meson.get_compiler('cpp')
|
||||
|
||||
if not compiler.has_header('filesystem')
|
||||
add_project_arguments('-DFILESYSTEM_EXPERIMENTAL', language: 'cpp')
|
||||
endif
|
||||
|
||||
subdir('protocol')
|
||||
|
||||
executable(
|
||||
|
@ -190,7 +190,11 @@ void waybar::modules::SNI::Item::updateImage()
|
||||
if (!icon_name.empty()) {
|
||||
try {
|
||||
// Try to find icons specified by path and filename
|
||||
#ifdef FILESYSTEM_EXPERIMENTAL
|
||||
if (std::experimental::filesystem::exists(icon_name)) {
|
||||
#else
|
||||
if (std::filesystem::exists(icon_name)) {
|
||||
#endif
|
||||
auto pixbuf = Gdk::Pixbuf::create_from_file(icon_name);
|
||||
if (pixbuf->gobj() != nullptr) {
|
||||
// An icon specified by path and filename may be the wrong size for
|
||||
|
Loading…
Reference in New Issue
Block a user