diff options
author | Urbain Vaes <urbain@vaes.uk> | 2019-02-19 12:23:51 +0100 |
---|---|---|
committer | Urbain Vaes <urbain@vaes.uk> | 2019-02-19 12:23:51 +0100 |
commit | 11d6a45dfd98c075d2eb893bea58fdced5d3c8f9 (patch) | |
tree | 8d52edf7d314765c7f246dd5cfa18f78e0dfa9fc /bin/.local | |
parent | 80d6a1408977fb47a361c3c5da4dd178acfca9f5 (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.
Diffstat (limited to 'bin/.local')
-rwxr-xr-x | bin/.local/bin/workspace | 3 |
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}" |