From 90babbaf5b494b9a54ce7b31fd490c3ab261bced Mon Sep 17 00:00:00 2001 From: Jonathan Hodgson Date: Sat, 26 Sep 2020 15:09:26 +0100 Subject: [PATCH] Adds background switcher systemd files to dotfiles --- .gitignore | 1 + systemd/.config/systemd/user/background.service | 8 ++++++++ systemd/.config/systemd/user/background.timer | 9 +++++++++ systemd/.config/systemd/user/randomBackground | 6 ++++++ 4 files changed, 24 insertions(+) create mode 100644 systemd/.config/systemd/user/background.service create mode 100644 systemd/.config/systemd/user/background.timer create mode 100755 systemd/.config/systemd/user/randomBackground diff --git a/.gitignore b/.gitignore index 4d8f0dc8..c30815b6 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ mutt/accounts/* /qutebrowser/.config/qutebrowser/qsettings/ /qutebrowser/.config/qutebrowser/autoconfig.yml /bin/.bin/pappy +/systemd/.config/systemd/user/timers.target.wants/ diff --git a/systemd/.config/systemd/user/background.service b/systemd/.config/systemd/user/background.service new file mode 100644 index 00000000..23c637c1 --- /dev/null +++ b/systemd/.config/systemd/user/background.service @@ -0,0 +1,8 @@ +[Unit] +Description=Background Switcher + +[Service] +ExecStart=/home/jonathan/.config/systemd/user/randomBackground + +[Install] +WantedBy=default.target diff --git a/systemd/.config/systemd/user/background.timer b/systemd/.config/systemd/user/background.timer new file mode 100644 index 00000000..09301755 --- /dev/null +++ b/systemd/.config/systemd/user/background.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Change Wallpaper every minute + +[Timer] +OnBootSec=1min +OnUnitActiveSec=1min + +[Install] +WantedBy=timers.target diff --git a/systemd/.config/systemd/user/randomBackground b/systemd/.config/systemd/user/randomBackground new file mode 100755 index 00000000..9115ccf1 --- /dev/null +++ b/systemd/.config/systemd/user/randomBackground @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +backgroundDir="$HOME/Pictures/wallpapers/" + +ls "$backgroundDir" | /usr/bin/shuf -n 1 | /usr/bin/awk \ +"{print \"$backgroundDir\" \$1}" | /usr/bin/xargs /usr/bin/feh --bg-fill