summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authoryusufaktepe <yusuf@yusufaktepe.com>2019-04-25 20:16:46 +0300
committeryusufaktepe <yusuf@yusufaktepe.com>2019-04-25 20:16:46 +0300
commit3f15a4d4c66ae95f98a01e85f55dc1550c3c713e (patch)
tree11dbdc8ff91d5e9a984efacbd8bd0e91a76ac891 /bin
parent6a9c4d5b72ab494848488cc26abc8b2b05cab71f (diff)
cronjob: get id from active user
Diffstat (limited to 'bin')
-rwxr-xr-xbin/mw2
1 files changed, 1 insertions, 1 deletions
diff --git a/bin/mw b/bin/mw
index 34d6407..5f033cd 100755
--- a/bin/mw
+++ b/bin/mw
@@ -244,7 +244,7 @@ choosecron() { ! pgrep -x cron\|crond >/dev/null && echo "No cron manager runnin
read -r minnum
printf "\033[0m"
done
- (crontab -l; echo "*/$minnum * * * * export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus; export DISPLAY=:0; . \$HOME/.profile; $(type mailsync | cut -d' ' -f3)") | crontab - &&
+ (crontab -l; echo "*/$minnum * * * * export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus; export DISPLAY=:0; . \$HOME/.profile; $(type mailsync | cut -d' ' -f3)") | crontab - &&
echo "Cronjob added. Mail will sync every $minnum minutes. Be sure you have your cron manager running."
fi ;}