Skip to content

Commit

Permalink
Add notify_log
Browse files Browse the repository at this point in the history
  • Loading branch information
Silipwn committed Feb 16, 2024
1 parent 3eb4f5c commit f1d4e8d
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions dot_local/custom/bin/executable_notify_log.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/bash
# SPDX-License-Identifier: BSD-3-Clause or GPL-3.0-or-later
# SPDX-FileCopyrightText: (C) 2024 silipwn (Ashwin)
# Finis coronat opus; Run at this code at your own peril ~ silipwn;
# Written with help of Gemini LLM
# File : notify_log.sh
# Author : silipwn <contact at as-hw.in>
# Description : This file is responsible for <insert task>
# Date : 2024-02-15T09:48:00-0500
# Last Modified : 2024-02-15T12:34:03-0500
# Last Modified By : silipwn <contact at as-hw.in>

# Check if the notify-send is theere
command -v notify-send >/dev/null 2>&1 || {
echo "Error: 'notify-send' command not found. Please install it."
exit 1
}

# Check if screen is locked with help of xscreensaver
# xscreensaver-command -time
# If screen is locked, then exit
if [[ $(xscreensaver-command -time | grep -o "locked") == "locked" ]]; then
exit 0
fi


# Based on https://stackoverflow.com/questions/16519673/cron-with-notify-send
export XDG_RUNTIME_DIR=/run/user/$(id -u)

# Set notification title and message
title="Remember to Logseq!"
message="What are you upto?"

# Define unicode characters for bell and notebook
bell="🛎"
notebook="📓"

# Combine notification with unicode characters
notification="$bell $title $message $notebook"

# Send notification using notify-send
notify-send -u normal "$notification"

0 comments on commit f1d4e8d

Please sign in to comment.