qtile-extras icon indicating copy to clipboard operation
qtile-extras copied to clipboard

Powerline issue around systray on multiple screens

Open DeeeeLAN opened this issue 3 years ago • 7 comments

screen 1: 1666475633

screen 2: 1666475641

The orange one is the systray.

DeeeeLAN avatar Oct 22 '22 21:10 DeeeeLAN

You shouldn't be able to have multiple Systray widgets (not even mirrors)...

elParaguayo avatar Oct 24 '22 05:10 elParaguayo

There is only one systray widget on the first screen. Both of the surrounding widgets are mirrors.

DeeeeLAN avatar Oct 24 '22 06:10 DeeeeLAN

Ahhh. Decorations are going to have issues with mirrors because they will be included in the reflection. So, your green widget's reflection includes that orange part.

There's no easy fix for that (or not one that easily comes to mind). I'll have a think though!

elParaguayo avatar Oct 24 '22 06:10 elParaguayo

That makes sense, I didn't realize the leading edge of the widget was actually part of the previous widget. It makes sense, though, since you need to draw rectangles. I have migrated my white and green widgets to not use mirrors for now.

Would it make sense to make the two widgets overlap, then draw a transparent triangle on each edge that would recreate this effect? Maybe that way they wouldn't need to copy colors from neighbors.

DeeeeLAN avatar Oct 24 '22 23:10 DeeeeLAN

Ideally, yes. But that forces transparency on the user which they may not otherwise be using. That will cause issues for SysTray as it can't handle transparency.

elParaguayo avatar Oct 25 '22 03:10 elParaguayo

I've got an idea about how to fix this which may or may not work...!

elParaguayo avatar Oct 26 '22 19:10 elParaguayo

Would be great if you can test the fix in #142

elParaguayo avatar Oct 27 '22 15:10 elParaguayo

@DeeeeLAN have you been able to test the PR?

elParaguayo avatar Nov 05 '22 09:11 elParaguayo

Not yet. I can test it tomorrow, I am out of town today.

DeeeeLAN avatar Nov 05 '22 16:11 DeeeeLAN

I think something is wrong with this version. I currently have three screens connected.

here is the configuration
		Screen(
		bottom=bar.Bar(
			[
				CurrentLayoutIconWidget,
				GroupBoxWidget,
				PromptWidget,
				# modify(
				# 	TaskList,
				# 	**tasklist_config,
				# 	decorations=widget_defaults['decorations']
				# ),
				TaskListWidget,
				ChordWidget,
				# modify(
				# 	ToolTipWallpaper,
				# 	**wallpaper_config,
				# 	decorations=widget_defaults['decorations']
				# ),
				# widget.Systray(),
				WallpaperWidget,
				ClockWidget,
				QuickExitWidget,
			], 
			scale(60),
			background=gray_600,
			opacity=0.7,
		),
		top=bar.Bar(
			[
				CheckUpdatesWidget,
				CryptoTickerWidget,
				GenPollUrlWidget,
				Mpris2Widget,
				GlobalMenuWidget,
				SpacerWidget,
				NotifyWidget,
				# VisualizerWidget,
				ALSAWidgetWidget,
				ThermalZoneWidget,
				NvidiaSensorsWidget,
				CPUGraphWidget,
				HDDBusyGraphWidget,
				MemoryGraphWidget,
				NetGraphWidget,
			],
			scale(60),
			background=gray_800,
			opacity=0.7,
		),
		x=0,
		y=0,
		width=4800,
		height=2700,
	),
	Screen(
		bottom=bar.Bar(
			[
				CurrentLayoutIconWidget,
				GroupBoxWidget,
				PromptWidget,
				# modify(
				# 	TaskList,
				# 	**tasklist_config,
				# 	decorations=widget_defaults['decorations']
				# ),
				TaskListWidget,
				ChordWidget,
				# modify(
				# 	ToolTipWallpaper,
				# 	**wallpaper_config,
				# 	decorations=widget_defaults['decorations']
				# ),
				WallpaperWidget,
				SystrayWidget,
				ClockWidget,
				QuickExitWidget,
			], 
			scale(60),
			background=gray_800,
			opacity=0.7,
		),
		top=bar.Bar(
			[
				CheckUpdatesWidget,
				CryptoTickerWidget,
				GenPollUrlWidget,
				Mpris2Widget,
				GlobalMenuWidget,
				SpacerWidget,
				NotifyWidget,
				# VisualizerWidget,
				ALSAWidgetWidget,
				ThermalZoneWidget,
				NvidiaSensorsWidget,
				CPUGraphWidget,
				HDDBusyGraphWidget,
				MemoryGraphWidget,
				NetGraphWidget,
			],
			scale(60),
			background=gray_800,
			opacity=0.7,
		),
		x=4800,
		y=0,
		width=4800,
		height=2700,
	),
	Screen(
		bottom=bar.Bar(
			[
				CurrentLayoutIconWidget,
				GroupBoxWidget,
				PromptWidget,
				# modify(
				# 	TaskList,
				# 	**tasklist_config,
				# 	decorations=widget_defaults['decorations']
				# ),
				TaskListWidget,
				ChordWidget,
				# modify(
				# 	ToolTipWallpaper,
				# 	**wallpaper_config,
				# 	decorations=widget_defaults['decorations']
				# ),
				# widget.Systray(),
				WallpaperWidget,
				ClockWidget,
				QuickExitWidget,
			], 
			scale(60),
			background=gray_600,
			opacity=0.7,
		),
		top=bar.Bar(
			[
				CheckUpdatesWidget,
				CryptoTickerWidget,
				GenPollUrlWidget,
				Mpris2Widget,
				GlobalMenuWidget,
				SpacerWidget,
				NotifyWidget,
				# VisualizerWidget,
				ALSAWidgetWidget,
				ThermalZoneWidget,
				NvidiaSensorsWidget,
				CPUGraphWidget,
				HDDBusyGraphWidget,
				MemoryGraphWidget,
				NetGraphWidget,
			],
			scale(60),
			background=gray_800,
			opacity=0.7,
		),
		x=9600,
		y=0,
		width=4800,
		height=2700,
	),

Everything is set up to mirror except the systray widget on the middle screen. However, here is what the three screens look like: https://imgur.com/a/cShi2XZ

(They were too big for github I guess).

I haven't seen so many widgets crash before.

Here is the full configuration for all the widgets
widget_defaults = dict(
	font="sans",
	fontsize=scale(18),
	padding=scale(6),
	markup=False,
	decorations=[
		PowerLineDecoration(path="forward_slash")
	]
)
extension_defaults = widget_defaults.copy()

groupbox_config = dict(
	highlight_method='block',
	block_highlight_text_color='FFFFFF',
	fontsize=scale(24),
	background=tp(blue),
	name="groupbox"
)

wallpaper_config = dict(
	directory="~/Pictures/wallpapers",
	option="fill",
	font="MaterialIcons-Regular",
	label="  ",
	fontsize=scale(40),
	random_selection=True,
	# wallpaper_command=['feh', '--no-fehbg', '--bg-scale'],
	mouse_callbacks={
		left_click: lazy.widget['wallpaper'].function(shuffle_wallpaper),
		middle_click: lazy.widget['wallpaper'].function(remove_wallpaper),
		right_click: lazy.widget['wallpaper'].function(download_wallpaper),
	},
	background=tp(green),
	name="wallpaper"
)

systray_config = dict(
	icon_size=scale(20),
	padding=scale(16),
	background=tp(yellow),
	decorations=[
		PowerLineDecoration(path="forward_slash", extrawidth=20)
	],
	name="systray"
)

tasklist_config = dict(
	icon_size=scale(36), 
	fontsize=scale(24), 
	padding_y=scale(10), 
	padding_x = scale(10),
	margin_y=scale(7),
	border="#484E5B",
	borderwidth=scale(4),
	background=tp(cream),
	foreground=tp(black),
	name="tasklist"
)

chord_config = dict(
	chords_colors={
		"launch": ("#ff0000", "#ffffff"),
	},
	name_transform=lambda name: name.upper(),
	name="chord"
)

clock_config = dict(
	format=" %a, %b %d  |  %I:%M %p ",
	fontsize=scale(24),
	background=tp(red),
	mouse_callbacks={
		left_click: lazy.function(show_calendar)
	},
	name="clock"
)

quickexit_config = dict(
	default_text = "  ",
	font = "MaterialIcons-Regular",
	fontsize=scale(40),
	countdown_format = " {} ",
	decorations=[], 
	background=tp(purple),
	name="quickexit"
)

checkupdates_config = dict(
	distro="Arch_checkupdates",
	no_update_string="No updates",
	fontsize=scale(24),
	background=tp(blue),
	name="checkupdates"
)

cryptoticker_config = dict(
	fontsize=scale(24),
	background=tp(cyan),
	name="cryptoticker"
)

stockticker_config = dict(
	fontsize=scale(24), 
	url="https://eodhistoricaldata.com/api/real-time/SNPS.US?fmt=json&api_token=REDACTED",
	parse=lambda result: f"SNPS: ${format(result['close'], '.2f') }",
	fmt="{}",
	background=tp(green),
	name="stockticker"
)

mpris2_config = dict(
	name="cider",
	objname="org.mpris.MediaPlayer2.cider",
	stopped_text="Not playing",
	paused_text="Music paused",
	display_metadata=["xesam:title", "xesam:artist", "xesam:album"],
	fontsize=scale(24),
	width=scale(600),
	background=tp(purple)
)

globalmenu_config = dict()

visualizer_config = dict(
	background=tp(purple),
	bar_height=scale(32),
	bars=12,
	width=scale(100),
	name="visualizer",
)

notify_config = dict(
	background=tp(yellow),
	name="notify"
)

alsawidget_config = dict(
	mode='both',
	theme_path='~/.config/qtile/icons',
	background=tp(green),
	name="alsawidget"
)

thermalzone_config = dict(
	fontsize=scale(24),
	background=tp(blue),
	name="thermalzone"
)

nvidia_config = dict(
	format="{temp}°C | {fan_speed} | {perf}", 
	fontsize=scale(24),
	background=tp(red),
	name="nvidia"
)

graph_config = dict(
	background=tp(cream),
	name="graph"
)

CurrentLayoutIconWidget = widget.CurrentLayoutIcon(scale=0.50, background=tp(cyan), name="currentlayout")
GroupBoxWidget = widget.GroupBox(**groupbox_config)
PromptWidget = widget.Prompt(background=tp(red), name="prompt")
TaskListWidget = modify(
	TaskList,
	**tasklist_config,
	decorations=widget_defaults['decorations']
)
TaskListWidget = widget.TaskList(**tasklist_config)
ChordWidget = widget.Chord(**chord_config)
WallpaperWidget = modify(
	ToolTipWallpaper,
	**wallpaper_config,
	decorations=widget_defaults['decorations']
)
SystrayWidget = widget.Systray(**systray_config)
ClockWidget = widget.Clock(**clock_config)
QuickExitWidget = widget.QuickExit(**quickexit_config)

CheckUpdatesWidget = widget.CheckUpdates(**checkupdates_config)
CryptoTickerWidget = widget.CryptoTicker(**cryptoticker_config)
GenPollUrlWidget = widget.GenPollUrl(**stockticker_config)
Mpris2Widget = widget.Mpris2(**mpris2_config)
GlobalMenuWidget = widget.GlobalMenu(**globalmenu_config)
SpacerWidget = widget.Spacer()
# VisualizerWidget = widget.Visualizer(**visualizer_config)
NotifyWidget = widget.Notify(**notify_config)
ALSAWidgetWidget = widget.ALSAWidget(**alsawidget_config)
ThermalZoneWidget = widget.ThermalZone(**thermalzone_config)
NvidiaSensorsWidget = widget.NvidiaSensors(**nvidia_config)
CPUGraphWidget = ToolTipCPUGraph(**graph_config)
HDDBusyGraphWidget = ToolTipHDDBusyGraph(**graph_config)
MemoryGraphWidget = ToolTipMemoryGraph(**graph_config)
NetGraphWidget = ToolTipNetGraph(decorations=[], **graph_config)

DeeeeLAN avatar Nov 07 '22 04:11 DeeeeLAN

Ok. So that clearly didn't work!! Sorry about that.

Let me try at your config when I get a chance.

elParaguayo avatar Nov 07 '22 09:11 elParaguayo

This config has too many customisations that makes it very hard for me to test it. I'm missing your custom functions, widgets etc.

I'd really appreciate a minimal example (without customisations as much as possible) to test.

elParaguayo avatar Nov 07 '22 21:11 elParaguayo

Try this:

red = '#DF5B61'
green = '#78B892'
yellow = '#DE8F78'
blue = '#6791C9'
purple = '#BC83E3'
cyan = '#67AFC1'
cream = '#D9D7D6'
black = '#000A0E'
widget_defaults = dict(
	font="sans",
	fontsize=18,
	padding=6,
	markup=False,
	decorations=[
		PowerLineDecoration(path="forward_slash")
	]
)
extension_defaults = widget_defaults.copy()
tasklist_config = dict(
	icon_size=36, 
	fontsize=24, 
	padding_y=10, 
	padding_x = 10,
	margin_y=7,
	border="#484E5B",
	borderwidth=4,
	background=cream,
	foreground=black,
	name="tasklist"
)
wallpaper_config = dict(
	directory="~/Pictures/wallpapers",
	option="fill",
	font="MaterialIcons-Regular",
	label="  ",
	fontsize=40,
	random_selection=True,
	background=green,
	name="wallpaper"
)
systray_config = dict(
	icon_size=20,
	padding=16,
	background=yellow,
	decorations=[
		PowerLineDecoration(path="forward_slash", extrawidth=20)
	],
	name="systray"
)
clock_config = dict(
	format=" %a, %b %d  |  %I:%M %p ",
	fontsize=24,
	background=red,
	name="clock"
)
TaskListWidget = widget.TaskList(**tasklist_config)
WallpaperWidget = widget.Wallpaper(**wallpaper_config)
SystrayWidget = widget.Systray(**systray_config)
ClockWidget = widget.Clock(**clock_config)
fake_screens = [
		Screen(
		bottom=bar.Bar(
			[
				TaskListWidget,
				WallpaperWidget,
				ClockWidget,
			], 
			60,
			opacity=0.7,
		),
		x=0,
		y=0,
		width=4800,
		height=2700,
	),
	Screen(
		bottom=bar.Bar(
			[
				TaskListWidget,
				WallpaperWidget,
				SystrayWidget,
				ClockWidget,
			], 
			60,
			opacity=0.7,
		),
		x=4800,
		y=0,
		width=4800,
		height=2700,
	),
	Screen(
		bottom=bar.Bar(
			[
				TaskListWidget,
				WallpaperWidget,
				ClockWidget,
			], 
			60,
			opacity=0.7,
		),
		x=9600,
		y=0,
		width=4800,
		height=2700,
	),
]

DeeeeLAN avatar Nov 08 '22 01:11 DeeeeLAN

Thanks. Yes - definitely something weird going on there. Need to dig into this some more.

elParaguayo avatar Nov 08 '22 09:11 elParaguayo

Right. I think I've got to the bottom of this.

I've pushed a new fix here but it actually needs a change in qtile too (https://github.com/qtile/qtile/pull/3971)

elParaguayo avatar Nov 08 '22 18:11 elParaguayo

Just installed both updates - It is looking good to me!

DeeeeLAN avatar Nov 09 '22 23:11 DeeeeLAN