mirror of
https://github.com/LukeSmithxyz/voidrice.git
synced 2025-10-07 07:22:36 +02:00
26 lines
993 B
Bash
Executable File
26 lines
993 B
Bash
Executable File
#!/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
|