Created
June 14, 2024 07:16
-
-
Save neilbags/913cbe2c541edea64b85c78711d47ece to your computer and use it in GitHub Desktop.
Rename a workspace dynamically in sway using wofi for input
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Get the current workspace number | |
current_workspace=$(swaymsg -t get_workspaces | jq -r '.[] | select(.focused) | .name') | |
# Extract the number from the current workspace name | |
workspace_number=$(echo $current_workspace | grep -o '^[0-9]*') | |
new_name=`wofi --dmenu --prompt='Workspace Name:'` | |
if [ -n "$new_name" ]; then | |
new_name=:$new_name | |
fi | |
swaymsg rename workspace to $workspace_number$new_name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment