summaryrefslogtreecommitdiff
path: root/zshrc
diff options
context:
space:
mode:
Diffstat (limited to 'zshrc')
-rw-r--r--zshrc33
1 files changed, 12 insertions, 21 deletions
diff --git a/zshrc b/zshrc
index 2f16e98..7036172 100644
--- a/zshrc
+++ b/zshrc
@@ -163,30 +163,21 @@ function x () {
fi
}
-function scrot () {
- if [[ -z $1 ]]; then
- print -P "Usage: scrot [basename] [format]"
- print -P "Take a desktop screenshot and generate a thumbnail."
- else
- if [ $2 ]; then
- format=$2
- else
- format=png
- fi
- timestamp=`date +%d%m%y-%H%M`
- echo "Taking a screenshot..."
- import -window root -quality 100 ~/$1-$timestamp.$format
- echo "Generating a thumbnail..."
- convert -resize 15% ~/$1-$timestamp.$format ~/$1-$timestamp.th.$format
- echo "Saved as ~/$1-$timestamp.$format"
- fi
+function snap () {
+ [ $2 ] && tmout=$2 || tmout=5
+ [ $3 ] && format=$3 || format=png
+ timestamp=`date +%d%m%y-%H%M`
+ echo -n "Snapshot in "
+ for (( i = $tmout; i >= 1; i-- )) do
+ echo -n "$i.. "; sleep 1
+ done
+ import -window root -quality 100 ~/$1-$timestamp.$format
+ convert -resize "15%" ~/$1-$timestamp.$format ~/$1-$timestamp.th.$format
+ echo "saved as: ~/$1-$timestamp.$format"
}
function extract () {
- if [[ -z "$1" ]]; then
- print -P "Usage: extract filename"
- print -P "Extract a given file based on the extension."
- elif [[ -f "$1" ]]; then
+ if [[ -f "$1" ]]; then
case "$1" in
*.tbz2 | *.tar.bz2) tar -xvjf "$1" ;;
*.txz | *.tar.xz) tar -xvJf "$1" ;;