mirror of
https://github.com/LukeSmithxyz/voidrice.git
synced 2025-10-07 07:22:36 +02:00
bookmark - bookmark links, RSS feeds, and songs
This commit is contained in:
parent
a02b117056
commit
21779072aa
25
.local/bin/bookmark
Executable file
25
.local/bin/bookmark
Executable file
@ -0,0 +1,25 @@
|
||||
#!/bin/sh
|
||||
|
||||
getbookmark() {
|
||||
bookmark="$(xclip -selection clipboard -o)"
|
||||
tags=$(echo "" | dmenu -p "Enter bookmark tags (ENTER to save without tags)")
|
||||
}
|
||||
|
||||
write_to_file () {
|
||||
if grep -q -E "^$bookmark( |$)" "$file"; then
|
||||
notify-send "Already bookmarked $bookmark!"
|
||||
else
|
||||
notify-send "Bookmarked $bookmark"
|
||||
echo "$bookmark" "$tags" >> "$file"
|
||||
echo "$bookmark" | xclip -selection clipboard -i
|
||||
fi
|
||||
}
|
||||
|
||||
case "$(printf "📜 rss\n🌍 url\n🌍📜 site (rss + url)\n🎵 song" | dmenu -i -p 'Bookmark: ')" in
|
||||
'🌍📜 site (rss + url)') getbookmark && rssget "$bookmark" "$tags" && file="$HOME/.local/share/larbs/snippets" && write_to_file ;;
|
||||
'📜 rss') getbookmark && rssget "$bookmark" "$tags" ;;
|
||||
'🌍 url') getbookmark && file="$HOME/.local/share/larbs/snippets" && write_to_file ;;
|
||||
'🎵 song') bookmark="$(mpc | sed "/^volume:/d;s/\\&/&/g;s/\\[paused\\].*/⏸/g;/\\[playing\\].*/d;/^ERROR/Q")"
|
||||
file="$HOME/.local/share/larbs/songlog" && write_to_file ;;
|
||||
*) exit 1 ;;
|
||||
esac
|
||||
Loading…
x
Reference in New Issue
Block a user