dotfiles/de/home/.config/sway/scripts/ws-rename
2024-04-10 17:15:03 -06:00

11 lines
414 B
Bash
Executable file

#!/bin/bash
active_wsname=$(swaymsg -t get_workspaces | jq '.[] | select(.focused==true) | .name')
ws_prefix=$(echo $active_wsname | tr -d '"' | grep -o "[1-9]*:[^a-zA-Z1-9]")
wsname=$(echo "${active_wsname}" | sed 's/'"${ws_prefix}"'//'| tr -d '"')
echo $wsname
new_wsname="${ws_prefix}$(wofi -i --dmenu --height 1 --search ${wsname})"
swaymsg 'rename workspace "'"${active_wsname}"'" to "'"${new_wsname}"'"'