aboutsummaryrefslogtreecommitdiff
path: root/rename_workspace
blob: e80230d2ce94f14b96836b22540b3b0ab15b23e1 (plain)
1
2
3
4
5
6
#!/bin/bash
OLD=$(i3-msg -t 'get_workspaces' | jq -c '.[] | select(.visible) | .name' | sed -e 's/"//g')
NEW=$(zenity --text="Enter new name:" --entry --title="Rename workspace $OLD" --entry-text="$OLD")
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