~lucasemmoreira/bmark

cbdfae1b11dbb1c5702a7828c1979c27dc8166bc — Lucas E M Moreira 1 year, 11 days ago cb0dace
improved bmark. add: bmark-add
4 files changed, 48 insertions(+), 2 deletions(-)

M README.md
M bmark
A bmark-add
M makefile
M README.md => README.md +23 -1
@@ 2,9 2,31 @@

Organize your bookmarks easily!

## Dependencies

- ag
- rofi

## Files

- bmark
- bmark-add

## Usage

Simple script to access your bookmarks easily. Just run bmark!
Simple script to access your bookmarks easily. Just run bmark to access your bookmarks! To add, copy the content and run bmark-add

## Files

The bookmarks will be saven in the file `$HOME/.config/bmark/bookmark`. It may contain a "comment" that will be shown in the rofi menu. For instance:

```
an-interesting-content # name of the content
```

in the rofi menu, will be shown ` name of the content` and it will be copied `an-interesting-content`.

Enjoy!

## Install


M bmark => bmark +9 -1
@@ 1,1 1,9 @@
cat ~/krig/bookmark | rofi -dmenu -l 10 | xsel -bi && test $NOTIFY && $NOTIFY "bookmark... ok"
#!/bin/sh

CONFIG_FILE="$HOME/.config/bmark/bookmark"

name=$(cat $CONFIG_FILE | sed s/.*#//g | sort | rofi -dmenu -i -l 10)

ag --nonumbers "$name" $CONFIG_FILE | sed s/\s*#.*//g | xsel -bi && test $NOTIFY && $NOTIFY "bookmark... ok"



A bmark-add => bmark-add +12 -0
@@ 0,0 1,12 @@
#!/bin/sh

CONFIG_FILE="$HOME/.config/bmark/bookmark"
DATA=$(xsel -bo)

name=$(cat $HOME/.config/bmark/bookmark | sed s/.*#//g | sort | rofi -dmenu -i -l 10)

new_line="$DATA # $name"

echo $new_line >> ${CONFIG_FILE}

test $NOTIFY && $NOTIFY "added ${new_line}"

M makefile => makefile +4 -0
@@ 3,8 3,12 @@

install:
	mkdir -p ~/bin
	mkdir -p ~/.config/bmark/
	touch ~/.config/bmark/bookmark
	cp -vf bmark ~/bin/
	cp -vf bmark-add ~/bin/
	chmod +x ~/bin/bmark
	chmod +x ~/bin/bmark-add

uninstall:
	rm -vf ~/bin/bmark