aboutsummaryrefslogtreecommitdiff
path: root/rename_workspace
blob: 75bdea653a4bd22166df9209945d6582236c1ded (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 ~/.config/i3/config -i -e "s,^set \$\(ws[0-9]\+\) \"$OLD\",set \$\1 \"$NEW\","
i3-msg reload