summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <f-p@gmx.at>2008-10-27 19:04:02 +0100
committerFlorian Pritz <f-p@gmx.at>2008-10-27 19:04:02 +0100
commit283f5e991820f025cec7ce35769d2628c99c90d2 (patch)
tree8fc8a870861f1c0de070fc95246cdf6cae296d40
parent63cf678bbc63caa8499ffddab25ccd79b9581443 (diff)
downloadbin-283f5e991820f025cec7ce35769d2628c99c90d2.tar.gz
bin-283f5e991820f025cec7ce35769d2628c99c90d2.tar.xz
added DISPLAY check to set-background.sh
-rwxr-xr-x[-rw-r--r--]reformat_fstab.pl0
-rwxr-xr-xset-background.sh13
2 files changed, 7 insertions, 6 deletions
diff --git a/reformat_fstab.pl b/reformat_fstab.pl
index 9c81d8d..9c81d8d 100644..100755
--- a/reformat_fstab.pl
+++ b/reformat_fstab.pl
diff --git a/set-background.sh b/set-background.sh
index 06d1fd7..3b2a234 100755
--- a/set-background.sh
+++ b/set-background.sh
@@ -22,8 +22,9 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-export DISPLAY=:0.0
+if [ "" = $DISPLAY ]; then
+ export DISPLAY=:0.0
+fi
if [ "$1" = "" ] || [ "$1" = "-h" ]; then
notify-send -t 10000 "Background" "Usage: set-background <file>";
@@ -31,11 +32,11 @@ if [ "$1" = "" ] || [ "$1" = "-h" ]; then
fi
FILE=$1
-if [ -f $FILE ] ; then
- echo "feh --bg-center $FILE" > "/home/flo/.fehbg";
- ln -sf "$FILE" "/home/flo/backgrounds/current_bg";
+if [ -f $FILE ]; then
+ echo "feh --bg-center ${FILE}" > "/home/flo/.fehbg";
+ ln -sf "${FILE}" "/home/flo/backgrounds/current_bg";
source /home/flo/.fehbg
else
- notify-send -t 10000 "Background" "Error: File \"$FILE\" doesn't exist";
+ notify-send -t 10000 "Background" "Error: File \"${FILE}\" doesn't exist";
exit 1
fi