My collection of plugins for the Qtile window manager.
git clone https://mcol.xyz/code/qtools
Log | Files | Refs | README

borders.py (768B)


      1 """
      2 This plugin can make Qtile draw different patterns on window borders.
      3 
      4 Example usage:
      5 
      6     from qtools import borders
      7 
      8     borders.enable('frame')
      9 
     10 """
     11 
     12 
     13 from libqtile.log_utils import logger
     14 from libqtile.backend.x11 import xcbq
     15 
     16 from .cde import cde
     17 from .frame import frame
     18 
     19 
     20 _style_map = {
     21     'frame': frame,
     22     'cde': cde,
     23 }
     24 
     25 
     26 def enable(style):
     27     """
     28     Enable a particular style of window borders.
     29 
     30     Available styles:
     31 
     32         - frame
     33         - CDE
     34 
     35     Parameters
     36     ----------
     37     style : str
     38         A string specifying which style to use.
     39 
     40     """
     41     style = style.lower()
     42     if style in _style_map:
     43         xcbq.Window.paint_borders = _style_map[style]
     44     else:
     45         logger.exception("qtools.borders: style {} not found.".format(style))