From b7b81f3e2a285a3a2064ce6a56abf4785e8e0352 Mon Sep 17 00:00:00 2001 From: David Runge Date: Fri, 22 Dec 2017 00:53:01 +0100 Subject: .config/qtile/config.py: Adding separate screen for spatialization software. Fixing many re.compiles. Reworking the use of floating windows. --- .config/qtile/config.py | 75 ++++++++++++++++++++++++++++++------------------- 1 file changed, 46 insertions(+), 29 deletions(-) diff --git a/.config/qtile/config.py b/.config/qtile/config.py index 8a800b7..bf7e17c 100644 --- a/.config/qtile/config.py +++ b/.config/qtile/config.py @@ -1,9 +1,12 @@ from libqtile.config import Key, Screen, Group, Drag, Click, Match from libqtile.command import lazy from libqtile import layout, bar, widget, hook +import logging import os import re import subprocess +from libqtile.log_utils import logger + mod = "mod4" alt = "mod1" @@ -140,8 +143,8 @@ keys = [ matchers = { 'web': [ Match(wm_class=[ - "Firefox", - "chromium", + re.compile('Chromium$'), + re.compile('Firefox$'), re.compile('TorLauncher'), re.compile('Tor Browser'), ]), @@ -150,15 +153,12 @@ matchers = { Match(wm_class=[ re.compile('Processing'), re.compile('processing-app-Base'), - re.compile('scide'), - "pdwindow", - "PdWindow", - "PatchWindow", ]), Match(title=[ - re.compile('SuperCollider'), - "Pd", - re.compile('Arduino'), + re.compile("SuperCollider\sIDE$"), + re.compile("^SuperCollider"), + re.compile("^Loading"), + re.compile("Pd$"), ]), ], 'games': [ @@ -184,12 +184,24 @@ matchers = { ], 'audio': [ Match(wm_class=[ - "Ardour", + re.compile('Ardour'), re.compile('Audacity'), re.compile('Calfjackhost'), re.compile('Ffado-mixer'), re.compile('Guitarix'), - ]) + re.compile('Session Setup'), + ]), + Match(title=[ + re.compile('^JACK'), + re.compile("^Calf\sJACK\sHost"), + re.compile("^Patchage"), + ]), + ], + 'spat': [ + Match(title=[ + re.compile('BinauralRenderer'), + re.compile('Controls'), + ]), ], 'photo': [ Match(wm_class=[ @@ -222,10 +234,10 @@ workspaces = [ {"key": "3", "name": "dev", "matches": matchers["dev"]}, {"key": "4", "name": "games", "matches": matchers["games"]}, {"key": "5", "name": "audio", "matches": matchers["audio"]}, - {"key": "6", "name": "photo", "matches": matchers["photo"]}, - {"key": "7", "name": "office", "matches": matchers["office"]}, - {"key": "8", "name": "admin", "matches": matchers["admin"]}, - {"key": "9", "name": "9"}, + {"key": "6", "name": "spat", "matches": matchers["spat"]}, + {"key": "7", "name": "photo", "matches": matchers["photo"]}, + {"key": "8", "name": "office", "matches": matchers["office"]}, + {"key": "9", "name": "admin", "matches": matchers["admin"]}, {"key": "0", "name": "0"}, ] @@ -315,21 +327,21 @@ screens = [ widget.HDDGraph( graph_color=colors["blue"], border_width=0, - samples=60, + samples=20, frequency=5, type="box", ), widget.MemoryGraph( graph_color=colors["green"], border_width=0, - samples=60, + samples=20, frequency=2, type="box", ), widget.CPUGraph( graph_color=colors["red"], border_width=0, - samples=60, + samples=20, frequency=2, type="box", ), @@ -387,6 +399,10 @@ mouse = [ ) ] +floating_clients = [ + re.compile('^JACK'), +] + dgroups_key_binder = None dgroups_app_rules = [] follow_mouse_focus = True @@ -407,16 +423,17 @@ def restart_on_randr(qtile, ev): @hook.subscribe.client_new -def floating_dialogs(window): - float_clients = [ - 'DialogWindow', - 'HelpBrowser', - ] - wm_class = window.window.get_wm_class() - for client in float_clients: - if client in wm_class: - window.floating = True - transient = window.window.get_wm_transient_for() +def floating_dialogs(client): + wm_class = client.window.get_wm_class() + logger.setLevel(logging.INFO) + logger.info('New client window name: %s' % client.name) +# logger.info('New client window class: %c' % wm_class) + logger.setLevel(logging.WARNING) + for client_regex in floating_clients: + match = client_regex.match(client.name) + if match: + client.floating = True + transient = client.window.get_wm_transient_for() if transient: - window.floating = True + client.floating = True -- cgit v1.2.3-70-g09d2