summaryrefslogtreecommitdiff
path: root/util/verify/cbd-core
diff options
context:
space:
mode:
authorLM-LCL <hello@exaltedelite.club>2023-04-19 21:23:42 +0200
committerLM-LCL <hello@exaltedelite.club>2023-04-19 21:23:42 +0200
commitb98f0f496b6739749257804297468fb71845a776 (patch)
tree44096c59211f1d877515914273cde862fbf47c1f /util/verify/cbd-core
EZown
Diffstat (limited to 'util/verify/cbd-core')
-rwxr-xr-xutil/verify/cbd-core25
1 files changed, 25 insertions, 0 deletions
diff --git a/util/verify/cbd-core b/util/verify/cbd-core
new file mode 100755
index 0000000..99dcbde
--- /dev/null
+++ b/util/verify/cbd-core
@@ -0,0 +1,25 @@
+#! /bin/bash
+
+source ./util/notify
+source ./util/hpath
+
+get_cbd() {
+ echo "$(xclip -o)"
+}
+
+end_script() {
+ notify "$1"
+ kill -15 $$
+}
+
+url_pattern_match() {
+ [[ "$1" != "$2"* ]] && end_script "$3" \
+ || echo "$1" >> "$HPATH"
+}
+
+url_pattern_match_cbd() {
+ [ -z "$3" ] && cbd="$(get_cbd)" || cbd="$3"
+ url_pattern_match "$cbd" "$1" "$2"
+ echo "$cbd"
+}
+