blob: f0ae46879c25d76f97f749c15ea6c45414435882 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
#include "wallpaper.hpp"
#include "optional.hpp"
#include "setting.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
|