Commit 485b8d72 authored by Glen Mével's avatar Glen Mével

`i3-rename-workspace`: interactively rename the current workspace in the i3 window manager

parent 27860317
#!/bin/bash
# Get the current name.
if command -v jq >/dev/null ; then
old_name="$(i3-msg -t get_workspaces | jq '.[] | select(.focused==true).name' -r)"
else
old_name=""
fi
# Ask the new name.
new_name=`i3-input -P "rename '$old_name' to " | grep '^command = '`
# If the user aborted, we cancel the renaming.
if [ -z "$new_name" ] ; then
exit 2
fi
new_name="${new_name#command = }"
exec i3-msg "$(printf 'rename workspace "%s" to "%s"' "$old_name" "$new_name")"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment