Amigos, preciso alterar o xorg.conf com um script, e pensei em fazer
isso usando o sed.
O problema é que o xorg.conf pode não ser o mesmo para todo mundo.

          sed -i '/padrao/anovalinha/' xorg.conf
Esse comando acrescenta uma linha com o texto "novalinha" após a linha
em que existe a palavra "padrao". No meu caso, "novalinha" seria:
[[      InputDevice    "Synaptics Touchpad" ]]

Segue um exemplo de como seriam a entrada e a saída...

O problema é como encontrar a linha "padrao"... Uma idéia que pensei,
mas não consegui implementar, seria escrever "novalinha" umas três
linhas após [[Section "ServerLayout"]]
Alguma luz??

Abraço e obrigada

[velhoxorg]
Section "ServerLayout"
        Identifier     "Default Layout"
        Screen      0  "aticonfig-Screen[0]" 0 0
        InputDevice    "Generic Keyboard"
        InputDevice    "Configured Mouse"
        InputDevice    "stylus" "SendCoreEvents"
        InputDevice    "cursor" "SendCoreEvents"
        InputDevice    "eraser" "SendCoreEvents"
EndSection
[/velhoxorg]

[novoxorg]
Section "ServerLayout"
        Identifier     "Default Layout"
        Screen      0  "aticonfig-Screen[0]" 0 0
        InputDevice    "Generic Keyboard"
        InputDevice    "Configured Mouse"
        InputDevice    "stylus" "SendCoreEvents"
        InputDevice    "cursor" "SendCoreEvents"
        InputDevice    "eraser" "SendCoreEvents"
        InputDevice    "Synaptics Touchpad"
EndSection
[/novoxorg]

Responder a