diff options
| author | Calvin Morrison <calvin@fastmailteam.com> | 2022-07-21 12:32:19 -0400 | 
|---|---|---|
| committer | Calvin Morrison <calvin@fastmailteam.com> | 2022-07-21 12:32:19 -0400 | 
| commit | c996f79ce056b7d8a19825d9812ced4e51c50d04 (patch) | |
| tree | 9069430c5467bf67470c2b0a7da062c89bc2fad2 /rename_workspace | |
| parent | 5c24e440c62005e26380504503d5aecd7abc457b (diff) | |
- with multihead, you need to select for .focused
- if zentiy exits, you won't have a replacement title. fail if its empty.
Diffstat (limited to 'rename_workspace')
| -rwxr-xr-x | rename_workspace | 3 | 
1 files changed, 2 insertions, 1 deletions
diff --git a/rename_workspace b/rename_workspace index e80230d..d6f5741 100755 --- a/rename_workspace +++ b/rename_workspace @@ -1,6 +1,7 @@  #!/bin/bash -OLD=$(i3-msg -t 'get_workspaces' | jq -c '.[] | select(.visible) | .name' | sed -e 's/"//g') +OLD=$(i3-msg -t 'get_workspaces' | jq -c '.[] | select(.visible) | select(.focused) |  .name' | sed -e 's/"//g')  NEW=$(zenity --text="Enter new name:" --entry --title="Rename workspace $OLD" --entry-text="$OLD") +test -z "$NEW" && exit;  i3-msg "rename workspace \"$OLD\" to \"$NEW\""   sed ~/.config/i3/config -i -e "s,^set \$\(ws[0-9]\+\) \"$OLD\",set \$\1 \"$NEW\","  i3-msg reload  | 
