clemtre 8 months ago
parent
commit
97485f94ae
  1. 150
      README.md

150
README.md

@ -1,7 +1,50 @@
*FR → LISEZMOI.md* *FR → LISEZMOI.md*
# Demo
**Work in progress, if you encounter any issues regarding
installation or understanding what this is all about, please send an
email to contact@martinlemaire.fr or open an issue here and i'll be
happy to answer**
A browsable webpage generated from a textual database you might want to
use as a browser homepage. You can edit the database by editing the file
called BOOKMARKS or by running the provided script called
edit_bookmarks_dmenu.sh (requires dmenu). The script can be ran from the
command line but I suggest to bind it to a keystroke combination.
index.html
![a browsable bookmark manager](demo.png) ![a browsable bookmark manager](demo.png)
**A demo more understandable and browsable to be released soon** Its corresponding textual database, in the form of blankline separated
records with key/value fields :
BOOKMARKS
```
URL: http://fileformats.archiveteam.org/wiki/HEX_(Unifont)
Name: HEX (Unifont) - Just Solve the File Format Problem
Description:
Tags: bbb, hex
Date: 1704636690
Color: Pink
URL: http://robhagemans.github.io/monobit/
Name: Hoard of bitfonts
Description: A python tool to manipulate bitmap fonts and do format conversions
Tags: bitmap, fonts
Date: 1704639859
URL: https://en.wikipedia.org/wiki/Wish_(Unix_shell)
Name: wish (Unix shell) - Wikipedia
Description: a Tcl interpreter extended with Tk commands for unix.
Tags: gui, wish, tcl
Date: 1704646543
URL: https://www.kreativekorp.com/
Name: Rebecca G. Bettencourt
Description:
Tags: RGB, people, hide
Date: 1704648764
```
Given this database, signet will color the first link in pink and hide
the last one because of its "hide" tag.
# Presentation # Presentation
## signet.sh ## signet.sh
@ -10,50 +53,62 @@ It uses awk inside a here-doc declaration redirected to an html file.
I have created this script because I found the bookmarks manager from I have created this script because I found the bookmarks manager from
firefox not great to use, to the point where I did not have the habit to firefox not great to use, to the point where I did not have the habit to
bookmark my browsing. Firefox stores bookmarks in a sqlite format and I bookmark my browsing journeys. Firefox stores bookmarks in a sqlite
wanted something text based. which is not human readable. Although it allows an export in json and
html, I wanted something text based and personal.
I have been using the generated html page as a default landing page for
three months, it has been a pleasing experience so far.
## Bookmarks database format ## Bookmarks database format
Only a Url is required, the rest of the fields are optional : Only a Url is required, the rest of the fields are optional :
* URL : ... * URL : the url pasted from the clipboard (exits if no url given)
* Name : grabs </title> from the bookmarked page * Name : grabs </title> from the bookmarked page with curl
* Description : ... * Description : a description from the user
* Tags : comma separated keywords * Tags : comma separated keywords
* Date : posix time of the bookmarked link * Date : posix time of the bookmarked link
* Color : css color (name, hex, rgb etc...) * Color : css color (name, hex, rgb etc...)
For example, in a file called BOOKMARKS by default: # Usage
``` ## Add a bookmark :
URL: https://rosettacode.org/wiki/Rosetta_Code
Name: Rosetta Code
Description:
Tags: literacy, read
Date: 1704675057
Color: Purple
URL: https://www.emigre.com/TypeSpecimens To add a link, I select the URL of the page with Ctrl + l, then copy to
Name: Emigre: Type Specimens clipboard and run add.sh with Super + i.
Description:
Tags: emigre, type
Date: 1704680644
URL: https://web.archive.org/web/20211025182257/http://len.falken.ink/ __If anyone knows how to retrieve the url of the current browser page
Name: Wayback Machine without having to copy it and send it to clipboard, this would save two
Description: steps out of three.__
Tags: read
Date: 1704712747 In short : Ctrl + l, Ctrl + c, Super + i
(or shorter : Ctrl + l + c, Super + i)
Super + i because in my window manager (awesomewm) configuration file
located in ~/.config/awesome/rc.lua, I have the following lines:
```
awful.key({modkey}, "i", function()
awful.util.spawn_with_shell("add.sh") end,
{description = "Sends the link in clipboard to add.sh"}),
``` ```
## Edit a bookmark :
Use your text editor of choice. Open the BOOKMARKS file and edit the
entry. The last entry is at the bottom.
# Other bookmark managers: If you use vim, with BOOKMARKS opened you can press in normal mode m +
- nb https://xwmx.github.io/nb/ (AGPL-3.0) B and it will save a mark to the file you can then access with ' + B
- ??
# Installation
Works on my machine : Ubuntu 20 LTS, it should work on any POSIX
compliant machine, macOS, linux* or bsd*. I'm curious to know how it
goes on windows :^)
clone the repo
```
git clone https://git.vvvvvvaria.org/clemtre/signet.sh.git
cd signet.sh
```
# Dependency : # Dependency :
To add a link via the proposed interface, we will need To add a link via the proposed interface, we will need
to install dmenu ~~and htmlq~~. to install dmenu ~~and htmlq~~.
* dmenu https://tools.suckless.org/dmenu/ (MIT/X) * dmenu https://tools.suckless.org/dmenu/ (MIT/X)
@ -71,6 +126,9 @@ In our script, to store the given tags in a variable, we can do:
``` ```
tags=$(echo "" | dmenu -p "Enter comma-separated tags:") tags=$(echo "" | dmenu -p "Enter comma-separated tags:")
``` ```
### install dmenu :
https://askubuntu.com/questions/828450/how-to-install-dmenu
## ~~htmlq~~ ## ~~htmlq~~
Htmlq is an HTML parser written in Go. It doesn't matter which parser we Htmlq is an HTML parser written in Go. It doesn't matter which parser we
use, it seems that each language has its own. use, it seems that each language has its own.
@ -105,31 +163,11 @@ For the moment this step is blocking. In case internet cuts while
bookmarking a link, you will have to wait for the end of the curl bookmarking a link, you will have to wait for the end of the curl
attempt to move to the next field in the script :/ sorry! attempt to move to the next field in the script :/ sorry!
# Add a bookmark :
To add a link, I select the URL of the page with Ctrl + l, the copy and
run add.sh with Super + i.
__If anyone knows how to retrieve the url of
the current browser page without having to copy it, this would save two
steps out of three.__
In short : Ctrl + l, Ctrl + c, Super + i
(or shorter : Ctrl + l + c, Super + i)
Super + i because in my window manager configuration file located in
~/.config/awesome/rc.lua, I have the following lines:
```
awful.key({modkey}, "i", function()
awful.util.spawn_with_shell("add.sh") end,
{description = "Enregistre le lien copié dans signet.sh"}),
```
# Repository structure : # Repository structure :
* BOOKMARKS → A textual database of bookmarks * BOOKMARKS → A textual database of bookmarks
* add.sh → A script to add a link to the database * edit_bookmarks_dmenu.sh → A script to add a link to the database using
dmenu
* dmenu * dmenu
* ./signet.sh * ./signet.sh
* bookmark.sh → The shell script itself * bookmark.sh → The shell script itself
@ -148,6 +186,10 @@ starred.sh → curl from the github user api and format it in the same
way as signet.sh without using jq way as signet.sh without using jq
https://api.github.com/users/[user]/starred https://api.github.com/users/[user]/starred
# Other bookmark managers:
- nb https://xwmx.github.io/nb/ (AGPL-3.0)
- ??
# Credits # Credits
* Junicode (OFL-1.1) * Junicode (OFL-1.1)
https://psb1558.github.io/Junicode-font/ https://psb1558.github.io/Junicode-font/

Loading…
Cancel
Save