#!/bin/sh #---------------------------------------------------- # Version: 0.2.0 # Author: Florian "Bluewind" Pritz # # Licensed under WTFPL v2 # (see COPYING for full license text) # #---------------------------------------------------- # Usage: set-background.sh # Sets background using feh and creates # symlink for slim #---------------------------------------------------- if [ "" = $DISPLAY ]; then export DISPLAY=:0.0 fi if [ "$1" = "" ] || [ "$1" = "-h" ]; then notify-send -t 10000 "Background" "Usage: set-background <file>"; exit 1 fi cd "$(dirname "$1")" FILE="$(pwd)/$(basename "$1")" if [ -f "$FILE" ]; then #echo "feh --bg-tile '${FILE}'" > "$HOME/.fehbg"; echo "habak -mS '${FILE}'" > "$HOME/.bg"; #rm "$HOME/backgrounds/current_bg"; #ln -sf "${FILE}" "$HOME/backgrounds/current_bg"; source $HOME/.bg else notify-send -t 10000 "Background" "Error: File \"${FILE}\" doesn't exist"; exit 1 fi