blob: 3fc93b3ffe30c8e0b3f760d234fbbf4fb7c60262 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
#include <wanda/logging.hpp>
#include <wanda/optional.hpp>
#include <wanda/setting.hpp>
#include <wanda/wallpaper.hpp>
namespace wanda
{
void set_wallpaper(std::filesystem::path wallpaper)
{
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();
}) ||
[&] { get_logger()->error("invalid settings key"); };
}) ||
[&] { get_logger()->error("invalid setting"); };
}
} // namespace wanda
|