feat: Moves preview-stats script into hypr/utils/fzf

This commit is contained in:
2025-10-08 11:31:06 -04:00
parent fd22a4ab4a
commit 4674b132f3
6 changed files with 5 additions and 5 deletions

View File

@@ -118,7 +118,7 @@ sel=$(
printf "%s\n" "${rows[@]}" |
fzf --style=full --footer="$(footer)" --with-nth=2 --delimiter='|' \
--preview-label='[ Command ]' \
--preview="$SCRIPTS/hypr/preview-stats utils {2} $config_file"
--preview="$SCRIPTS/hypr/utils/fzf/preview-stats utils {2} $config_file"
)
log "Selection: $sel"

View File

@@ -98,7 +98,7 @@ sel=""
# For some reason can't get the preview to work when setting in the fzf_opts array.
if [[ $no_preview_flag == "0" ]]; then
sel=$(printf '%s\n' "${rows[@]}" | fzf "${fzf_opts[@]}" --preview="$SCRIPTS/hypr/preview-stats monitor {1}")
sel=$(printf '%s\n' "${rows[@]}" | fzf "${fzf_opts[@]}" --preview="$SCRIPTS/hypr/utils/fzf/preview-stats monitor {1}")
else
sel=$(printf '%s\n' "${rows[@]}" | fzf "${fzf_opts[@]}")
fi

View File

@@ -172,7 +172,7 @@ make_selection() {
--delimiter=':' --with-nth=3 \
--header="What should we do with the selected window?" \
--preview-label="[ Description ]" \
--preview='echo -e {2} | fmt -w ${FZF_PREVIEW_COLUMNS:-40}; echo -e "\n\n\e[35mSelected Window:\e[0m"; "$SCRIPTS/hypr/preview-stats" window {1} "{title, workspace, address, floating}";'
--preview='echo -e {2} | fmt -w ${FZF_PREVIEW_COLUMNS:-40}; echo -e "\n\n\e[35mSelected Window:\e[0m"; "$SCRIPTS/hypr/utils/fzf/preview-stats" window {1} "{title, workspace, address, floating}";'
)
# Exit if non-zero code returned from making selection.
[[ $? -gt 0 ]] && log --error "Unexpected fzf status: $?" && exit $?

View File

@@ -83,7 +83,7 @@ show_picker() {
# Setup logging file and label.
source "$SCRIPTS/hypr/logging"
setup-logging "$LOG_LABEL"
setup-logging "$LOG_FILE" "$LOG_LABEL"
while [[ $# -gt 0 ]]; do
if [[ $1 == "action" ]]; then

View File

@@ -93,7 +93,7 @@ sel=$(
printf "%s\n" "${rows[@]}" |
fzf --style=full "${fzf_opts[@]}" --delimiter='|' --with-nth=2 \
--preview-label='[ Workspace Stats ]' \
--preview="$SCRIPTS/hypr/preview-stats workspace {1}"
--preview="$SCRIPTS/hypr/utils/fzf/preview-stats workspace {1}"
)
[[ -z $sel ]] && exit 1