#!/bin/bash dmenu_style() { local font='junicode-18' local normal_bg='#000000' local normal_fg='#FFFFFF' local selected_bg='#AAAAAA' local selected_fg='#000000' echo "-fn $font -nb $normal_bg -nf $normal_fg -sb $selected_bg -sf $selected_fg" } # Make it POSIX friendlier and run with #!/bin/sh BOOKMARKS="BOOKMARKS" url=$(xclip -o -selection clipboard) url_regex="^(https?|ftp|file)://[-A-Za-z0-9+&@#/%?=~_|!:,.;]*[-A-Za-z0-9+&@#/%=~_|]" # If the given string ressembles to a url, continue. if [[ $url =~ $url_regex ]]; then echo "The string is a URL: $url" url=$(xclip -o -selection clipboard | dmenu -p "Enter the URL:" $(dmenu_style)) # what we used to need htmlq for : #name=$(curl $url | ~/.cargo/bin/htmlq title --text | sed -r '/^\s*$/d' | sed 's/^ *//g') # This is a blocking process and will pause the programm in case # internet shuts :^) name=$(curl $url awk -v RS='' ' /