From f728f08e7b4cfaa33f92b7249eefcb33067502f9 Mon Sep 17 00:00:00 2001 From: "Adrian C. (anrxc)" Date: Fri, 25 Dec 2009 02:38:18 +0100 Subject: zshrc: turn alias x into a function --- zshrc | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'zshrc') diff --git a/zshrc b/zshrc index ae2bc72..2f16e98 100644 --- a/zshrc +++ b/zshrc @@ -70,7 +70,6 @@ alias du='du -hc' alias dus='du -S | sort -n' alias free='free -m' alias su='su - ' -alias x='startx' alias rehash='hash -r' alias eject='eject -v ' alias retract='eject -t -v ' @@ -157,10 +156,11 @@ function web () { $BROWSER "http://yubnub.org/parser/parse?command=$*" } function pmem () { ps -o rss,comm -p $(pgrep $1) } function dsync () { rsync -lprt --progress --stats --delete "$1/" "$2/" } -function define () { - dictionary="english" - [[ "$2" != "" ]] && dictionary=$2 - echo "DEFINE $dictionary $1\nQUIT" | netcat dict.org 2628 +function x () { + if [[ -z "$DISPLAY" ]] && [[ $(tty) = /dev/tty1 ]]; then + startx + logout + fi } function scrot () { @@ -177,8 +177,7 @@ function scrot () { echo "Taking a screenshot..." import -window root -quality 100 ~/$1-$timestamp.$format echo "Generating a thumbnail..." - cp ~/$1-$timestamp.$format ~/$1-$timestamp.th.$format - mogrify -resize 15% ~/$1-$timestamp.th.$format + convert -resize 15% ~/$1-$timestamp.$format ~/$1-$timestamp.th.$format echo "Saved as ~/$1-$timestamp.$format" fi } -- cgit v1.2.3