diff options
| author | Felix Morgner <felix.morgner@gmail.com> | 2018-11-29 22:28:07 +0100 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@gmail.com> | 2018-11-29 22:28:07 +0100 |
| commit | 962912ff747e4800720a9b5ccbcd40230421b3d1 (patch) | |
| tree | 3b7dbd80b28887940449baef99d2a0a8957d21bc /src/wallpaper.cpp | |
| parent | 1125802463013dd5d4e38e142886ecb5fbafa2d9 (diff) | |
| download | wanda-962912ff747e4800720a9b5ccbcd40230421b3d1.tar.xz wanda-962912ff747e4800720a9b5ccbcd40230421b3d1.zip | |
wanda: fix shutdown code
Diffstat (limited to 'src/wallpaper.cpp')
| -rw-r--r-- | src/wallpaper.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/wallpaper.cpp b/src/wallpaper.cpp new file mode 100644 index 0000000..39abb60 --- /dev/null +++ b/src/wallpaper.cpp @@ -0,0 +1,23 @@ +#include "optional.hpp" +#include "setting.hpp" +#include "wallpaper.hpp" + +#include <iostream> + +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(); + }) || [] { std::cerr << "No such key!\n"; }; + }) || [] { std::cerr << "No such setting!\n"; }; +} + +} // namespace wanda
\ No newline at end of file |
