aboutsummaryrefslogtreecommitdiff
path: root/rename_workspace
blob: adfda6543c79c2524d34cc8066a975503d28ac71 (plain)
1
2
3
4
5
6
#!/bin/bash
OLD=$(i3-msg -t 'get_workspaces' | sed -e 's/{"num/\n{"num/g' | grep \"focused\":true | sed -e 's/,"/\n/g' | grep name | cut -d\" -f 3)
NEW=$(zenity --text="Enter new name:" --entry --title="Rename workspace $OLD" --entry-text="$OLD")
i3-msg "rename workspace \"$OLD\" to \"$NEW\"" 
sed ~/.i3/config -i -e "s,^set \$\(ws[0-9]\+\) \"$OLD\",set \$\1 \"$NEW\","
i3-msg reload