From cfbb2e6602620640a686d551b753322e638ac374 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Thu, 27 Oct 2016 14:45:46 -0700 Subject: [PATCH] [Linux] Update wallpaper service --- dotfiles/config/systemd/user/wallpaper.service | 4 +--- dotfiles/lib/bin/wallpaper.sh | 15 +-------------- dotfiles/lib/shellenv/wallpaper.sh | 15 +++++++++++++++ 3 files changed, 17 insertions(+), 17 deletions(-) create mode 100644 dotfiles/lib/shellenv/wallpaper.sh diff --git a/dotfiles/config/systemd/user/wallpaper.service b/dotfiles/config/systemd/user/wallpaper.service index e9fb1dd5..99cf9253 100644 --- a/dotfiles/config/systemd/user/wallpaper.service +++ b/dotfiles/config/systemd/user/wallpaper.service @@ -1,10 +1,8 @@ [Unit] Description=wallpaper -Requires=compton.service -After=compton.service [Service] -Type=simple +Type=oneshot ExecStart=/usr/bin/env wallpaper.sh ExecStop=/usr/bin/pkill wallpaper.sh diff --git a/dotfiles/lib/bin/wallpaper.sh b/dotfiles/lib/bin/wallpaper.sh index 15bd9304..48e4fac2 100755 --- a/dotfiles/lib/bin/wallpaper.sh +++ b/dotfiles/lib/bin/wallpaper.sh @@ -1,16 +1,3 @@ -#!/usr/bin/env bash - -WALLPAPER_DIR="$HOME/Pictures/wallpaper/" - -random_paper() { - find "$WALLPAPER_DIR"use -type l | shuf -n1 -} - -wallpaper() { - while true; do - feh --bg-center $(random_paper) --bg-scale "$WALLPAPER_DIR"transparent1x1.png - sleep 10m - done -} +#!/usr/bin/env zsh wallpaper diff --git a/dotfiles/lib/shellenv/wallpaper.sh b/dotfiles/lib/shellenv/wallpaper.sh new file mode 100644 index 00000000..f8df038c --- /dev/null +++ b/dotfiles/lib/shellenv/wallpaper.sh @@ -0,0 +1,15 @@ +WALLPAPER_DIR="$HOME/Pictures/wallpaper/" + +random_paper() { + find "$WALLPAPER_DIR"use -type l | shuf -n1 +} + +wallpaper() { + feh --bg-center $(random_paper) --bg-scale "$WALLPAPER_DIR"transparent1x1.png +} + +wallpaper_timer() { + while true; do + sleep 10m + done +}