GNU bug report logs - #67314
xorg-configuration's extra-config should support file-like objects

Previous Next

Package: guix;

Reported by: Ian Eure <ian <at> retrospec.tv>

Date: Mon, 20 Nov 2023 23:41:01 UTC

Severity: normal

Full log


View this message in rfc822 format

From: Ian Eure <ian <at> retrospec.tv>
To: 67314 <at> debbugs.gnu.org
Subject: bug#67314: xorg-configuration's extra-config should support file-like objects
Date: Mon, 20 Nov 2023 15:33:17 -0800
I needed to tweak some xorg settings (set scroll direction, enable
tearfree, etc).  On other distros, this is done by dropping files 
of
config snippets into /etc/xorg.conf.d.

On Guix, this needs to be done through the extra-config field of 
the
xorg-configuration record.  That field requires a list of strings, 
which
means the configurations need to be inlined into the config, which 
is
verbose and unsightly.

For example:

   (operating-system
     (services
      (append (list (service openssh-service-type)
                    (set-xorg-configuration
                     (xorg-configuration
                      (keyboard-layout keyboard-layout)
                      (extra-config
                       (list
                        "Section \"InputClass\"
                        Identifier \"Touchpads\"
                        MatchIsTouchpad \"on\"

                        Driver \"libinput\"

                        Option \"ClickMethod\" \"clickfinger\"
                        Option \"DisableWhileTyping\" \"on\"
                        Option \"NaturalScrolling\" \"on\"
                        Option \"Tapping\" \"off\"
                        EndSection"))))))))

The manual states that extra-config takes "a list of strings or
objects," but doesn’t indicate what type of object is expected. 
If I
pass a file-like object, like this:

   (operating-system
     (services
      (append (list (service openssh-service-type)
                    (set-xorg-configuration
                     (xorg-configuration
                      (keyboard-layout keyboard-layout)
                      (extra-config
                       (list (local-file 
                       "xorg/touchpads.conf")))))))))

The resulting Xorg configutation has the store paths for those 
files
added to it, instead of their contents.  This is an invalid
configuation, rendering Xorg unable to start.

I was able to split the difference by reading the file contents 
into the
config, ala:

   (set-xorg-configuration
    (xorg-configuration
     (keyboard-layout keyboard-layout)
     (extra-config
      (map (lambda (file)
             (call-with-port (open-file (string-append "xorg/" 
             file ".conf") "r") get-string-all))
           '("radeon" "elecom-huge" "trackpad")))))

But this feels like a graceless hack to me.

The situation would be drastically simplified if extra-config 
supported
file-like objects.




This bug report was last modified 1 year and 209 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.