2022-04-30 12:49:30 +02:00
|
|
|
# Justine Smithies
|
|
|
|
# https://github.com/justinesmithies/qtile-wayland-dotfiles
|
|
|
|
|
|
|
|
# Multimonitor support
|
|
|
|
|
|
|
|
from libqtile.config import Screen
|
|
|
|
from libqtile import bar
|
|
|
|
from libqtile.log_utils import logger
|
2022-04-30 20:33:28 +02:00
|
|
|
from .widgets import primary_widgets, secondary_widgets
|
2022-04-30 12:49:30 +02:00
|
|
|
import subprocess
|
|
|
|
|
|
|
|
|
|
|
|
def status_bar(widgets):
|
2022-04-30 20:33:28 +02:00
|
|
|
#return bar.Bar(widgets, 24, background="#000000AA", margin=[10, 16, 0, 16]) # Margin = N E S W
|
|
|
|
return bar.Bar(widgets, 24, background="#000000AA", margin=[0, 0, 0, 0]) # Margin = N E S W
|
2022-04-30 12:49:30 +02:00
|
|
|
|
|
|
|
|
2022-04-30 20:33:28 +02:00
|
|
|
screens = [Screen(wallpaper='~/wallpapers/archlinux2.jpg', wallpaper_mode='fill', top=status_bar(primary_widgets))]
|
2022-04-30 12:49:30 +02:00
|
|
|
|
|
|
|
# xrandr = "xrandr | grep -w 'connected' | cut -d ' ' -f 2 | wc -l"
|
|
|
|
|
|
|
|
# command = subprocess.run(
|
|
|
|
# xrandr,
|
|
|
|
# shell=True,
|
|
|
|
# stdout=subprocess.PIPE,
|
|
|
|
# stderr=subprocess.PIPE,
|
|
|
|
# )
|
|
|
|
|
|
|
|
# if command.returncode != 0:
|
|
|
|
# error = command.stderr.decode("UTF-8")
|
|
|
|
# logger.error(f"Failed counting monitors using {xrandr}:\n{error}")
|
|
|
|
# connected_monitors = 1
|
|
|
|
# else:
|
|
|
|
# connected_monitors = int(command.stdout.decode("UTF-8"))
|
|
|
|
|
|
|
|
connected_monitors = 2
|
|
|
|
|
|
|
|
if connected_monitors > 1:
|
|
|
|
for _ in range(1, connected_monitors):
|
2022-04-30 20:33:28 +02:00
|
|
|
screens.append(Screen(wallpaper='~/wallpapers/archlinux2.jpg', wallpaper_mode='fill', top=status_bar(secondary_widgets)))
|