#!/bin/bash

_LINES=$(pgrep wallpapers.sh)

while read -r line
do
  (("$line" != "$$")) && kill "$line"
done <<< "$_LINES"

while (( $(pgrep i3) ))
do
  feh --randomize --bg-max /usr/local/share/wallpapers
  sleep 10
done
