aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/%HOME%/.xsessionrc
blob: 6ee3124d7110b4633ff12985f61c4ea340e3cfd6 (plain) (blame)
1
2
3
4
5
6
7
8
9
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.sh inside your cron job, and voilà!
touch -- "$HOME/.dbus.sh" \
    && chmod 0600 -- "$HOME/.dbus.sh" \
    && [ -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.sh"