diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-03-06 23:21:18 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-03-06 23:21:18 +0100 |
commit | 63ee4ef39bfa9bb83ad3ee5a4877770dba7d82f7 (patch) | |
tree | 80b9ef21cbe6a109727f8d026e19f93ee096ae50 /src | |
parent | add XKB.get_locks_str (diff) | |
download | xpybar-63ee4ef39bfa9bb83ad3ee5a4877770dba7d82f7.tar.gz xpybar-63ee4ef39bfa9bb83ad3ee5a4877770dba7d82f7.tar.bz2 xpybar-63ee4ef39bfa9bb83ad3ee5a4877770dba7d82f7.tar.xz |
add XDisplay.vt
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/xdisplay.py | 11 |
1 files changed, 9 insertions, 2 deletions
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 <http://www.gnu.org/licenses/>. 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] |