From owner-freebsd-questions@freebsd.org Fri Jul 22 19:43:50 2016 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B5B3BA23E3 for ; Fri, 22 Jul 2016 19:43:50 +0000 (UTC) (envelope-from pipfstarrd@openmailbox.org) Received: from mail2.openmailbox.org (mail2.openmailbox.org [62.4.1.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1509C13A4 for ; Fri, 22 Jul 2016 19:43:49 +0000 (UTC) (envelope-from pipfstarrd@openmailbox.org) Received: by mail2.openmailbox.org (Postfix, from userid 1001) id B0FD21073D2; Fri, 22 Jul 2016 21:43:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=openmailbox.org; s=openmailbox; t=1469216626; bh=8kfM6vSxkyEYBjrOKu+IiJx8EFetTbZqekxxmuZCOoE=; h=To:From:Subject:Date:From; b=tqVG7FznnJwG+1YluLkzXVkhnr1AxPzbITgGTyNhXMDD5ZOoYY111vnvIwv61SZmm QlYkY0O3Qa94Fpkt2hnJHW7LIcGgcrlr7+agFmIuNSj3CfActI0pt0FdUsJzIiEJnf Vjng6UYPjAqtn4xgEhQ3jdOR39UZ0+3NeBBAnhjo= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on h4 X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=NO_RECEIVED,NO_RELAYS, T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 To: freebsd-questions@freebsd.org DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=openmailbox.org; s=openmailbox; t=1469216626; bh=8kfM6vSxkyEYBjrOKu+IiJx8EFetTbZqekxxmuZCOoE=; h=To:From:Subject:Date:From; b=tqVG7FznnJwG+1YluLkzXVkhnr1AxPzbITgGTyNhXMDD5ZOoYY111vnvIwv61SZmm QlYkY0O3Qa94Fpkt2hnJHW7LIcGgcrlr7+agFmIuNSj3CfActI0pt0FdUsJzIiEJnf Vjng6UYPjAqtn4xgEhQ3jdOR39UZ0+3NeBBAnhjo= From: twilight Subject: Using notify-send for notifications from cron-run scripts Message-ID: <22638a43-6e29-c8ba-9535-decf2c436792@openmailbox.org> Date: Fri, 22 Jul 2016 19:41:22 +0000 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jul 2016 19:43:50 -0000 Hello guys! I'm trying to do some automation on my machine and I would like to have freebsd-update and portsnap ran weekly. I want to send a notification to my X session after completing the update fetch, that new updates are available (updating automatically would not be desired as a good case due to uncontrollable results). But I've came across a problem: fetching fresh ports and freebsd updates requires the scripts to be ran from root, but in root session I'm unable to notify-send anything to my display. I've tried to set `export DISPLAY=:0`, but that didn't work out. Also I've tried to use `env DISPLAY=:0 su twilight -c 'notify-send "...."'` but that didn't work out either. Searching the net also lead me up to the same advances. What am I doing wrong? I'd be very thankful for any advice -- Cheers~ PGP key fingerprint: 07B3 2177 3E27 BF41 DC65 CC95 BDA8 88F1 E9F9 CEEF You can retrieve my public key at pgp.mit.edu.