Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I use Oneiric with Unity. I want to make a script that

  • opens onboard if it's closed
  • minimizes onboard if it's open
  • unminimizes and focus onboard if it's minimized

I've tried with wmctrl -r Onboard -b toggle,hidden, but it doesn't do anything (I can't understand why, other options as wmctrl -r Onboard -b toggle,maximized_horz works fine).

I've found a more complex script here, it's made for a terminal, so I only need to replace the terminal with onboard.

However, that script doesn't work in Unity, I've tested in Oneiric and in Precise Alpha-2, it can minimize but it can't un-minimize/focus and gives this error message:

Wnck-WARNING **: Received a timestamp of 0; window activation may not function properly. 

I've tested the script in gnome-shell in Oneiric and it works fine, seems to be a problem only with Unity.

Can somebody help me?


Hola. Uso oneiric con unity, y quiero hacer un script que

  • abra onboard si está cerrado
  • minimice onboard si está abierto y visible
  • desminimice onboard y lo convierta en la ventana activa si está minimizado

He intentado 'wmctrl -r Onboard -b toggle,hidden' pero no hace nada (no entiendo por qué, otras opciones como 'wmctrl -r Onboard -b toggle,maximized_horz' funcionan bien).

He encontrado scripts más complicados en la red, como http://ubuntuforums.org/showthread.php?t=1464311 (está hecho para una terminal, solo tendría que cambiar la terminal por onboard). Sin embargo el script no funciona en unity, lo he testado en oneiric y en precise alpha-2, minimiza bien pero para desminimizar/enfocar da un error: 'Wnck-WARNING **: Received a timestamp of 0; window activation may not function properly'. He probado el script en gnome-shell en oineiric y funciona bien, así que parece un problema solo con unity.

¿Puede ayudarme alguien? Gracias.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

This script will open onboard if its closed and kill if it is opened.

#!/bin/bash
a=$(ps -A | grep onboard)
if [ "$a" = "" ]; then
onboard
else
killall onboard
fi

exit 0

ps.: The script can take any name except *onboard*.

share|improve this answer
    
Thank you desgua, but I prefer minimizing instead of closing (open onboard needs about 5 seconds, and unminimize is instantaneous). –  David López Feb 12 '12 at 10:19
    
I don't know why onboard isn't "obeying" wmctrl, neither xdotool when trying to minimize it... I will search for more. –  desgua Feb 12 '12 at 10:52

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.