window-managers

Discover what window is active on Gnome/Linux/Ubuntu from Python?

六眼飞鱼酱① 提交于 2020-01-01 03:31:38
问题 Is there any way to get a list of all windows that are open at present and see what window is at the top (i.e. active?) from Python? This is using Gnome on Ubuntu Linux. wnck looks like it might do this, but it's very lacking in documentation. 回答1: import wnck screen = wnck.screen_get_default() window_list = screen.get_windows() active_window = screen.get_active_window() See also Get active window title in X, and WnckScreen in the documentation. Other questions containing wnck have useful

Creating a window manager for Linux

不打扰是莪最后的温柔 提交于 2019-12-29 11:35:11
问题 I want to create a simple stacking window manager (in C ) for private use, mainly for the purpose of learning and challenging myself. I've looked through twm 's source code which has relatively few bells and whistles but it seems very low level since it's not based on a widget toolkit. 1 Would using a toolkit such as GTK+ be preferable? I'm afraid that some of the code and libraries in twm might be too antiquated ( edit: deprecated) and I want the window manager to use relatively modern

Get content from open window in Linux

旧街凉风 提交于 2019-12-24 17:25:11
问题 I want to collect data and parse it eventually from an open window in linux. An example- Suppose a terminal window is open. I need to retrieve all the data that appears on that window. After retrieval, I would parse it to get specific commands entered. So is it possible to do that? If so, how? I would prefer to use python to code this entire thing. I am making a guess that first I would have to get some sort of ID for the open window and then use some kind of library to get the content from

Xlib: How to ask window manager for maximized window size?

℡╲_俬逩灬. 提交于 2019-12-24 14:04:36
问题 I want my program's window to be as big as possible without overlapping the window manager's various small windows e.g. the pager. Is there any way to ask the wm what the maximized window size is, before I create my window? 回答1: _NET_WORKAREA property of the root window is probably closest match. However on a multi-headed system it will give you the combined work area on all monitors. If that's what you want, fine (but see here on making a window span multiple monitors). If you want to

Is there a way to tell if a JFrame is “Maximised” (MS Windows) [duplicate]

﹥>﹥吖頭↗ 提交于 2019-12-23 12:28:29
问题 This question already has answers here : JFrame in full screen Java (12 answers) Closed 6 years ago . I've been Java applications on OS X, and haven't had the opportunity to fully test in different places. There are 2 different JFrame s. The second is loaded exactly in place of the first one, and as such needs to have its size and location set to the same as the first. This works fine, but I noticed a lot of Windows users seem to maximise the first window. When the second JFrame loads, it has

How to disable the resize cursor

南笙酒味 提交于 2019-12-23 09:29:49
问题 I use QWidget::setFixedSize to avoid my window being resized. Even though it works, the resize-style cursor still appears when passing over the edges. Like this for example: http://bp3.blogger.com/_fhb-4UuRH50/R1ZMKyoIvMI/AAAAAAAAA6s/I08ntfXpp2k/s1600-h/w-resize.gif Well, you know what I mean. How can I avoid that? I use Windows 7 with the default windows manager. 回答1: If this is your mainwindow and you're using Qt 4, you can disable the sizegrip of your mainwindow's statusbar: this-

How to monitor applications being open or launch in linux/tcl/python?

感情迁移 提交于 2019-12-23 02:41:23
问题 I am trying to build a panel application, alike avant window navigator or ubuntu unity. My question is once I build the panel with the predifined applications, how I can add items to the panel when applications are open or launch? Here is my source code in tcl: package require Tk set items {xterm gvim firefox} wm withdraw . toplevel .panel wm attributes .panel -topmost 1 ; # on top bind .panel <Escape> {exit} wm geometry .panel +0+0 wm overrideredirect .panel yes ; # remove window decorations

requestFocus() returning false

本小妞迷上赌 提交于 2019-12-22 08:22:41
问题 I am inflating a view when a button is pressed. The inflated view is like a dialog box, however when I try to get focus on the dialog box with requestFocus() , requestFocus() returns false means I am not getting focus on the view, but when I manually tap the inflated view, it recieves focus. What am I doing wrong? I clear focus from the button (which is used to inflated the new view) before I call requestFocus on inflated view. Regards 回答1: A possible reason why the View.requestFocus() method

Obtaining List of all Xorg Displays

烂漫一生 提交于 2019-12-18 13:01:31
问题 I would like to know how I can obtain a list of all Xorg displays on my system, along with a list of screens associated with each display. I spent some time looking through the Xlib documentation, but was not able to find a function that does what I want. Please assume that I have no other dependencies other than a POSIX-complaint OS and X (e.g., no GTK). If what I ask is not possible assuming these minimal dependencies, then a solution using other libraries is fine. Thank you very much for

Manipulate window size in linux via compiled code?

跟風遠走 提交于 2019-12-14 04:01:21
问题 I wrote a couple of scripts to maximize a window to half the size of the screen (to make it easy to place windows side-by-side) using xrandr, grep, and wmctrl as follows: #!/bin/bash w=`xrandr 2> /dev/null | grep '*' | grep -Po '\d+(?=x)'` h=`xrandr 2> /dev/null | grep '*' | grep -Po '(?<=x)\d+'` wmctrl -r :ACTIVE: -b remove,maximized_horz,maximized,vert wmctrl -r :ACTIVE: -e 0,0,0,$((w / 2)),$h Is there a way to do this more natively? The script works well on my desktop, but on my laptop