improved bmark. add: bmark-add
This commit is contained in:
parent
cb0daceb1e
commit
cbdfae1b11
4 changed files with 48 additions and 2 deletions
24
README.md
24
README.md
|
@ -2,9 +2,31 @@
|
||||||
|
|
||||||
Organize your bookmarks easily!
|
Organize your bookmarks easily!
|
||||||
|
|
||||||
|
## Dependencies
|
||||||
|
|
||||||
|
- ag
|
||||||
|
- rofi
|
||||||
|
|
||||||
|
## Files
|
||||||
|
|
||||||
|
- bmark
|
||||||
|
- bmark-add
|
||||||
|
|
||||||
## Usage
|
## 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
|
## Install
|
||||||
|
|
||||||
|
|
10
bmark
10
bmark
|
@ -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"
|
||||||
|
|
||||||
|
|
||||||
|
|
12
bmark-add
Normal file
12
bmark-add
Normal file
|
@ -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}"
|
4
makefile
4
makefile
|
@ -3,8 +3,12 @@
|
||||||
|
|
||||||
install:
|
install:
|
||||||
mkdir -p ~/bin
|
mkdir -p ~/bin
|
||||||
|
mkdir -p ~/.config/bmark/
|
||||||
|
touch ~/.config/bmark/bookmark
|
||||||
cp -vf bmark ~/bin/
|
cp -vf bmark ~/bin/
|
||||||
|
cp -vf bmark-add ~/bin/
|
||||||
chmod +x ~/bin/bmark
|
chmod +x ~/bin/bmark
|
||||||
|
chmod +x ~/bin/bmark-add
|
||||||
|
|
||||||
uninstall:
|
uninstall:
|
||||||
rm -vf ~/bin/bmark
|
rm -vf ~/bin/bmark
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue