Nuestros escritorios usan XFCE, por lo que esta tarea es bastante fácil. Desconozco si será posible para otros tipos de escritorio.
La configuración global del fondo de escritorio en XFCE se guarda en: /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml. La de cada usuario se guarda en $HOME/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml. Para poner un fondo de escritorio fijo que se imponga a los de los usuarios individuales debemos meter en /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml esta configuración:
<?xml version="1.0" encoding="UTF-8"?>
<channel name="xfce4-desktop" version="1.0" locked="*" unlocked="root">
<property name="desktop-icons" type="empty">
<property name="style" type="empty"/>
<property name="file-icons" type="empty">
<property name="show-home" type="empty"/>
<property name="show-filesystem" type="empty"/>
<property name="show-removable" type="empty"/>
<property name="show-trash" type="empty"/>
</property>
</property>
<property name="backdrop" type="empty">
<property name="screen0" type="empty">
<property name="monitor0" type="empty">
<property name="image-path" type="empty"/>
<property name="image-style" type="empty"/>
<property name="image-show" type="empty"/>
<property name="workspace0" type="empty">
<property name="color-style" type="int" value="0"/>
<property name="image-style" type="int" value="4"/>
<property name="last-image" type="string" value="/var/cache/fondo.jpg"/>
<property name="image-path" type="string" value="/var/cache/fondo.jpg"/>
</property>
</property>
<property name="monitor1" type="empty">
<property name="image-path" type="empty"/>
<property name="image-style" type="empty"/>
<property name="image-show" type="empty"/>
<property name="workspace0" type="empty">
<property name="color-style" type="int" value="0"/>
<property name="image-style" type="int" value="4"/>
<property name="last-image" type="string" value="/var/cache/fondo.jpg"/>
<property name="image-path" type="string" value="/var/cache/fondo.jpg"/>
</property>
</property>
<property name="monitoreDP-1" type="empty">
<property name="workspace0" type="empty">
<property name="color-style" type="int" value="0"/>
<property name="image-style" type="int" value="4"/>
<property name="last-image" type="string" value="/var/cache/fondo.jpg"/>
<property name="image-path" type="string" value="/var/cache/fondo.jpg"/>
</property>
</property>
<property name="monitorVGA-0" type="empty">
<property name="workspace0" type="empty">
<property name="color-style" type="int" value="0"/>
<property name="image-style" type="int" value="4"/>
<property name="last-image" type="string" value="/var/cache/fondo.jpg"/>
<property name="image-path" type="string" value="/var/cache/fondo.jpg"/>
</property>
</property>
<property name="monitorHDMI-0" type="empty">
<property name="workspace0" type="empty">
<property name="color-style" type="int" value="0"/>
<property name="image-style" type="int" value="4"/>
<property name="last-image" type="string" value="/var/cache/fondo.jpg"/>
<property name="image-path" type="string" value="/var/cache/fondo.jpg"/>
</property>
</property>
<property name="monitorVGA-1" type="empty">
<property name="workspace0" type="empty">
<property name="color-style" type="int" value="0"/>
<property name="image-style" type="int" value="4"/>
<property name="last-image" type="string" value="/var/cache/fondo.jpg"/>
<property name="image-path" type="string" value="/var/cache/fondo.jpg"/>
</property>
</property>
<property name="monitorDVI-I-0" type="empty">
<property name="workspace0" type="empty">
<property name="color-style" type="int" value="0"/>
<property name="image-style" type="int" value="4"/>
<property name="last-image" type="string" value="/var/cache/fondo.jpg"/>
<property name="image-path" type="string" value="/var/cache/fondo.jpg"/>
</property>
</property>
<property name="monitorHDMI-1" type="empty">
<property name="workspace0" type="empty">
<property name="color-style" type="int" value="0"/>
<property name="image-style" type="int" value="4"/>
<property name="last-image" type="string" value="/var/cache/fondo.jpg"/>
<property name="image-path" type="string" value="/var/cache/fondo.jpg"/>
</property>
</property>
<property name="monitorDP-3" type="empty">
<property name="workspace0" type="empty">
<property name="color-style" type="int" value="0"/>
<property name="image-style" type="int" value="4"/>
<property name="last-image" type="string" value="/var/cache/fondo.jpg"/>
<property name="image-path" type="string" value="/var/cache/fondo.jpg"/>
</property>
</property>
<property name="monitorDP-1" type="empty">
<property name="workspace0" type="empty">
<property name="color-style" type="int" value="0"/>
<property name="image-style" type="int" value="4"/>
<property name="last-image" type="string" value="/var/cache/fondo.jpg"/>
<property name="image-path" type="string" value="/var/cache/fondo.jpg"/>
</property>
</property>
<property name="monitorDisplayPort-0" type="empty">
<property name="workspace0" type="empty">
<property name="color-style" type="int" value="0"/>
<property name="image-style" type="int" value="4"/>
<property name="last-image" type="string" value="/var/cache/fondo.jpg"/>
<property name="image-path" type="string" value="/var/cache/fondo.jpg"/>
</property>
</property>
</property>
</property>
<property name="last" type="empty">
<property name="window-width" type="int" value="664"/>
<property name="window-height" type="int" value="545"/>
</property>
</channel>
La clave está en "locked="*" unlocked="root">", que hace que toda la configuración descrita en ese fichero esté bloqueada de forma general para todo el mundo, excepto para el usuario root. Esta configuración se impone sobre la configuración personal de cada usuario en su carpeta privda.
El fondo elegido se pondría en /var/cache/fondo.jpg, que es una carpeta a la que tienen acceso todas las cuentas y se mantiene entre reinicios.
Meter esto a mano equipo a equipo es un poco fastidioso, asi que lo mejor es hacerlo mediante una tarea puppet:
class xubuntu_fondo {
#El fichero .xml tiene entradas repetidas dentro en función de si la salida es VGA, HDMI, DP, etc, etc.
#Si en un ordenador concreto no funciona es porque necesita otra configuración, no queda otra que investigar cual es
#y añadirla al fichero .xml base
file {"/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml" :
owner => root , group => root , mode => '0644' ,
source => "puppet:///modules/xubuntu_fondo/xfce4-desktop.xml"
}
file {"/var/cache/fondo.jpg" :
owner => root , group => root , mode => '0644' ,
source => "puppet:///modules/xubuntu_fondo/fondo.jpg
}
}
Simplemente habría que poner xfce4-desktop.xml y fondo.jpg en el directorio files de la tarea puppet y listo, ya funcionaría.
El único contratiempo es el relatado en la tarea puppet: si nos fijamos el fichero .xml tiene entradas repetidas dentro en función de si la salida es VGA, HDMI, DP, etc, etc. Si en un ordenador concreto no funciona es porque necesita otra configuración más para su dispositivo de salida. En ese caso no queda otra que investigar cual es el nombre de dicho dispositivo y añadirla al fichero .xml base. Para ello el procedmiento es definir un fondo usando el entorno gráfico y mirar luego como queda el fichero $HOME/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml del usuario donde hemos definido el escritorio. Allí estará la nomenclatura usada por su dispositivo de salida concreto. Yo mismo empezé con un xml mas pequeño que ha ido creciendo confirme he ido probando en distantas máquinas.
Otra opción sería copiar un xfce4-desktop.xml al home de los usuarios afectado, machacando $HOME/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml. Esto se puede hacer una sola vez con un bucle si los homes están en el servidor NFS o bien en cada inicio de sesión, máquina a máquina, si los homes están en local.
Como ampliación de todo lo que se puede bloquear en XFCE tenemos esta otra entrada.
Seguiremos...
No hay comentarios:
Publicar un comentario