-rw-r--r-- x11.py
1 """ 2 X11-specific configuration 3 """ 4 5 import os 6 7 from libqtile import hook, qtile 8 from libqtile.lazy import lazy 9 10 IS_XEPHYR = int(os.environ.get("QTILE_XEPHYR", 0)) 11 mod = "mod1" if IS_XEPHYR else "mod4" 12 13 14 # term = "xterm" if IS_XEPHYR else "urxvt" # urxvt doesn't like xephyr 15 term = "xterm" 16 wmname = "LG3D" 17 keys_backend = [] 18 19 20 # Keys to run X11-only launchers 21 keys_backend.extend( 22 [ 23 # ([mod], 'd', 24 # lazy.spawn('rofi -show run -theme ~/.config/rofi/common-large.rasi'), "rofi: run"), 25 #([], "XF86PowerOff", lazy.spawn("power-menu"), "Power menu"), 26 ([mod, "shift"], "x", lazy.spawn("set_monitors"), "Configure monitors"), 27 # ( 28 # [mod, "shift"], 29 # "i", 30 # lazy.spawn("slock systemctl suspend -i"), 31 # "Suspend system and lock", 32 # ), 33 ] 34 ) 35 36 37 # Auto-float some windows 38 @hook.subscribe.client_new 39 def _(window): 40 if window.window.get_wm_type() == "desktop": 41 window.static(qtile.current_screen.index) 42 return 43 44 hints = window.window.get_wm_normal_hints() 45 if hints and 0 < hints["max_width"] < 1920: 46 window.floating = True 47