PROJET AUTOBLOG


Planet-Libre

source: Planet-Libre

⇐ retour index

Nicolas Lœuillet : Afficher Guake sur son deuxième écran

jeudi 25 septembre 2014 à 22:31

Depuis maintenant quelques semaines, j’utilise Guake comme terminal : j’apprécie le côté pratique d’avoir toujours un terminal sous la main en une touche. Hop on m’voit, hop on m’voit plus.

Si vous bossez en double écran, il se peut que Guake ne s’affiche pas sur l’écran de votre choix. Pour ça, une petite astuce (trouvée ici), il faut juste éditer le fichier /usr/lib/guake/guake.py et remplacer la méthode get_final_window_rect par :


def get_final_window_rect(self):
"""Gets the final size of the main window of guake. The height
is the window_height property, width is window_width and the
horizontal alignment is given by window_alignment.
"""
screen = self.window.get_screen()
height = self.client.get_int(KEY('/general/window_height'))
width = 80
halignment = self.client.get_int(KEY('/general/window_halignment'))

# future we might create a field to select which monitor you
# wanna use
#monitor = 0 # use the left most monitor
monitor = screen.get_n_monitors() - 1 # use the right most monitor

monitor_rect = screen.get_monitor_geometry(monitor)
window_rect = monitor_rect.copy()
window_rect.height = window_rect.height * height / 100
window_rect.width = window_rect.width * width / 100

if width < monitor_rect.width:
if halignment == ALIGN_CENTER:
window_rect.x = monitor_rect.x + (monitor_rect.width - window_rect.width) / 2
elif halignment == ALIGN_LEFT:
window_rect.x = monitor_rect.x
elif halignment == ALIGN_RIGHT:
window_rect.x = monitor_rect.x + monitor_rect.width - window_rect.width

window_rect.y = monitor_rect.y
return window_rect

Redémarrez guake et voila.

partager sur diaspora*

Gravatar de Nicolas Lœuillet
Original post of Nicolas Lœuillet.Votez pour ce billet sur Planet Libre.