clemtre
11 months ago
4 changed files with 2761 additions and 0 deletions
File diff suppressed because it is too large
@ -0,0 +1,28 @@ |
|||
unsorted list of things that would be nice to have |
|||
|
|||
* *make a make*file in order to variabilize language in add.sh prompts |
|||
and make overall config easier |
|||
* pin links |
|||
→ add an optional boolean to the records implictly false if absent. |
|||
if true, the link sits on top of the pile |
|||
* search select tags for filtering |
|||
→ tags inside \<nav> would be \<button>s instead of \<p>s and filter |
|||
the links accordingly |
|||
* a better way to capture url |
|||
→ something that grabs current page to clipboard |
|||
* hardcode bookmark ids in awk rather than css so that ids are |
|||
persistant and don't slide if a link is removed |
|||
→ add.sh id++ |
|||
* make other ways to edit and generate bookmarks if dmenu is too much of |
|||
a struggle to install. |
|||
* plug other pages / tools to it - ie : |
|||
* unicode dictionnary, css colors |
|||
* notes (report, files recently written) |
|||
* agenda ← big textual dreams about this one |
|||
* weather forecast -- in the form of a line in the bookmarks maybe ?? |
|||
* documentations, html/css properties quickref |
|||
* images, something like signet.sh but for images and their metadata. |
|||
entries from an IMAGES file database would be attached to downloaded |
|||
images, the most recent ones cascading in a line as thumbnails |
|||
somewhere alongside links... |
|||
|
@ -0,0 +1,49 @@ |
|||
#!/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" |
|||
} |
|||
|
|||
BOOKMARKS="BOOKMARKS" |
|||
|
|||
local 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='</title>' ' |
|||
/<title>/ {gsub(/.*<title>/, ""); print} |
|||
' $url | tr -d '\n') |
|||
|
|||
description=$(echo "" | dmenu -p "Enter a description:" $(dmenu_style)) |
|||
tags=$(echo "" | dmenu -p "Enter comma-separated tags:" $(dmenu_style)) |
|||
|
|||
bookmark_file="$BOOKMARKS" |
|||
|
|||
# Save the data to the file. |
|||
echo "URL: $url" >> "$BOOKMARKS" |
|||
echo "Name: $name" >> "$BOOKMARKS" |
|||
echo "Description: $description" >> "$BOOKMARKS" |
|||
echo "Tags: $tags" >> "$BOOKMARKS" |
|||
echo "Date: $(date +%s)" >> "$BOOKMARKS" |
|||
echo >> "$BOOKMARKS" |
|||
|
|||
else |
|||
xclip -o -selection clipboard | dmenu -p "≉" $(dmenu_style) |
|||
fi |
|||
|
File diff suppressed because it is too large
Loading…
Reference in new issue