From 277d35ff47b0c0101aeeec5b90ebdceb54939f67 Mon Sep 17 00:00:00 2001 From: Donovan Glover Date: Tue, 27 Jun 2023 05:20:06 -0400 Subject: [PATCH] waybar: Set position based on variable This makes it easier to switch between having the bar on the top, bottom, left, or right. --- home/waybar.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/home/waybar.nix b/home/waybar.nix index 5cc9aa1..5dbb68a 100644 --- a/home/waybar.nix +++ b/home/waybar.nix @@ -2,6 +2,8 @@ let opacity = lib.strings.floatToString config.stylix.opacity.terminal; + position = "right"; + opposite = builtins.replaceStrings ["left" "right" "top" "bottom"] ["right" "left" "bottom" "top"] position; in { programs.waybar = { @@ -10,7 +12,7 @@ in settings = { mainBar = { layer = "top"; - position = "right"; + position = position; width = 45; spacing = 8; @@ -114,7 +116,7 @@ in window#waybar { background: alpha(@base00, ${opacity}); - border-left: 1px solid alpha(@base02, 0.67); + border-${opposite}: 1px solid alpha(@base02, 0.67); } window#waybar.fullscreen #workspaces button.active {