如何在双显示环境中在右侧显示器上使用 guake

iro*_*and 22 command-line guake

我想Guake在正确的显示器上使用。

所以我通过sudo add-apt-repository ppa:cberner/guake, 和sudo apt-get update.

https://launchpad.net/~cberner/+archive/guake/+index?field.series_filter=raring

说明说我可以monitor_index以某种方式设置。但是我找不到如何配置。

有人知道这个吗?

wil*_*lfo 21

我使用了两台显示器,并希望 Guake 显示在右边的一台上(默认情况下,它显示在左边的一台上)。

我所做的是编辑我的/usr/bin/guake/文件,get_final_window_rect用这个替换方法:

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 = 100
    halignment = self.client.get_int(KEY('/general/window_halignment'))

    # get the rectangle just from the first/default monitor in the
    # future we might create a field to select which monitor you
    # wanna use
    monitor = 1 # use the right most monitor
    window_rect = screen.get_monitor_geometry(monitor)
    # see if we don't have another screen, and if so, use the first one
    if window_rect.width == 0:
        monitor = 0
        window_rect = screen.get_monitor_geometry(monitor)
    total_width = window_rect.width
    window_rect.height = window_rect.height * height / 100
    window_rect.width = window_rect.width * width / 100

    if width < total_width:
        if halignment == ALIGN_CENTER:
            window_rect.x = (total_width - window_rect.width) / 2
            if monitor == 1:
                    right_window_rect = screen.get_monitor_geometry(0)
                    window_rect.x += right_window_rect.width
        elif halignment == ALIGN_LEFT:
            window_rect.x = 0
        elif halignment == ALIGN_RIGHT:
            window_rect.x = total_width - window_rect.width
    window_rect.y = 0
    return window_rect
Run Code Online (Sandbox Code Playgroud)

基本上,它1用作监视器索引,稍后,将正确的屏幕宽度添加到 guake 窗口的起点显示

希望这可以帮助!

  • 这是真的。您的评论使我安装了最新版本的 Guake(来自这个 ppa:`https://launchpad.net/~webupd8team/+archive/ubuntu/unstable` 似乎他们已经做到了,现在您可以选择终端出现在鼠标所在的屏幕上,或将其锁定到特定屏幕,我认为这是一个足够好的解决方案 (3认同)

col*_*nik 0

我还没有测试过这个,但我认为你可以编辑 /usr/bin/guake 因为它是一个 python 脚本。

寻找

window_rect = screen.get_monitor_geometry(0)我的机器上的 #line 824

并将 0 更改为您想要 guake 显示的监视器的索引。