unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#67314: xorg-configuration's extra-config should support file-like objects
@ 2023-11-20 23:33 Ian Eure
  0 siblings, 0 replies; only message in thread
From: Ian Eure @ 2023-11-20 23:33 UTC (permalink / raw)
  To: 67314

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.




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-11-20 23:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-20 23:33 bug#67314: xorg-configuration's extra-config should support file-like objects Ian Eure

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).