summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUrbain Vaes <urbain@vaes.uk>2019-02-19 12:23:51 +0100
committerUrbain Vaes <urbain@vaes.uk>2019-02-19 12:23:51 +0100
commit11d6a45dfd98c075d2eb893bea58fdced5d3c8f9 (patch)
tree8d52edf7d314765c7f246dd5cfa18f78e0dfa9fc
parent80d6a1408977fb47a361c3c5da4dd178acfca9f5 (diff)
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.
-rwxr-xr-xbin/.local/bin/workspace3
1 files changed, 2 insertions, 1 deletions
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}"