From 63ee4ef39bfa9bb83ad3ee5a4877770dba7d82f7 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 6 Mar 2014 23:21:18 +0100 Subject: add XDisplay.vt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/plugins/xdisplay.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/plugins/xdisplay.py b/src/plugins/xdisplay.py index 936d463..cba245a 100644 --- a/src/plugins/xdisplay.py +++ b/src/plugins/xdisplay.py @@ -19,6 +19,10 @@ along with this program. If not, see . import os +import Xlib.Xatom + +from x import * + class XDisplay: ''' @@ -27,7 +31,8 @@ class XDisplay: @variable connection:str? The full X display information, `None` if X is not running @variable host:str? The host, often `None` one local conncetions and "localhost" on remote oonnection @variable display:int The display number - @variable screen:int? The screen number , often `None` + @variable screen:int? The screen number, often `None` + @varaible vt:int The VT the X display is allocated to ''' @@ -42,5 +47,7 @@ class XDisplay: self.display, self.screen = (self.connection.split(':')[1] + '.').split('.')[:2] self.display = int(self.display) self.screen = None if self.screen == '' else int(self.screen) - # TODO get VT + r = get_screen().root + d = get_display() + self.vt = r.get_full_property(d.get_atom('XFree86_VT'), Xlib.Xatom.INTEGER).value[0] -- cgit v1.2.3-70-g09d2