summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorUrbain Vaes <urbain@vaes.uk>2017-09-20 20:24:45 +0100
committerUrbain Vaes <urbain@vaes.uk>2017-10-14 16:29:00 +0200
commit95fb4377d328e428f5e07ff154e06780e4166ece (patch)
tree408e68e50dc0059d587a7b93ad3703e0e834dc7e /bin
parenta8224fda63571be856a0353903e6d7d1cbff45cb (diff)
[vim] Make minor changes
Diffstat (limited to 'bin')
-rwxr-xr-xbin/bin/workspace2
1 files changed, 1 insertions, 1 deletions
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