Addition scripts to qutebrowser
Go to file
Your Name d6bdafd289 fixes 2024-04-30 15:29:34 +00:00
configs fixes 2024-04-30 15:29:34 +00:00 fixes 2024-04-30 15:19:15 +00:00

Define this function in your

import os
import traceback
from qutebrowser.utils import debug, log

sCONFIG_DIR = config.configdir
def config_load_configs(lArgs: list|None = None, sDir: str = sCONFIG_DIR) -> None:
    i = 0
    if not lArgs: return i
    for foo in lArgs:
        sFile = os.path.join(sDir, 'configs', foo)
        for bar in sFile, sFile+'.py':
            if not os.path.exists(bar): continue
                # ResourceWarning: unclosed file
                oFd = open(bar, 'rt')
                sCode =
            except Exception as e:
                log.init.warning(f'error execing {bar}\n{e}')
      'execed {bar}')
                i = i + 1
    return i

Then make a list of configs you want to load:

lCONFIGS = ['chromium-flags',

Then load the configs:

i = config_load_configs(lCONFIGS)'loaded {i} configs')

I think that this should be a standard function and a standard habit of loading code snippets from a directory like: ~/.config/qutebrowser/configs