From nobody Mon Mar 14 09:16:46 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 ED5851A0E2A2 for ; Mon, 14 Mar 2022 09:16:51 +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 4KH9sG3kwhz4SXv for ; Mon, 14 Mar 2022 09:16:50 +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; Mon, 14 Mar 2022 10:16:47 +0100 id 00DADCAB.622F07FF.000028FE Date: Mon, 14 Mar 2022 10:16:46 +0100 From: Milan Obuch To: freebsd-x11@freebsd.org Subject: Re: Dynamic multimonitor setup question Message-ID: <20220314101646.0042335c@zeta.dino.sk> In-Reply-To: <20220228093951.30914524@zeta.dino.sk> References: <20220228093951.30914524@zeta.dino.sk> 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: 4KH9sG3kwhz4SXv 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.21 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.95)[-0.952]; 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]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_RHS_MATCH_FROMTLD(0.00)[]; NEURAL_HAM_SHORT(-0.95)[-0.954]; 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 Mon, 28 Feb 2022 09:39:51 +0100 Milan Obuch wrote: > Hi, > > for some time I am using various PCs with multiple video outputs, > either Intel or AMD built-in graphics (i915kms or radeonkms). It is > quite common for such setup presenting more video outputs, which > allows more displays to be connected. > > For some time, I am using some manually started scripts to modify the > setup, kind of > > --- 8< > ----------------------------------------------------------------- > > #! /bin/sh > > xrandr --output DVI-D-1 --auto > xrandr --output VGA-1 --auto > xrandr --output VGA-1 --left-of DVI-D-1 > > --- 8< > ----------------------------------------------------------------- > > to activate monitors to be used independently as larger working area. > If such setup is static box, not moved, everything is OK, no need to > make any change later. > > Recently, I've got a GPD's MicroPC for mobile usage, which changes the > play. There is internal display with resolution 720x1280 (this needs > rotation right in order to be used normally, not breaking one's neck > and having usual corelation mouse to screen), with HDMI output > available to attach a monitor, possible larger (up to 4K works well, > tested). > > I can manually switch the second display on, set resolution as > required (using --auto is the simplest way), start some program and > use it on additional monitor etc. What I'd like to achieve is some > dynamic setup, ideally ability to launch some script when monitor is > detected on HDMI output (connect/disconnect event). > > Has anybody some hints for me? As all notebooks and similar devices > probably have additional video output, this functionality is, I think, > really desired. > 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... Regards, Milan