Mostrando entradas con la etiqueta panel. Mostrar todas las entradas
Mostrando entradas con la etiqueta panel. Mostrar todas las entradas

miércoles, 26 de septiembre de 2012

Iconos del panel de gnome en movimiento

Ya me ha ocurrido varias veces que el panel superior de gnome; aun teniendo todos los iconos bloqueados; de vez en cuando me los desordenaba. Puede ser que fuera al cambiar la resolución de la pantalla, o al tener un monitor suplementario conectado al portatil.

Por lo que he visto buscando información, este problema fué solucionado en la ultima versión del panel, cuando este fue portado a GTK3, pero no se ha solucionado para las versiones antiguas. Así que he encontrado un script que hizo "bojo42", el qual bloquea el panel entero y lo desbloquea cuando queramos.

Lo suyo es guardar este script en algun lugar (por ejemplo en nuestro home "/home/USER/.gnome2_panel_block_down).
Darle permiso de ejecución.
Añadir en el panel de gnome un lanzador personalizado.
Poner como comando este mismo script.
Una vez hecho esto solo es cuestion de bloquear y desbloquear el panel con un simple click.



#!/bin/sh

### Config
NOTIFY=on #(on/off)
LOCK_TITLE="Panel Lock Down"
LOCK_MSG="Locking the GNOME panel"
UNLOCK_TITLE="Panel Lock Down"
UNLOCK_MSG="Unlocking the GNOME panel"
LOCK_ICON="/usr/share/icons/hicolor/48x48/apps/gdu-encrypted-lock.png"
UNLOCK_ICON="/usr/share/icons/hicolor/48x48/apps/gdu-encrypted-unlock.png"

### Dependency checking
if [ -z "$(which gconftool-2)" ]; then
 if [ -n "$(which gconftool-2)" ]; then
  zenity --warning --text "Error. No binary found for gconftool-2!" --title "Panel Lock Down"
 else
  echo "Panel Lock Down: Error. No binary found for gconftool-2!"
 fi
 exit 1
fi
if [ "$NOTIFY" = "on" ] && [ -z "$(which notify-send)" ]; then
 SCRIPT_LOCATION="$(pwd)/$(basename $0)"
 if [ -n "$(which zenity)" ]; then
  zenity --warning --text "Notifcations failed! Please install the libnotify-bin package or disable notifications in $SCRIPT_LOCATION" --title "Panel Lock Down"
 else
  echo "Panel Lock Down: Notifcations failed! Please install the libnotify-bin package or disable notifications in $SCRIPT_LOCATION"
 fi
 NOTIFY="off"
fi

### Main
if [ "$(gconftool-2 -g /apps/panel/global/locked_down)" = "true" ]; then
 [ "$NOTIFY" = "on" ] && notify-send -i $UNLOCK_ICON "$UNLOCK_TITLE" "$UNLOCK_MSG"
 gconftool-2 -s /apps/panel/global/locked_down --type=bool false
elif [ "$(gconftool-2 -g /apps/panel/global/locked_down)" = "false" ]; then
 [ "$NOTIFY" = "on" ] && notify-send -i $LOCK_ICON "$LOCK_TITLE" "$LOCK_MSG"
 gconftool-2 -s /apps/panel/global/locked_down --type=bool true
else
 if [ -n "$(which zenity)" ]; then
  zenity --warning --text "Error. Undefined state of global panel lock down!" --title "Panel Lock Down"
 else
  echo 'Panel Lock Down: Error. Undefined state of global panel lock down!'
 fi
 exit 1
fi