From 2b3294fcb6d9da40f1fc221a332e99b374edecc1 Mon Sep 17 00:00:00 2001 From: Artem Sapegin Date: Wed, 19 Dec 2012 16:59:34 +0400 Subject: [PATCH] Bash: cleandesktop function. --- docs/Bash.md | 4 ++++ includes/bash_functions.bash | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/docs/Bash.md b/docs/Bash.md index a1e3dc6..a700467 100644 --- a/docs/Bash.md +++ b/docs/Bash.md @@ -54,6 +54,10 @@ Extract archives of various types. Empty the Trash on all mounted volumes and the main HDD. Also, clear Appleā€™s System Logs to improve shell startup speed. +### cleandesktop + +Remove screenshots from desktop. + ### show / hide Show/hide hidden files in Finder. diff --git a/includes/bash_functions.bash b/includes/bash_functions.bash index 9f3258d..855ae15 100644 --- a/includes/bash_functions.bash +++ b/includes/bash_functions.bash @@ -49,6 +49,15 @@ function codepoint() { echo # newline } +# Remove screenshots from desktop +function cleandesktop() { + header "Cleaning desktop..." + for file in ~/Desktop/Screen\ Shot*.png; do + unlink "$file" + done + echo +} + # Extract archives of various types function extract() { if [ -f $1 ] ; then