From 64405b77b8946c9bec6056ddc0fe22cc4d5f0f1d Mon Sep 17 00:00:00 2001 From: Greenhouse George Date: Sat, 23 Aug 2014 17:33:34 -0400 Subject: [PATCH] Added random wallpaper service/script, updated i3.config to match locations --- X/i3.config | 7 +++---- X/wallpaper.service | 10 ++++++++++ X/wallpaper.sh | 15 +++++++++++++++ 3 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 X/wallpaper.service create mode 100755 X/wallpaper.sh diff --git a/X/i3.config b/X/i3.config index 16c3b98..6676da5 100644 --- a/X/i3.config +++ b/X/i3.config @@ -155,7 +155,7 @@ bar { # F key commands # Lock -bindsym $mod+F5 exec i3lock -n -c 000000 -i /home/george/.wallpaper +bindsym $mod+F5 exec i3lock -n -c 000000 -i /tmp/wallpaper bindsym $mod+F6 exec xbacklight -dec 5 bindsym $mod+F7 exec xbacklight -inc 2 @@ -171,8 +171,7 @@ assign [class="Thunderbird"] $ws7 assign [title="music"] $ws8 assign [class="Pidgin"] $ws9 - -# Load on start +# Load exec xbacklight -set 20 -exec feh --bg-fill '/home/george/.wallpaper' exec nm-applet +exec feh --bg-fill /tmp/wallpaper diff --git a/X/wallpaper.service b/X/wallpaper.service new file mode 100644 index 0000000..515f688 --- /dev/null +++ b/X/wallpaper.service @@ -0,0 +1,10 @@ +[Unit] +Description=Sets wallpaper across slim/i3/i3lock +Before=slim.service + +[Service] +Type=oneshot +ExecStart=/home/USER/.wallpaper.sh + +[Install] +WantedBy=multi-user.target diff --git a/X/wallpaper.sh b/X/wallpaper.sh new file mode 100755 index 0000000..d73f260 --- /dev/null +++ b/X/wallpaper.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# Set Slim background file here +SLIM="/usr/share/slim/themes/default/background.jpg" +# Set directory with wallpapers here +WPDIR="/home/$USER/macros/wallpapers/" + + +WP=$WPDIR$(ls -a $WPDIR | shuf -n 1) + +# Set random wallpaper as Slim background +cp $WP $SLIM + +# Symlink the wallpaper +ln -s $WP /tmp/wallpaper