aboutsummaryrefslogtreecommitdiff
path: root/.config/qtile/screens.py
blob: 840777d36a415bce16b9fe4b7ff45932586a1eef (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Justine Smithies
# https://git.sr.ht/~justinesmithies/dotfiles

# Multimonitor support

from libqtile import qtile
from libqtile.config import Screen
from libqtile import bar
from libqtile.log_utils import logger
from widgets import primary_widgets, secondary_widgets


def status_bar(widgets):
    return bar.Bar(widgets, 20, background="#000000AA", margin=[10, 10, 0, 10])  # Margin = N E S W


screens = [Screen(wallpaper='.cache/wallpaper', wallpaper_mode='fill', top=status_bar(primary_widgets))]

connected_monitors = len(qtile.core.outputs)
logger.warning(f"Found {connected_monitors} monitor(s)")

if connected_monitors > 1:
    for _ in range(1, connected_monitors):
        screens.append(Screen(wallpaper='.cache/wallpaper', wallpaper_mode='fill', top=status_bar(secondary_widgets)))