blob: 8f8e8c82c9256b9e4daea814d109fa7a3d71f4a9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#include "optional.hpp"
#include "setting.hpp"
#include "wallpaper.hpp"
namespace wanda
{
void set_wallpaper(std::filesystem::path wallpaper, std::shared_ptr<spdlog::logger> logger)
{
using namespace wanda::literals;
using namespace wanda::std_ext;
using namespace std::string_literals;
with("org.gnome.desktop.background"_setting, [&](auto &setting) {
with(setting["picture-uri"_key], [&](auto &value) {
value = "file://" + wallpaper.native();
}) || [&] { logger->error("invalid settings key"); };
}) || [&] { logger->error("invalid setting"); };
}
} // namespace wanda
|