Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update toggle-able ctrl-v (systemctl cat) #31

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions sysz
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ _sysz_keys() {
cat <<EOF
Keybindings:
TAB Toggle selection.
ctrl-v 'cat' the unit in the preview window.
ctrl-v Toggle 'cat' the unit in the preview window.
ctrl-s Select states to match. Selection is reset.
ctrl-r Run daemon-reload. Selection is reset.
ctrl-p History previous.
Expand All @@ -25,7 +25,7 @@ EOF
}

_sysz_help() {
cat >&2 <<EOF
cat <<EOF # https://github.com/joehillen/sysz/pull/29#issue-2044616077
A utility for using systemctl interactively via fzf.

Usage: $PROG [OPTS...] [CMD] [-- ARGS...]
Expand Down Expand Up @@ -422,7 +422,10 @@ while :; do
--prompt="Units: " \
--header '? for keybindings' \
--bind "?:preview(echo '$(_sysz_keys)')" \
--bind "ctrl-v:preview('${BASH_SOURCE[0]}' _fzf_cat {})" \
--bind 'ctrl-v:transform:[[ ! $FZF_PROMPT =~ CAT ]] &&
echo "change-prompt(CAT )+preview('${BASH_SOURCE[0]}' _fzf_cat {})" ||
echo "change-prompt(Units: )+preview('${BASH_SOURCE[0]}' _fzf_preview {})"' \
--bind 'focus:change-prompt(Units: )' \
--preview="'${BASH_SOURCE[0]}' _fzf_preview {}" \
--preview-window=70% |
readarray -t PICKS
Expand Down