From 11d6a45dfd98c075d2eb893bea58fdced5d3c8f9 Mon Sep 17 00:00:00 2001 From: Urbain Vaes Date: Tue, 19 Feb 2019 12:23:51 +0100 Subject: Fix bug in workspace script Bug description: going to the next workspace from workspace number 10 resulted in two workspaces with number 0. Reason: awk '$1 ~ /0/' matches both 0 and 10. --- bin/.local/bin/workspace | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'bin/.local') diff --git a/bin/.local/bin/workspace b/bin/.local/bin/workspace index 3685b90..522ce64 100755 --- a/bin/.local/bin/workspace +++ b/bin/.local/bin/workspace @@ -41,7 +41,8 @@ act_on_workspace() { [[ $1 = 'n' ]] && new_number=$(( (11+focused_number+1) % 11 )) [[ $1 = 'p' ]] && new_number=$(( (11+focused_number-1) % 11 )) - next=$(echo "${workspaces}" | awk '$1 ~ /'$new_number'/ {print $2}') + next=$(echo "${workspaces}" | awk '$1=='$new_number' {print $2}') + echo $next i3-msg rename workspace to "${new_number}":"${focused_name}" -- cgit v1.2.3