From 95fb4377d328e428f5e07ff154e06780e4166ece Mon Sep 17 00:00:00 2001 From: Urbain Vaes Date: Wed, 20 Sep 2017 20:24:45 +0100 Subject: [vim] Make minor changes --- bin/bin/workspace | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/bin/workspace b/bin/bin/workspace index e380f98..79ff834 100755 --- a/bin/bin/workspace +++ b/bin/bin/workspace @@ -20,7 +20,7 @@ target=$(echo $workspaces | dmenu "Go to workspace:") if [[ ! $target = [0-9]* ]]; then # Calculate number for new workspace - used_numbers=$(echo $workspaces | awk 'BEGIN { FS = ":" } ; { print $1 }') + used_numbers=$(echo $workspaces | awk 'BEGIN { FS = ":" } ; { print $1 }' | sort) max_number=$(echo $used_numbers | tail -1) lowest_gap=$(echo $used_numbers | awk '$1!=p+1{print p+1}{p=$1}' | head -1) [[ -z $lowest_gap ]] && new_number=$(($max_number + 1)) || new_number=$lowest_gap -- cgit v1.2.3