aboutsummaryrefslogtreecommitdiff
path: root/fish/functions/_fzf_search_processes.fish
diff options
context:
space:
mode:
authorIndrajith2024-07-03 02:03:35 +0530
committerIndrajith2024-07-03 02:03:35 +0530
commit824022cd1f633c70c4d2782934251616756f4668 (patch)
treea310eb4bf72b26c2d110838b8c487daaa3537bea /fish/functions/_fzf_search_processes.fish
parent57eb70137b5bbcdabdc0f02eea5477b3e5f845a1 (diff)
downloaddots-824022cd1f633c70c4d2782934251616756f4668.tar.gz
dots-824022cd1f633c70c4d2782934251616756f4668.tar.bz2
dots-824022cd1f633c70c4d2782934251616756f4668.zip
Dots Updated
* Adds GTK Themes * Adds wlogout * Adds tmux config * Adds Pywal-16-colors * Removed unwanted gtk folders * Config Updates * Fish * Hyprland * Hyprlock * Hyprpaper * waybar
Diffstat (limited to 'fish/functions/_fzf_search_processes.fish')
-rw-r--r--fish/functions/_fzf_search_processes.fish32
1 files changed, 0 insertions, 32 deletions
diff --git a/fish/functions/_fzf_search_processes.fish b/fish/functions/_fzf_search_processes.fish
deleted file mode 100644
index 133a88065..000000000
--- a/fish/functions/_fzf_search_processes.fish
+++ /dev/null
@@ -1,32 +0,0 @@
-function _fzf_search_processes --description "Search all running processes. Replace the current token with the pid of the selected process."
- # Directly use ps command because it is often aliased to a different command entirely
- # or with options that dirty the search results and preview output
- set -f ps_cmd (command -v ps || echo "ps")
- # use all caps to be consistent with ps default format
- # snake_case because ps doesn't seem to allow spaces in the field names
- set -f ps_preview_fmt (string join ',' 'pid' 'ppid=PARENT' 'user' '%cpu' 'rss=RSS_IN_KB' 'start=START_TIME' 'command')
- set -f processes_selected (
- $ps_cmd -A -opid,command | \
- _fzf_wrapper --multi \
- --prompt="Processes> " \
- --query (commandline --current-token) \
- --ansi \
- # first line outputted by ps is a header, so we need to mark it as so
- --header-lines=1 \
- # ps uses exit code 1 if the process was not found, in which case show an message explaining so
- --preview="$ps_cmd -o '$ps_preview_fmt' -p {1} || echo 'Cannot preview {1} because it exited.'" \
- --preview-window="bottom:4:wrap" \
- $fzf_processes_opts
- )
-
- if test $status -eq 0
- for process in $processes_selected
- set -f --append pids_selected (string split --no-empty --field=1 -- " " $process)
- end
-
- # string join to replace the newlines outputted by string split with spaces
- commandline --current-token --replace -- (string join ' ' $pids_selected)
- end
-
- commandline --function repaint
-end