14 lines
391 B
Bash
Executable File
14 lines
391 B
Bash
Executable File
#!/bin/bash
|
|
|
|
num=`i3-msg -t get_workspaces | jq 'map(select(.focused == true))[0].num'`
|
|
i3-input -F "rename workspace to \"$num:%s\"" -P 'New name: '
|
|
|
|
name=`i3-msg -t get_workspaces | jq 'map(select(.focused == true))[0].name'`
|
|
# If empty name was set
|
|
echo "$name"
|
|
if [[ "$name" =~ ^\"[0-9]+:\ *\"$ ]]
|
|
then
|
|
# Remove trailing comma and whitespace
|
|
i3-msg "rename workspace to \"$num\""
|
|
fi
|