aboutsummaryrefslogtreecommitdiff
path: root/.local
diff options
context:
space:
mode:
authorawy <awy@awy.one>2025-01-31 22:12:51 +0300
committerawy <awy@awy.one>2025-01-31 22:12:51 +0300
commitb7175c617a6771405ef45c83c75a2ca5e567e4b5 (patch)
treeec4351dcd2272181841a188de96c084486dcd178 /.local
parent855a7d04f6e50d997fdf45da899b883917d413a2 (diff)
cron notifications fix
Diffstat (limited to '.local')
-rwxr-xr-x.local/bin/cron/checkup4
-rwxr-xr-x.local/bin/cron/newsup4
2 files changed, 6 insertions, 2 deletions
diff --git a/.local/bin/cron/checkup b/.local/bin/cron/checkup
index d40e556..f207d0f 100755
--- a/.local/bin/cron/checkup
+++ b/.local/bin/cron/checkup
@@ -1,7 +1,9 @@
#!/bin/sh
# Syncs repositories and downloads updates, meant to be run as a cronjob.
-export DISPLAY=':0'
+pid=$(pgrep Hyprland)
+var="DBUS_SESSION_BUS_ADDRESS"
+export DBUS_SESSION_BUS_ADDRESS=$(egrep -z "$var" "/proc/$pid/environ" | sed 's/DBUS_SESSION_BUS_ADDRESS=//')
notify-send "📦 Repository Sync" "Checking for package updates..."
diff --git a/.local/bin/cron/newsup b/.local/bin/cron/newsup
index af2dbb8..05f817c 100755
--- a/.local/bin/cron/newsup
+++ b/.local/bin/cron/newsup
@@ -2,7 +2,9 @@
# Set as a cron job to check for new RSS entries for newsboat.
# If newsboat is open, sends it an "R" key to refresh.
-export DISPLAY=':0'
+pid=$(pgrep Hyprland)
+var="DBUS_SESSION_BUS_ADDRESS"
+export DBUS_SESSION_BUS_ADDRESS=$(egrep -z "$var" "/proc/$pid/environ" | sed 's/DBUS_SESSION_BUS_ADDRESS=//')
/usr/bin/notify-send "📰 Updating RSS feeds..."