aboutsummaryrefslogtreecommitdiff
path: root/rename_workspace
blob: d6f57414169585669d585a186b87933862c7b5c7 (plain)
1
2
3
4
5
6
7
#!/bin/bash
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