linux-config/files/dotfiles/shellconfig/workspaces/delete_workspace.sh
Sagi Dayan 79ab87fa07
Simple tmux based workspace manager
- tmux key-bindings for save/open/delete workspace
- each workspace has a layout based on common.sh functions such as `ide` `grid` and `layout`
2022-01-22 17:25:21 +02:00

17 lines
368 B
Bash
Executable file

#!/bin/bash
JSON_PATH=~/.shellconfig/workspaces/workspaces.json
WSP=$(cat ${JSON_PATH} \
| jq -r 'keys[]' \
| fzf --reverse --header "Select a Workspace to DELETE"
)
if [ -z $WSP ]; then
echo "Aborted"
exit 1
fi
echo $(cat ${JSON_PATH} | jq --arg WSP "$WSP" 'del(.[$WSP])') > ${JSON_PATH}
echo "⚠️ '${WSP}' Was removed from your workspaces"