Feat: Updates pickers so delimiters are not showing in selections.

This commit is contained in:
2025-10-05 10:31:16 -04:00
parent 6d6f24467f
commit 5e8fbbcbab
3 changed files with 8 additions and 11 deletions

View File

@@ -58,7 +58,7 @@ generate_rows() {
# Zip into rows.
for i in "${!addresses[@]}"; do
rows+=("${workspaces[i]}=>${titles[i]}=>${classes[i]}=>${addresses[i]}")
rows+=("${addresses[i]}|${workspaces[i]}|${classes[i]}|${titles[i]}")
done
}
@@ -79,15 +79,12 @@ generate_rows
sel=$(
printf '%s\n' "${rows[@]}" |
fzf --style=full "${fzf_opts[@]}" \
--preview-label='[ Window Stats ]' --delimiter='=>' --with-nth=2 \
--preview='echo -e "Title: {2}\nClass: {3}\nWorkspace: {1}\nAddress: {4}"'
--preview-label='[ Window Stats ]' --delimiter='|' --with-nth=4 \
--preview='echo -e "Title: {4}\nClass: {3}\nWorkspace: {2}\nAddress: {1}"'
)
[[ -z $sel ]] && exit 1
# remove spaces and quotes from result.
sel=${sel//\"/}
sel=${sel// /}
# revove everything but the address portion.
sel=${sel##*=>}
sel=${sel%%|*}
echo "$sel"

View File

@@ -93,9 +93,9 @@ fi
sel=$(
printf "%s\n" "${rows[@]}" |
fzf --style=full "${fzf_opts[@]}" \
--delimiter='|' --with-nth=4 --preview-label='[ Workspace Stats ]' \
--preview='printf "Name: {4}\nID: {1}\nWindows: {2}\nMonitor: {3}"'
fzf --style=full "${fzf_opts[@]}" --delimiter='|' --with-nth=4 \
--preview-label='[ Workspace Stats ]' \
--preview='printf "Name: {4}\nID: {1}\nWindows: {3}\nMonitor: {2}"'
)
[[ -z $sel ]] && exit 1