From 17d11d0a1cc876a28638a0221b333bf16c391605 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Wed, 30 May 2018 19:56:43 +0300 Subject: add .xsessionrc --- %HOME%/.xsessionrc | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 %HOME%/.xsessionrc diff --git a/%HOME%/.xsessionrc b/%HOME%/.xsessionrc new file mode 100644 index 0000000..ebf62d1 --- /dev/null +++ b/%HOME%/.xsessionrc @@ -0,0 +1,10 @@ +# .xsessionrc might only be read on Debian and its derivatives like Ubuntu. + +# This is a workaround to make notify-send inside cron jobs work. +# Thanks to this dude: https://unix.stackexchange.com/a/111190/60124 +# Then you source ~/.dbus/Xdbus inside your cron job, and voilĂ ! +touch "$HOME/.dbus/Xdbus" \ + && chmod 0600 "$HOME/.dbus/Xdbus" \ + && [ -n "${DBUS_SESSION_BUS_ADDRESS+x}" ] \ + && command -v printf > /dev/null 2>&1 \ + && printf -- 'export DBUS_SESSION_BUS_ADDRESS=%q\n' "$DBUS_SESSION_BUS_ADDRESS" > "$HOME/.dbus/Xdbus" -- cgit v1.2.3