diff options
| author | Felix Morgner <felix.morgner@gmail.com> | 2018-12-11 07:42:05 +0100 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@gmail.com> | 2018-12-11 07:42:05 +0100 |
| commit | ed419140280553b070943b7ba539120a26ff5686 (patch) | |
| tree | 3d134977a6dfae71a45c318305166d044b50320d /src/wanda/wallpaper.cpp | |
| parent | d3e691c9200b7b782c8acf17468068a699588a73 (diff) | |
| download | wanda-ed419140280553b070943b7ba539120a26ff5686.tar.xz wanda-ed419140280553b070943b7ba539120a26ff5686.zip | |
wanda: restructure directory hierarchy
Diffstat (limited to 'src/wanda/wallpaper.cpp')
| -rw-r--r-- | src/wanda/wallpaper.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/wanda/wallpaper.cpp b/src/wanda/wallpaper.cpp new file mode 100644 index 0000000..3fc93b3 --- /dev/null +++ b/src/wanda/wallpaper.cpp @@ -0,0 +1,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
\ No newline at end of file |
