From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id EFCQFG8PqGUIEwAAqHPOHw:P1 (envelope-from ) for ; Wed, 17 Jan 2024 18:33:35 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id EFCQFG8PqGUIEwAAqHPOHw (envelope-from ) for ; Wed, 17 Jan 2024 18:33:35 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=mFZBrC0w; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1705512815; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=6o817Io+ZPE6HkBtEN/uXjqhijDxuS5Kl/mopxdzll8=; b=Z+VwiqE5/OVhXE9wFeD1WAFN79jCrosNUNmv5pXfUYlHleRe8/QDksDG/ZMBd6FsoaI/kA wkHoSmiLZ+ssKzgg0Gaga5CNZvWOL5CWfaXtuTnFahtAbi9Pq50MdsZN1l2zAyB1XqvGCj kOob70sHxXx8+FmRzy3XbfOIe6O3wLSW2JfgwcqOf1mLGNlUHf5x/FydFjSMJpHAKJMoNN eEffUZsMN7hkqVvQu99/+siNC9daVSR54Ulm/2R67GR1+HcLhccyF/HAyvz0YIyy7zAk3n DUUPmHsLJj9cc5F+KNE6P57K4AiaX+nqHSu7NA62jIRLrX24/DUoNmIOwajUrg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1705512815; a=rsa-sha256; cv=none; b=eY7Q48AsFhp6XOSZ+I4j90L+uISUnQQZmZNLyR7cmZMdu/+Ejh+IsJ942EFAN77aOtyfwX p19GR+gnrJ5tWW6LGs1PTXH4UmLgBj6+fzG62/TigmsS09wZ4mYZeejMdMn/H06UwVHn8m mDmXxbDUPfW6fHWOw8ShdnQGc5qLro7gXz1rHif6soBdPRBPx6T0Mztkt3pVDSYe8omXJA EfDy3NWK9yS9LyqcSuCEl3Bux2CC9DsiO5aMR56WMDETYHzenbL5qoJbgz3a2rRzekU4Dj CHtIXk3Onx2f+3bKhp7xdTMp8AGQyCUCi/4/dyyG7YMVGGRQabHw/SOjtNsniA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=mFZBrC0w; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 387C56B946 for ; Wed, 17 Jan 2024 18:33:35 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rQ9mi-00025r-RT; Wed, 17 Jan 2024 12:33:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rQ9mh-00025c-H8 for help-guix@gnu.org; Wed, 17 Jan 2024 12:33:03 -0500 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rQ9me-0004II-FR for help-guix@gnu.org; Wed, 17 Jan 2024 12:33:02 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 4568D24002B for ; Wed, 17 Jan 2024 18:32:58 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1705512778; bh=rT+C+fTqCWJUIu3w/cYV604Sc4wDaCKHVfyOHZ7Ee94=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=mFZBrC0we1AlRLxDUDpKQKy3Ki7WhaWiBM88Hu6wNYlSGbiEDmQMjeaMydfYEByoq 6rdIOwc+H08BnkuIq7GbODmyAhDUe30ZFgvPrgOeM3jwDrMDY19QotLHj70ytO7VGa EdGFTKFVLP75CcDdqlPp8IT0D+MsqURMgqMKc42TcI8bcehphDWFnczvU0wruvGCKk ur1CWnTMpRn1Uv9Dsd5/fmHOsoUS36LdpTesAdbWXXscfBwThS91RaEUZ3cEQWSR+h MiAqp4xo5XXKpsgd9ZGD74ykaCf1od+bAXsZC6WC7lWoWz1YjMvWecJS9ylTX4LXhf vp4QFxMYupHiw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4TFXyb4qyVz6ty2; Wed, 17 Jan 2024 18:32:55 +0100 (CET) From: Fredrik Salomonsson To: Rodrigo Morales , help-guix@gnu.org Subject: Re: Show notifications using Emacs' notifications-notify under Sway In-Reply-To: <87edegohcn.fsf@rodrigomorales.site> References: <87edegohcn.fsf@rodrigomorales.site> Date: Wed, 17 Jan 2024 17:32:53 +0000 Message-ID: <87il3rvpa2.fsf@d2.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.65; envelope-from=plattfot@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: help-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -10.40 X-Spam-Score: -10.40 X-Migadu-Queue-Id: 387C56B946 X-TUID: XPcNe0O6zEzf Hi, Rodrigo Morales writes: > I'm using Sway as my windows manager under Guix SD > > I can show notifications using =dunstify= > > #+BEGIN_SRC sh > dunstify 'Title of the notification' 'Body of the notification' > #+END_SRC > > When I try to show notifications using Emacs through the > =notifications-notify= function (see first code block below), I get the > following error (see second code block below) > > #+BEGIN_SRC elisp > (notifications-notify > :timeout 3000 > :title "title" > :body "body") > #+END_SRC > > #+CAPTION: Buffer *Backtrace* > #+BEGIN_SRC text > Debugger entered--Lisp error: (dbus-error "No connection to bus" :session) > dbus-message-internal(1 :session "org.freedesktop.Notifications" "/org/freedesktop/Notifications" "org.freedesktop.Notifications" "Notify" dbus-call-method-handler :string "Emacs" :uint32 0 :string "/gnu/store/9k0c9iija60rax5fwcss6v7ywzzzg438-emacs-..." :string "title" :string "body" (:array) (:array :signature "{sv}") :int32 3000) > apply(dbus-message-internal 1 :session "org.freedesktop.Notifications" "/org/freedesktop/Notifications" "org.freedesktop.Notifications" "Notify" dbus-call-method-handler (:string "Emacs" :uint32 0 :string "/gnu/store/9k0c9iija60rax5fwcss6v7ywzzzg438-emacs-..." :string "title" :string "body" (:array) (:array :signature "{sv}") :int32 3000)) > dbus-call-method(:session "org.freedesktop.Notifications" "/org/freedesktop/Notifications" "org.freedesktop.Notifications" "Notify" :string "Emacs" :uint32 0 :string "/gnu/store/9k0c9iija60rax5fwcss6v7ywzzzg438-emacs-..." :string "title" :string "body" (:array) (:array :signature "{sv}") :int32 3000) > notifications-notify(:timeout 3000 :title "title" :body "body") > (let ((print-level nil) (print-length nil)) (notifications-notify :timeout 3000 :title "title" :body "body")) > (setq elisp--eval-defun-result (let ((print-level nil) (print-length nil)) (notifications-notify :timeout 3000 :title "title" :body "body"))) > elisp--eval-defun() > #(nil) > edebug--eval-defun(# nil) > apply(edebug--eval-defun # nil) > eval-defun(nil) > funcall-interactively(eval-defun nil) > command-execute(eval-defun) > #+END_SRC > > I have 2 questions: > > 1. Does anyone know how to troubleshoot this error? I'm not sure how to troubleshoot this. But it looks like it cannot connect to dbus. Do you have one running for your user? Not sure if `dunstify` uses dbus or not. > 2. Are you able to notifications through Emacs using notifications-notify > under Sway? Yes, running your elisp snippet on my machine works as expected. I'm running `mako` via [guix home][0] instead of `dunst`. I have a dbus instance running as [my user][1]. And I'm running a [dbus command][2] when launching sway to setup the some envirionment variables for dbus to work with sway. Maybe these can help? [0] https://git.sr.ht/~plattfot/plt/tree/master/item/plt/home/mako.scm [1] https://git.sr.ht/~plattfot/plt/tree/master/item/plt/home/sway.scm#L144 [2] https://git.sr.ht/~plattfot/plt/tree/master/item/plt/home/services.scm#L55 -- s/Fred[re]+i[ck]+/Fredrik/g