Code Monkey home page Code Monkey logo

Comments (9)

pystardust avatar pystardust commented on August 11, 2024

It is to uniquely identify a video.
I could have removed it and researched the field using grep but that doesnt work 100% with some titles having wierd characters.

I will remove the urls and replace them by serial numbers to make it look clean.

One more solution is to alter the width, if the width is big enough the url will be hidden. Ill add this as a default in the fzf version.

from ytfzf.

se7en-x230 avatar se7en-x230 commented on August 11, 2024

Excellent idea with the ID looks much cleaner.
My 14" x230 has not much screen :)

Finally a usable solution with the most amount of Info's.
Especially with the youtube-dowoad mpv plugin.

Love the work.

from ytfzf.

pystardust avatar pystardust commented on August 11, 2024

Thankyou,

I am not a programmer, and this is my first proper project. Please do let me know if you find me making mistakes.

The current version auto resizes the search result fields based on the terminal size.

format_fzf () {
	dur_len=7
	view_len=10
	date_len=14
	url_len=12

	t_size="$(stty size | cut -f2 -d' ')"    # This gives you terminal size
	if [ $t_size -lt 75 ]; then
		# title channel
		frac=$(((t_size - 1)/4))
		title_len=$((frac * 3))
		channel_len=$((frac * 1 + 7))
	elif [ $t_size -lt 95 ]; then
		# title channel time
		frac=$(((t_size - 4)/8))
		title_len=$((frac * 5 - 1))
		channel_len=$((frac * 2 - 1))
		dur_len=$((frac * 1 + 10))
	elif [ $t_size -lt 110 ]; then
		# title channel time views
		frac=$(((t_size - 1)/9))
		title_len=$((frac * 5 ))
		channel_len=$((frac * 2 ))
		dur_len=$((frac * 1))
		view_len=$((frac * 1 + 7))
	elif [ $t_size -lt 130 ]; then
		# title channel time views date
		frac=$(((t_size - 5)/11))
		title_len=$((frac * 5 - 1))
		channel_len=$((frac * 2))
		dur_len=$((frac * 1))
		view_len=$((frac * 1))
		date_len=$((frac * 2 + 20))
	else    # all
		frac=$(((t_size - 5 - 12)/11))
		title_len=$((frac * 6 - 1))
		channel_len=$((frac * 3/2))
		dur_len=$((frac * 1))
		view_len=$((frac * 1))
-		date_len=$((frac * 3/2 ))
+		date_len=$((frac * 3/2 + 20 ))
	fi
}

One solution could be to push the url to the right by changing the last line as such
I will replace url with serial no. in the next push.

from ytfzf.

pystardust avatar pystardust commented on August 11, 2024

I have updated fzf formatting to hide the urls

from ytfzf.

se7en-x230 avatar se7en-x230 commented on August 11, 2024

that's how it looks on a 14"
https://imagebin.ca/v/5slnhrIkHgzP

Thanks

from ytfzf.

pystardust avatar pystardust commented on August 11, 2024

The image doesnt seem to open can you it send again.

from ytfzf.

westofer avatar westofer commented on August 11, 2024

image

from ytfzf.

pystardust avatar pystardust commented on August 11, 2024

Okay, so the width is too much since your screen size is low.

YTFZF_EXTMENU_LEN=150 ytfzf -D

Run this for different values, till you find something you are comfortable with .
Then export it in your rc files (example: ~/.bashrc)

export YTFZF_EXTMENU_LEN=150

from ytfzf.

pystardust avatar pystardust commented on August 11, 2024

@se7en-x230
Let me know if this solves the width issue you are facing.

from ytfzf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.