Beispiel #1
0
def open_x(screen_no = None):
    '''
    Open connection the X and select screen
    
    @param  screen_no:int?  The index of the screen to use, `None` for default
    '''
    global display, screen, screen_i
    display = Xlib.display.Display()
    screen_i = screen_no if screen_no is not None else display.get_default_screen()
    screen = display.screen(screen_i)
Beispiel #2
0
def open_x(screen_no=None):
    '''
    Open connection the X and select screen
    
    @param  screen_no:int?  The index of the screen to use, `None` for default
    '''
    global display, screen, screen_i
    display = Xlib.display.Display()
    screen_i = screen_no if screen_no is not None else display.get_default_screen(
    )
    screen = display.screen(screen_i)
Beispiel #3
0
from PyQt5.QtWebKitWidgets import QWebView, QWebPage
import Xlib.display

try:
    import urlparse
except:
    import urllib.parse as urlparse

display = Xlib.display.Display()
root = display.screen().root

atom_strut = display.intern_atom("_NET_WM_STRUT")
atom_strut_partial = display.intern_atom("_NET_WM_STRUT_PARTIAL")
atom_cardinal = display.intern_atom('CARDINAL')
atom_net_system_tray = display.intern_atom(
    "_NET_SYSTEM_TRAY_S%d" % display.get_default_screen())
atom_manager = display.intern_atom("MANAGER")
atom_tray_opcode = display.intern_atom("_NET_SYSTEM_TRAY_OPCODE")
atom_net_wm_pid = display.intern_atom("_NET_WM_PID")


FGCOLOR = "#FFFFFF"
BGCOLOR = "#1B1D1E"
iconpath = os.path.abspath(os.path.dirname(__file__)) + "/icons"


class Bar:

    def __init__(self, width, height, xpos=0, ypos=0, customIconPath=None,
                 iconcolor=None, textcolor=None):
        self.widgets_left = []
Beispiel #4
0
import logging
from pybar.lib.dzenparser import Dzen2HTMLFormatter
from PyQt5.QtCore import Qt, QRect, pyqtSignal
from PyQt5.QtWidgets import QWidget, QVBoxLayout, QDesktopWidget
from PyQt5.QtWebKitWidgets import QWebView, QWebPage
import Xlib.display
import urllib.parse as urlparse

display = Xlib.display.Display()

atom_strut = display.intern_atom("_NET_WM_STRUT")
atom_strut_partial = display.intern_atom("_NET_WM_STRUT_PARTIAL")
atom_cardinal = display.intern_atom("CARDINAL")
atom_net_wm_dock = display.intern_atom("_NET_WM_WINDOW_TYPE_DOCK")
atom_net_system_tray = display.intern_atom("_NET_SYSTEM_TRAY_S%d" %
                                           display.get_default_screen())
atom_manager = display.intern_atom("MANAGER")
atom_tray_opcode = display.intern_atom("_NET_SYSTEM_TRAY_OPCODE")
atom_net_wm_pid = display.intern_atom("_NET_WM_PID")

FGCOLOR = "#FFFFFF"
BGCOLOR = "#1B1D1E"
iconpath = os.path.abspath(os.path.dirname(__file__)) + "/icons"


class Bar:
    def __init__(self,
                 width=None,
                 height=16,
                 xpos=0,
                 ypos=0,