xorg-configuration's extra-config should support file-like objects

  • Open
  • quality assurance status badge
Details
One participant
  • Ian Eure
Owner
unassigned
Submitted by
Ian Eure
Severity
normal

Debbugs page

Ian Eure wrote 1 years ago
(address . bug-guix@gnu.org)
87ttpg804j.fsf@retrospec.tv
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.
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 67314@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 67314
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help