# Path: i3configger/config.py
# class MARK:
# class I3configgerConfig:
#     COMMENT = "#"
#     SET = "set"
#     VAR = "$"
# SUFFIX = ".conf"
# I3BAR = "i3bar"
# DEFAULTS = {
#     "main": {
#         "target": "../config",
#         "i3_refresh_msg": "reload",
#         "status_command": "i3status",
#         "log": None,
#         "notify": False,
#     },
#     "bars": {
#         "defaults": {"template": "tpl", "target": "..", "select": "default"},
#         "targets": {},
#     },
# }
# CONFIG_CANDIDATES = [
#     Path("~/.i3").expanduser(),
#     Path(os.getenv("XDG_CONFIG_HOME", "~/.config/")).expanduser() / "i3",
# ]
#     PARTIALS_NAME = "config.d"
#     CONFIG_NAME = "i3configger.json"
#     MESSAGES_NAME = ".messages.json"
#     def __init__(self, load=True):
#     def __str__(self):
#     def load(self):
#     def get_bar_targets(self):
# def fetch(path: Path) -> dict:
# def freeze(path, obj):
# def ensure_i3_configger_sanity():
# def get_i3wm_config_path():
# 
# Path: i3configger/exc.py
# class I3configgerException(Exception):
# class BuildError(I3configgerException):
# class ConfigError(I3configgerException):
# class MessageError(I3configgerException):
# class PartialsError(I3configgerException):
# class ParseError(I3configgerException):
# class ContextError(I3configgerException):
# class UserError(I3configgerException):


import logging
import pprint
import socket
from functools import total_ordering
from pathlib import Path
from typing import Union, List
from i3configger import config, exc
        return self.name < other.name

    def get_pruned_content(self) -> str:
        """pruned content or '' if file only contains vars and comments"""
        lines = [l for l in self.lines if not l.strip().startswith(config.MARK.SET)]
        if not self.contain_something(lines):
            return ""
        while lines and not lines[0].strip():
            lines.pop(0)
        while lines and not lines[-1].strip():
            lines.pop()
        joinedLines = "\n".join(lines)
        return f"### {self.path.name} ###\n{joinedLines}\n\n"

    @staticmethod
    def contain_something(lines):
        for line in lines:
            line = line.strip()
            if not line:
                continue
            if line.startswith(config.MARK.COMMENT):
                continue
            if line.startswith(config.MARK.SET):
                continue
            return True

    @property
    def context(self):
        ctx = {}
        for line in [

# Path: i3configger/config.py
# class MARK:
# class I3configgerConfig:
#     COMMENT = "#"
#     SET = "set"
#     VAR = "$"
# SUFFIX = ".conf"
# I3BAR = "i3bar"
# DEFAULTS = {
#     "main": {
#         "target": "../config",
#         "i3_refresh_msg": "reload",
#         "status_command": "i3status",
#         "log": None,
#         "notify": False,
#     },
#     "bars": {
#         "defaults": {"template": "tpl", "target": "..", "select": "default"},
#         "targets": {},
#     },
# }
# CONFIG_CANDIDATES = [
#     Path("~/.i3").expanduser(),
#     Path(os.getenv("XDG_CONFIG_HOME", "~/.config/")).expanduser() / "i3",
# ]
#     PARTIALS_NAME = "config.d"
#     CONFIG_NAME = "i3configger.json"
#     MESSAGES_NAME = ".messages.json"
#     def __init__(self, load=True):
#     def __str__(self):
#     def load(self):
#     def get_bar_targets(self):
# def fetch(path: Path) -> dict:
# def freeze(path, obj):
# def ensure_i3_configger_sanity():
# def get_i3wm_config_path():
# 
# Path: i3configger/exc.py
# class I3configgerException(Exception):
# class BuildError(I3configgerException):
# class ConfigError(I3configgerException):
# class MessageError(I3configgerException):
# class PartialsError(I3configgerException):
# class ParseError(I3configgerException):
# class ContextError(I3configgerException):
# class UserError(I3configgerException):


# Path: i3configger/partials.py
import logging
import pprint
import socket
from functools import total_ordering
from pathlib import Path
from typing import Union, List
from i3configger import config, exc

        return self.name < other.name

    def get_pruned_content(self) -> str:
        """pruned content or '' if file only contains vars and comments"""
        lines = [l for l in self.lines if not l.strip().startswith(config.MARK.SET)]
        if not self.contain_something(lines):
            return ""
        while lines and not lines[0].strip():
            lines.pop(0)
        while lines and not lines[-1].strip():
            lines.pop()
        joinedLines = "\n".join(lines)
        return f"### {self.path.name} ###\n{joinedLines}\n\n"

    @staticmethod
    def contain_something(lines):
        for line in lines:
            line = line.strip()
            if not line:
                continue
            if line.startswith(config.MARK.COMMENT):
                continue
            if line.startswith(config.MARK.SET):
                continue
            return True

    @property
    def context(self):
        ctx = {}
        for line in [

            l.strip() for l in self.lines if l.strip().startswith(config.MARK.SET)