mirror of
				https://github.com/rad4day/Waybar.git
				synced 2025-11-04 09:42:42 +01:00 
			
		
		
		
	fix: check vertical after parsing multiple outputs
This commit is contained in:
		@@ -98,6 +98,7 @@
 | 
				
			|||||||
    "custom/spotify": {
 | 
					    "custom/spotify": {
 | 
				
			||||||
        "format": " {}",
 | 
					        "format": " {}",
 | 
				
			||||||
        "max-length": 40,
 | 
					        "max-length": 40,
 | 
				
			||||||
 | 
					        "escape": true,
 | 
				
			||||||
        "exec": "$HOME/.config/waybar/mediaplayer.py 2> /dev/null" // Script in resources folder
 | 
					        "exec": "$HOME/.config/waybar/mediaplayer.py 2> /dev/null" // Script in resources folder
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										11
									
								
								src/bar.cpp
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								src/bar.cpp
									
									
									
									
									
								
							@@ -28,12 +28,6 @@ waybar::Bar::Bar(const Client& client,
 | 
				
			|||||||
  setupConfig();
 | 
					  setupConfig();
 | 
				
			||||||
  setupCss();
 | 
					  setupCss();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (config_["position"] == "right" || config_["position"] == "left") {
 | 
					 | 
				
			||||||
    vertical = true;
 | 
					 | 
				
			||||||
    height_ = 0;
 | 
					 | 
				
			||||||
    width_ = 30;
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  auto wrap = reinterpret_cast<GtkWidget*>(window.gobj());
 | 
					  auto wrap = reinterpret_cast<GtkWidget*>(window.gobj());
 | 
				
			||||||
  gtk_widget_realize(wrap);
 | 
					  gtk_widget_realize(wrap);
 | 
				
			||||||
  GdkWindow *gdk_window = gtk_widget_get_window(wrap);
 | 
					  GdkWindow *gdk_window = gtk_widget_get_window(wrap);
 | 
				
			||||||
@@ -101,6 +95,11 @@ void waybar::Bar::initBar()
 | 
				
			|||||||
  };
 | 
					  };
 | 
				
			||||||
  zwlr_layer_surface_v1_add_listener(layer_surface, &layer_surface_listener, this);
 | 
					  zwlr_layer_surface_v1_add_listener(layer_surface, &layer_surface_listener, this);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  if (config_["position"] == "right" || config_["position"] == "left") {
 | 
				
			||||||
 | 
					    height_ = 0;
 | 
				
			||||||
 | 
					    width_ = 30;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  auto height = config_["height"].isUInt() ? config_["height"].asUInt() : height_;
 | 
					  auto height = config_["height"].isUInt() ? config_["height"].asUInt() : height_;
 | 
				
			||||||
  auto width = config_["width"].isUInt() ? config_["width"].asUInt() : width_;
 | 
					  auto width = config_["width"].isUInt() ? config_["width"].asUInt() : width_;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user