From 6c4767b01e009a73998d0d7efed89afb6a6d6331 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Tue, 11 Aug 2020 18:50:17 +0100 Subject: [PATCH] systemd: re-apply wallpaper on xorg screen event Signed-off-by: Joe Groocock --- systemd/user/desktop.target.wants/wallpaper.service | 1 + systemd/user/wallpaper.service | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 120000 systemd/user/desktop.target.wants/wallpaper.service create mode 100644 systemd/user/wallpaper.service diff --git a/systemd/user/desktop.target.wants/wallpaper.service b/systemd/user/desktop.target.wants/wallpaper.service new file mode 120000 index 0000000..2354262 --- /dev/null +++ b/systemd/user/desktop.target.wants/wallpaper.service @@ -0,0 +1 @@ +/home/frebib/.config/systemd/user/wallpaper.service \ No newline at end of file diff --git a/systemd/user/wallpaper.service b/systemd/user/wallpaper.service new file mode 100644 index 0000000..de56e80 --- /dev/null +++ b/systemd/user/wallpaper.service @@ -0,0 +1,12 @@ +[Unit] +Description=Apply wallpaper on screen-change event +Requires=graphical-session.target +After=graphical-session.target + +[Service] +Type=simple +ExecStart=/bin/sh -c "xev -root -event randr 2>&1 | while awk -v RS='\n\n' '{exit;}'; do echo 'Applying wallpaper'; feh --no-fehbg --no-xinerama --bg-fill ~/.config/lakesidesunrise.jpg; done" +Restart=always + +[Install] +WantedBy=desktop.target