From 64cfb306cc543fd28d2cb3ce7adadad15a8d96e6 Mon Sep 17 00:00:00 2001 From: Urbain Vaes Date: Thu, 17 Dec 2015 17:18:50 +0000 Subject: Restore initial version of script --- bin/workspace | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'bin/workspace') diff --git a/bin/workspace b/bin/workspace index 5b49049..73a4ec4 100755 --- a/bin/workspace +++ b/bin/workspace @@ -1,13 +1,14 @@ #!/bin/zsh workspaces=$(i3-msg -t get_workspaces | grep -Po '"name":.*?[^\\]"' | sed 's/"name":"\([^"]\+\)"/\1/g') -used_numbers=$(echo $workspaces | awk 'BEGIN { FS = ":" } ; { print $1 }') -max_number=$(echo $used_numbers | tail -1) -largest_gap=$(echo $used_numbers | awk '$1!=p+1{print p+1}{p=$1}') -[[ -z $largest_gap ]] && new_number=$(($max_number + 1)) || new_number=$largest_gap +# used_numbers=$(echo $workspaces | awk 'BEGIN { FS = ":" } ; { print $1 }') +# max_number=$(echo $used_numbers | tail -1) +# largest_gap=$(echo $used_numbers | awk '$1!=p+1{print p+1}{p=$1}') +# [[ -z $largest_gap ]] && new_number=$(($max_number + 1)) || new_number=$largest_gap -target=$(echo $workspaces | dmenu -i -sf green -p "Go to workspace:") -[[ -z $target ]] && exit -[[ ! $target = [0-9]* ]] && target=$new_number:$target +# target=$(echo $workspaces | dmenu -i -sf green -p "Go to workspace:") +# [[ -z $target ]] && exit +# [[ ! $target = [0-9]* ]] && target=$new_number:$target +target=$(echo $workspaces | dmenu -i -sf green -p "Go to workspace:") exec i3-msg workspace $target -- cgit v1.2.3