[Slackbuilds-users] GDM vs. ConsoleKit in -current

Didier Spaier didier at slint.fr
Thu Dec 10 09:36:22 UTC 2015



On 10/12/2015 09:50, Nicolas Kovacs wrote:
> Le 09/12/2015 15:26, Matteo Bernardini a écrit :
>> I suppose (but I haven't tried that too) that cutting away the 40
>> lines of the <child> section with id="sessions_box" from greeter.ui
>> should hide it.
> 
> I played around with it, and here's a possible solution. The section you
> mentioned:
> 
> <object class="GtkHBox" id="sessions_box">
>   <property name="visible">True</property>
>   <property name="spacing">6</property>
>   <child>
> 
> This has to be edited simply by replacing "True" by "False":
> 
> <object class="GtkHBox" id="sessions_box">
>   <property name="visible">False</property>
>   <property name="spacing">6</property>
>   <child>
> 
> Now I have a technical question for this. The "cleanest" way to do this
> would be a sed one-liner replacing it. The problem is: there are many
> lines in the script looking like this:
> 
> <property name="visible">True</property>
> 
> So how would a sed command look like that did something like this:
> 
> Replace the following line:
> 
> <property name="visible">True</property>
> 
> ... by this:
> 
> <property name="visible">False</property>
> 
> But only where the previous line is this:
> 
> <object class="GtkHBox" id="sessions_box">


 sed '/<object class="GtkHBox" id="sessions_box">/{N;s@<property
name="visible">True</property>@<property
name="visible">False</property>@}' your_file

Or more readable:
  sed -f sed_script your_file
------------
/tmp$ cat sed_script
/<object class="GtkHBox" id="sessions_box">/{
        N
        s@<property name="visible">True</property>@<property
name="visible">False</property>@
}
/tmp$
------------


More information about the SlackBuilds-users mailing list