summaryrefslogtreecommitdiff
path: root/mac/.config/sketchybar/plugins/messages.sh
diff options
context:
space:
mode:
authorTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-01-24 20:35:27 +0900
committerTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-01-24 20:35:27 +0900
commitc80a54e42b52ce297f0f2f71af23c562832025c7 (patch)
treedcce8bb977a770f473325d48f6f70b21d9818a40 /mac/.config/sketchybar/plugins/messages.sh
init
Diffstat (limited to 'mac/.config/sketchybar/plugins/messages.sh')
-rw-r--r--mac/.config/sketchybar/plugins/messages.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/mac/.config/sketchybar/plugins/messages.sh b/mac/.config/sketchybar/plugins/messages.sh
new file mode 100644
index 0000000..1ca1ec1
--- /dev/null
+++ b/mac/.config/sketchybar/plugins/messages.sh
@@ -0,0 +1,7 @@
+TEXT=$(sqlite3 ~/Library/Messages/chat.db "SELECT text FROM message WHERE is_read=0 AND is_from_me=0 AND text!='' AND date_read=0" | wc -l | awk '{$1=$1};1')
+
+if [ $TEXT = 0 ]; then
+ sketchybar -m --set $NAME drawing=off
+else
+ sketchybar -m --set $NAME drawing=on label="$TEXT"
+fi \ No newline at end of file