From c144f1fde510579c899574617a1cb1c98811e43f Mon Sep 17 00:00:00 2001 From: Jonathan Hodgson Date: Tue, 16 Nov 2021 10:22:40 +0000 Subject: [PATCH] Moves and tweaks some systemd timers / services --- .gitignore | 4 ++-- systemd/.config/systemd/user/randomBackground | 6 ------ .../.config/systemd/user/background.service | 0 .../.config/systemd/user/background.timer | 1 + .../.config/systemd/user/checkStock | 0 systemd/HOME/.config/systemd/user/lookAway | 3 +++ .../.config/systemd/user/lookAway.service | 8 +++++++ .../HOME/.config/systemd/user/lookAway.timer | 9 ++++++++ .../.config/systemd/user/monitorModem.service | 0 .../.config/systemd/user/randomBackground | 21 +++++++++++++++++++ .../.config/systemd/user/stock.service | 0 .../.config/systemd/user/stock.timer | 0 12 files changed, 44 insertions(+), 8 deletions(-) delete mode 100755 systemd/.config/systemd/user/randomBackground rename systemd/{ => HOME}/.config/systemd/user/background.service (100%) rename systemd/{ => HOME}/.config/systemd/user/background.timer (88%) rename systemd/{ => HOME}/.config/systemd/user/checkStock (100%) create mode 100755 systemd/HOME/.config/systemd/user/lookAway create mode 100644 systemd/HOME/.config/systemd/user/lookAway.service create mode 100644 systemd/HOME/.config/systemd/user/lookAway.timer rename systemd/{ => HOME}/.config/systemd/user/monitorModem.service (100%) create mode 100755 systemd/HOME/.config/systemd/user/randomBackground rename systemd/{ => HOME}/.config/systemd/user/stock.service (100%) rename systemd/{ => HOME}/.config/systemd/user/stock.timer (100%) diff --git a/.gitignore b/.gitignore index 48bd772d..512e2c13 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,7 @@ mutt/accounts/* /qutebrowser/.config/qutebrowser/qsettings/ /qutebrowser/.config/qutebrowser/autoconfig.yml /bin/.bin/pappy -/systemd/.config/systemd/user/timers.target.wants/ -/systemd/.config/systemd/user/default.target.wants/ +/systemd/HOME/.config/systemd/user/timers.target.wants/ +/systemd/HOME/.config/systemd/user/default.target.wants/ nvim/.config/nvim/.netrwhist remind/.local/share/remind/work.rem diff --git a/systemd/.config/systemd/user/randomBackground b/systemd/.config/systemd/user/randomBackground deleted file mode 100755 index 9115ccf1..00000000 --- a/systemd/.config/systemd/user/randomBackground +++ /dev/null @@ -1,6 +0,0 @@ -#!/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 diff --git a/systemd/.config/systemd/user/background.service b/systemd/HOME/.config/systemd/user/background.service similarity index 100% rename from systemd/.config/systemd/user/background.service rename to systemd/HOME/.config/systemd/user/background.service diff --git a/systemd/.config/systemd/user/background.timer b/systemd/HOME/.config/systemd/user/background.timer similarity index 88% rename from systemd/.config/systemd/user/background.timer rename to systemd/HOME/.config/systemd/user/background.timer index 09301755..3e9b1859 100644 --- a/systemd/.config/systemd/user/background.timer +++ b/systemd/HOME/.config/systemd/user/background.timer @@ -3,6 +3,7 @@ Description=Change Wallpaper every minute [Timer] OnBootSec=1min +OnActiveSec=1min OnUnitActiveSec=1min [Install] diff --git a/systemd/.config/systemd/user/checkStock b/systemd/HOME/.config/systemd/user/checkStock similarity index 100% rename from systemd/.config/systemd/user/checkStock rename to systemd/HOME/.config/systemd/user/checkStock diff --git a/systemd/HOME/.config/systemd/user/lookAway b/systemd/HOME/.config/systemd/user/lookAway new file mode 100755 index 00000000..3a3d363a --- /dev/null +++ b/systemd/HOME/.config/systemd/user/lookAway @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +notify-send "Look Away" diff --git a/systemd/HOME/.config/systemd/user/lookAway.service b/systemd/HOME/.config/systemd/user/lookAway.service new file mode 100644 index 00000000..521bace4 --- /dev/null +++ b/systemd/HOME/.config/systemd/user/lookAway.service @@ -0,0 +1,8 @@ +[Unit] +Description=Look Away + +[Service] +ExecStart=/home/jonathan/.config/systemd/user/lookAway + +[Install] +WantedBy=default.target diff --git a/systemd/HOME/.config/systemd/user/lookAway.timer b/systemd/HOME/.config/systemd/user/lookAway.timer new file mode 100644 index 00000000..49ba9854 --- /dev/null +++ b/systemd/HOME/.config/systemd/user/lookAway.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Remind me to look away every 15 minutes + +[Timer] +OnBootSec=15min +OnUnitActiveSec=15min + +[Install] +WantedBy=timers.target diff --git a/systemd/.config/systemd/user/monitorModem.service b/systemd/HOME/.config/systemd/user/monitorModem.service similarity index 100% rename from systemd/.config/systemd/user/monitorModem.service rename to systemd/HOME/.config/systemd/user/monitorModem.service diff --git a/systemd/HOME/.config/systemd/user/randomBackground b/systemd/HOME/.config/systemd/user/randomBackground new file mode 100755 index 00000000..7912efed --- /dev/null +++ b/systemd/HOME/.config/systemd/user/randomBackground @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +backgroundDir="$HOME/Pictures/wallpapers/" +background="$(ls "$backgroundDir" | /usr/bin/shuf -n 1 | /usr/bin/awk \ +"{print \"$backgroundDir\" \$1}")" + +echo "Wayland Display: $WAYLAND_DISPLAY" + +if [ -n "$WAYLAND_DISPLAY" ]; then + while :; do + background="$(ls "$backgroundDir" | /usr/bin/shuf -n 1 | /usr/bin/awk \ + "{print \"$backgroundDir\" \$1}")" + echo "I get here" + pkill swaybg + swaybg --mode fill -i "$background" + sleep 60 + done +else + /usr/bin/feh --bg-fill "$background" +fi + diff --git a/systemd/.config/systemd/user/stock.service b/systemd/HOME/.config/systemd/user/stock.service similarity index 100% rename from systemd/.config/systemd/user/stock.service rename to systemd/HOME/.config/systemd/user/stock.service diff --git a/systemd/.config/systemd/user/stock.timer b/systemd/HOME/.config/systemd/user/stock.timer similarity index 100% rename from systemd/.config/systemd/user/stock.timer rename to systemd/HOME/.config/systemd/user/stock.timer