From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.devel Subject: Re: desktop-background.el as a new library? Date: Wed, 27 Oct 2021 12:51:24 -0700 Message-ID: References: <87y26ee0gz.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22331"; mail-complaints-to="usenet@ciao.gmane.io" To: Tassilo Horn , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Oct 27 21:56:49 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mfp2X-0005cA-9J for ged-emacs-devel@m.gmane-mx.org; Wed, 27 Oct 2021 21:56:49 +0200 Original-Received: from localhost ([::1]:59836 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mfp2W-0002B0-6v for ged-emacs-devel@m.gmane-mx.org; Wed, 27 Oct 2021 15:56:48 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45852) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfoxU-0002YS-TR for emacs-devel@gnu.org; Wed, 27 Oct 2021 15:51:36 -0400 Original-Received: from mail-pg1-x52a.google.com ([2607:f8b0:4864:20::52a]:46729) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mfoxL-0004qq-It; Wed, 27 Oct 2021 15:51:34 -0400 Original-Received: by mail-pg1-x52a.google.com with SMTP id m21so3969316pgu.13; Wed, 27 Oct 2021 12:51:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:in-reply-to:references:mime-version:date:message-id:subject:to; bh=3aaMl+4jxE5GdPYXXmBGI6yx9CkFRI9xZDZS8qYhnj8=; b=RRBFKVfOKFUctCHW0stb3vk+pehyMTpbD66+UB4HZr3wTcxS9ySiGe4zXZ2+WKCgUH /HrF1N7pozM0spbEQ+PZkhOGOnrlVKOMYK4857iVvF1OvU9E0EkokKH1oUZv3pVAhVJR mlwZfTKbg8inrmMii4aKR/Z7H7/N5gAWAA8REJXs4Ou+fP+QyspFvq6v3XCQ5O2KGXG5 bovHoQd1bcEYvMlFXziJScdSd/Ucio3qZMHQ52Dxy/FoxaNHFGpqCPZpweEXmTdOrHvf x4WKaDpZVDZaYFaPZx5XVVewcqADqVy9Qwp6462uywuOaz12frudFFk7Y3L0zyUn6gGY +urA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:in-reply-to:references:mime-version:date :message-id:subject:to; bh=3aaMl+4jxE5GdPYXXmBGI6yx9CkFRI9xZDZS8qYhnj8=; b=SIzkjm9i6/9npy9Mt5tzZYTi9i29rdxSTzM5i1vosU1b/UFqImbd+8Q/atAaS2yXE7 UVa7aRIL1Epw538vgLLbtK+QfbyCmZ5eETF0cOmpSNCCpWFCAwFwl4YndrSkpOOX8oLs 2H+9FFN9gHSk9IlSZ/XaMTe7JWhkzay60SBe97VrzrUZozCrqrbD4W+GSJdAVUjzfB5a sHGd0G/5em3xBqUUCDvFC5Tn5NwGFC69G2NKEF/yet1NEcsw9GiIli3QGQ3d1mn4P57k se68i0na0vILhUZeieIMSIJy5c5XFq35/Gbnj1hgaeJd0XUSh5VvGLC0Ub72yoHhG1IU 34yQ== X-Gm-Message-State: AOAM53178l7Fdjr415JRacuqUvib1J64QBP3T6xbl/Ga4MtJrqhRUvtJ he88IgbETAIdIF/7Q4EzZYXvo73aZAl7Q7JnPMFdG79E X-Google-Smtp-Source: ABdhPJyiHVji45gIj7EgcmpicmX6lGwiSUShOpH7MPyroVdi9lPvHyTzUEa7ugKyjGQR8poSD+oSuz+4LsBy2f+3G0Y= X-Received: by 2002:a63:370c:: with SMTP id e12mr25640378pga.359.1635364285123; Wed, 27 Oct 2021 12:51:25 -0700 (PDT) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Wed, 27 Oct 2021 12:51:24 -0700 In-Reply-To: <87y26ee0gz.fsf@gnu.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::52a; envelope-from=stefankangas@gmail.com; helo=mail-pg1-x52a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:278052 Archived-At: Tassilo Horn writes: > None of the provided commands will work for wayland compositors (I > think) which are becoming more and more the standard on GNU/Linux. For > example, I'm using sway so when $WAYLAND_DISPLAY and $SWAYSOCK are set, > the background must be set using the swaybg command. Similarly, with > GNOME, I'd say it's generally the best bet to set the wallpaper using > gsettings because that will work with both GNOME on X11 and GNOME on > Wayland. But with gsettings, the set wallpaper would be persistent > whereas all other commands would set the wallpaper only for the current > session. Thanks, this is very useful information, and reinforces the argument that something like this belongs in a library, so that people don't have to reinvent the wheel all the time. I guess the only way to do this is adding stuff as it comes up and improve on this over time. The fix you pointed out sounds straightforward: check if $WAYLAND_DISPLAY and $SWAYSOCK are set, and use swaybg if they are. Does anyone know how to detect if Gnome is in use? BTW, there is an important difference, IIUC, with "gsettings" in that it sets it not just for this session. Perhaps that is okay, though? That just seems to be one of the features that Gnome provides over plain X11. > That said, I like the idea. It's just that the program for setting the > wallpaper is not necessarily a user preference (defcustom) but can also > be a necessity dictated by the WM/compositor/platform. Thanks! I agree that we might want to consider to what extent and how this should be customizable to the user. When it really comes down to it, perhaps most users don't care at all what is being used, and is more interested in customizing if the background is stretched or tiled out. On a separate note, I have looked into what third-party packages do, and it seems really common to just fire and forget a command like "feh --set-bg".