Skip to content

Creating a custom modal #1699

Answered by DusanLesan
0xayko asked this question in Q&A
Apr 30, 2024 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

@aayko I was playing with the flow proposed here: #1700
This is closest I could get so far:

map T &{{
	tmux split-window -l 1 '
		stty -icanon -echo
		echo -n "Trash files? [y/n] "
		key=$(dd bs=1 count=1 2>/dev/null)
		if [[ "$key" == "y" ]]; then
			while IFS= read -r file; do
				notify-send "Trashing file: $file"
			done <<< "'"$fx"'"
			lf -remote "send '$id' reload"
		fi
	'
}}

The solution requires you to have tmux installed, to know how to use it, and have lf started from tmux session like tmux new-session 'lf'. I could not find more elegant solution for taking single key that worked in tmux.
This is how it looks:

output.mp4

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@joelim-work
Comment options

@0xayko
Comment options

Answer selected by 0xayko
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants