From nobody Tue Mar 15 11:01:21 2022 X-Original-To: freebsd-x11@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id BA9331A09079 for ; Tue, 15 Mar 2022 11:01:27 +0000 (UTC) (envelope-from freebsd-x11@dino.sk) Received: from mailhost.netlabit.sk (mailhost.netlabit.sk [84.245.65.72]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4KHr7T0MS2z3D8P; Tue, 15 Mar 2022 11:01:24 +0000 (UTC) (envelope-from freebsd-x11@dino.sk) Received: from zeta.dino.sk (fw3.dino.sk [84.245.95.254]) (AUTH: LOGIN milan, TLS: TLSv1/SSLv3,256bits,AES256-SHA) by mailhost.netlabit.sk with ESMTPSA; Tue, 15 Mar 2022 12:01:22 +0100 id 00DADCA4.62307202.0000E4E5 Date: Tue, 15 Mar 2022 12:01:21 +0100 From: Milan Obuch To: freebsd-x11@freebsd.org, 0mp@freebsd.org Subject: Re: Dynamic multimonitor setup question Message-ID: <20220315120121.45db2c3c@zeta.dino.sk> In-Reply-To: <665f28bc-42b5-f862-3211-01b90b070fd4@FreeBSD.org> References: <20220228093951.30914524@zeta.dino.sk> <20220314101646.0042335c@zeta.dino.sk> <665f28bc-42b5-f862-3211-01b90b070fd4@FreeBSD.org> X-Mailer: Claws Mail 3.18.0git333 (GTK+ 2.24.33; i386-portbld-freebsd11.4) List-Id: X11 List-Archive: https://lists.freebsd.org/archives/freebsd-x11 List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-x11@freebsd.org X-BeenThere: freebsd-x11@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4KHr7T0MS2z3D8P X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of freebsd-x11@dino.sk designates 84.245.65.72 as permitted sender) smtp.mailfrom=freebsd-x11@dino.sk X-Spamd-Result: default: False [-3.30 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.998]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[dino.sk]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_RHS_MATCH_FROMTLD(0.00)[]; NEURAL_HAM_SHORT(-1.00)[-0.999]; RCPT_COUNT_TWO(0.00)[2]; MLMMJ_DEST(0.00)[freebsd-x11]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:5578, ipnet:84.245.64.0/18, country:SK]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N On Tue, 15 Mar 2022 11:24:51 +0100 Mateusz Piotrowski <0mp@FreeBSD.org> wrote: > On 15/03/2022 03:03, Alexey Dokuchaev wrote: > > On Mon, Mar 14, 2022 at 10:16:46AM +0100, Milan Obuch wrote: > >> I did some searching, googling and similar... a found two ports > >> already in FreeBSD's port collection, x11/arandr and x11/srandrd. > >> The former is just a graphical interface to xrandr, easy to > >> understand and intuitive (similar to the way Windows and MacOS X > >> does multimonitor setup). The latter should do what I am after, > >> but it did not work for me :( > >> > >> Per 'man srandrd', if started with 'srandrd -v -n some_script', it > >> should output some debug data (-v), stay in foreground (-n) and > >> invoke some_script when monitor is being plugged or unplugged. It > >> does not work for me. Something happens just when I invoke > >> 'xrandr' in another terminal - I see some debug output, but the > >> script is not invoked. > >> > >> Is anybody here using x11/srandrd? I can debug the script > >> invocation, but if the event is not detected without external > >> intervention, it is not really usable for me. And I have no > >> experience with debugging the issue in graphics stack... > > I'm using srandrd to recenter my wallpapers when I configure an > external monitor (I always do it manually with either arandr or > xrandr). > > I just start srandrd like this: > > srandrd -e -n ~/bin/srandrd-handler > > ~/bin/srandrd-handler is a shell script with an executable bit set > and it contains only the following: > > #! /bin/sh - > feh --no-fehbg --bg-center --image-bg 'black' "${HOME}/wallpaper.png" > Thanks for response. Using similar method to start, with full path pointing to handler, I am getting script called and it does what is intended... but I have just ---- 8< ------------------------------------------------------------ #! /bin/sh /usr/bin/env>/home/milan/randr-log-env ---- 8< ------------------------------------------------------------ in my script, so nothing is currently done, just logged. The main problem, however, still remains - action is done not when cable is being plugged/unplugged, but xrandr or arandr must be called manually, then intended action occurs. What hardware do you have? In my case, graphics device is ---- 8< ------------------------------------------------------------ vgapci0@pci0:0:2:0: class=0x030000 rev=0x06 hdr=0x00 vendor=0x8086 device=0x3185 subvendor=0x0000 subdevice=0x0000 vendor = 'Intel Corporation' device = 'GeminiLake [UHD Graphics 600]' class = display subclass = VGA ---- 8< ------------------------------------------------------------ and kernel driver used is i915kms.ko. Regards, Milan