From 7a3534ee1b7116eeb7616b10f3117c20e4c6b891 Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Mon, 10 Jul 2023 15:51:03 +0100 Subject: [PATCH] Update binds and add compact versions of more waybar modules --- flake.nix | 2 +- home/desktop/hyprland.nix | 55 +++++++++++++++++---------- home/desktop/waybar/laptop.nix | 16 ++++---- home/desktop/waybar/main.nix | 4 +- home/desktop/waybar/modules.nix | 64 +++++++++++++++++++++++++++----- home/desktop/waybar/style.css | 8 ++-- home/desktop/waybar/vertical.nix | 8 ++-- 7 files changed, 110 insertions(+), 47 deletions(-) diff --git a/flake.nix b/flake.nix index bb2ec85d..3b9d47d7 100644 --- a/flake.nix +++ b/flake.nix @@ -186,7 +186,7 @@ xdg.configFile."hypr/display.conf".text = '' monitor=desc:Iiyama North America PLB2403WS 0574281251316,1920x1200,0x185,1 monitor=desc:Dell Inc. DELL U2417H 5K9YD872FY1L,1920x1080,1920x0,1,transform,1 - monitor=eDP-1,1920x1080,0x1385,1 + monitor=eDP-1,1920x1080,640x1385,1.5 monitor=,preferred,auto,auto ''; }; diff --git a/home/desktop/hyprland.nix b/home/desktop/hyprland.nix index bbedb3fe..07e6f4f2 100644 --- a/home/desktop/hyprland.nix +++ b/home/desktop/hyprland.nix @@ -135,13 +135,21 @@ in { bind = SUPER SHIFT, K, movewindow, u bind = SUPER SHIFT, J, movewindow, d + bind = SUPER, A, moveworkspacetomonitor, 1 current bind = SUPER, A, workspace, 1 + bind = SUPER, S, moveworkspacetomonitor, 2 current bind = SUPER, S, workspace, 2 + bind = SUPER, D, moveworkspacetomonitor, 3 current bind = SUPER, D, workspace, 3 + bind = SUPER, F, moveworkspacetomonitor, 4 current bind = SUPER, F, workspace, 4 + bind = SUPER, U, moveworkspacetomonitor, 5 current bind = SUPER, U, workspace, 5 + bind = SUPER, I, moveworkspacetomonitor, 6 current bind = SUPER, I, workspace, 6 + bind = SUPER, O, moveworkspacetomonitor, 7 current bind = SUPER, O, workspace, 7 + bind = SUPER, P, moveworkspacetomonitor, 8 current bind = SUPER, P, workspace, 8 bind = SUPER SHIFT, A, movetoworkspace, 1 bind = SUPER SHIFT, S, movetoworkspace, 2 @@ -171,25 +179,34 @@ in { bindm = SUPER, mouse:273, resizewindow # See https://wiki.hyprland.org/Configuring/Window-Rules/ for more - windowrule = float, ^(foot)$ - windowrule = float, ^(pavucontrol)$ - windowrule = float, ^(.blueman-manager-wrapped)$ - windowrule = float, ^(nm-connection-editor)$ - windowrule = float, ^(otpclient)$ - windowrule = float, ^(thunar)$ - - windowrule = center, ^(foot)$ - windowrule = center, ^(pavucontrol)$ - windowrule = center, ^(.blueman-manager-wrapped)$ - windowrule = center, ^(nm-connection-editor)$ - windowrule = move 2% 6%, ^(otpclient)$ - - windowrule = workspace 2, neovide - windowrule = workspace 3, firefox - windowrule = workspace 5 silent, ^(Signal|fractal|discord|teams-for-linux)$ - windowrule = workspace 4, thunar - windowrule = workspace 4, libreoffice.* - windowrule = workspace 4, Zotero + windowrule = workspace 2,(neovide) + windowrule = workspace 3,(firefox) + windowrule = workspace 4,(libreoffice).* + windowrule = workspace 4,(Zotero) + windowrule = workspace 5,(Signal) + windowrule = workspace 5,(fractal) + windowrule = workspace 5,(discord) + windowrule = workspace 5,(teams-for-linux) + windowrule = workspace 5,title:^(Zoom|zoom).*,xwayland:1 + windowrule = nofullscreenrequest,title:^(Zoom|zoom).* + windowrule = workspace 6,(Nxplayer.bin) + windowrule = float,class:(Nxplayer.bin),title:^(NoMachine)$ + windowrule = maximize,class:(Nxplayer.bin),title:^(NoMachine).+$ + windowrule = float,(foot) + windowrule = center,(foot) + windowrule = float,(pavucontrol) + windowrule = size 800 600,(pavucontrol) + windowrule = move 100%-820 10%,(pavucontrol) + windowrule = float,(.blueman-manager-wrapped) + windowrule = size 800 600,(.blueman-manager-wrapped) + windowrule = move 100%-820 10%,(.blueman-manager-wrapped) + windowrule = float,(nm-connection-editor) + windowrule = size 800 600,(nm-connection-editor) + windowrule = move 100%-820 10%,(nm-connection-editor) + windowrule = float,(otpclient) + windowrule = move 10% 10%,(otpclient) + windowrule = float,(thunar) + windowrule = center,(thunar) ''; }; xdg.configFile."hypr/display.conf".text = lib.mkDefault '' diff --git a/home/desktop/waybar/laptop.nix b/home/desktop/waybar/laptop.nix index a70b7973..b89d95bb 100644 --- a/home/desktop/waybar/laptop.nix +++ b/home/desktop/waybar/laptop.nix @@ -11,20 +11,20 @@ in { margin-right = 20; margin-bottom = 5; "modules-left" = [ - "clock#compact" + "wlr/workspaces" "cpu" "memory" "temperature" ]; "modules-center" = [ - "wlr/workspaces" + "clock#compact" ]; "modules-right" = [ - "pulseaudio" - "bluetooth" + "pulseaudio#compact" + "bluetooth#compact" "network#compact" "backlight" - "battery" + "battery#compact" "tray" ]; "clock#compact" = modules."clock#compact"; @@ -32,11 +32,11 @@ in { memory = modules.memory; temperature = modules.temperature; "wlr/workspaces" = modules."wlr/workspaces"; - pulseaudio = modules.pulseaudio; - bluetooth = modules.bluetooth; + "pulseaudio#compact" = modules."pulseaudio#compact"; + "bluetooth#compact" = modules."bluetooth#compact"; "network#compact" = modules."network#compact"; backlight = modules.backlight; - battery = modules.battery; + "battery#compact" = modules."battery#compact"; tray = modules.tray; }; } diff --git a/home/desktop/waybar/main.nix b/home/desktop/waybar/main.nix index 81531700..c65ec2c5 100644 --- a/home/desktop/waybar/main.nix +++ b/home/desktop/waybar/main.nix @@ -11,13 +11,13 @@ in { margin-right = 20; margin-bottom = 5; "modules-left" = [ - "clock" + "wlr/workspaces" "cpu" "memory" "temperature" ]; "modules-center" = [ - "wlr/workspaces" + "clock" ]; "modules-right" = [ "pulseaudio" diff --git a/home/desktop/waybar/modules.nix b/home/desktop/waybar/modules.nix index 157af43d..0ef7e52b 100644 --- a/home/desktop/waybar/modules.nix +++ b/home/desktop/waybar/modules.nix @@ -36,7 +36,22 @@ }; "clock#compact" = { format = "{:%R 󰅐 }"; - tooltip-format = "{:%A %Y-%m-%d 󰃭 }"; + format-alt = "{:%A %Y-%m-%d 󰃭 }"; + tooltip-format = "{calendar}"; + calendar = { + mode = "year"; + mode-mon-col = 3; + weeks-pos = "right"; + on-scroll = 1; + on-click-right = "mode"; + format = { + months = "{}"; + days = "{}"; + weeks = "W{}"; + weekdays = "{}"; + today = "{}"; + }; + }; }; cpu = { format = "{usage}% 󰻠"; @@ -53,7 +68,8 @@ ]; }; backlight = { - format = "{percent}% {icon}"; + format = "{icon}"; + tooltip-format = "{percent}%"; format-icons = [ "" "" @@ -71,10 +87,32 @@ warning = 30; critical = 15; }; - format = "{capacity}% {icon}"; - format-charging = "{capacity}% 󰂄"; + format = "{time} {capacity}% {icon}"; + format-charging = "{time} {capacity}% 󰂄"; format-plugged = "{capacity}% 󰚥"; - format-alt = "{time} {icon}"; + format-icons = [ + "󱃍" + "󰁺" + "󰁻" + "󰁼" + "󰁽" + "󰁾" + "󰁿" + "󰂀" + "󰂁" + "󰂂" + "󰁹" + ]; + }; + "battery#compact" = { + states = { + warning = 30; + critical = 15; + }; + format = "{icon}"; + format-charging = "󰂄"; + format-plugged = "󰚥"; + tooltip-format = "{time} {capacity}%"; format-icons = [ "󱃍" "󰁺" @@ -95,7 +133,6 @@ tooltip-format = "{ifname}"; format-linked = "{ifname} (No IP) 󰈁"; format-disconnected = "Disconnected 󰈂"; - format-alt = "{ifname}: {ipaddr}/{cidr}"; on-click = "nm-connection-editor"; }; "network#compact" = { @@ -114,6 +151,15 @@ format-connected = "󰂱 {device_alias}"; on-click = "blueman-manager"; }; + "bluetooth#compact" = { + format = "󰂯"; + format-disabled = "󰂲"; + format-off = "󰂲"; + format-on = "󰂯"; + format-connected = "󰂱"; + tooltip-format = "{status} | {device_alias}"; + on-click = "blueman-manager"; + }; pulseaudio = { scroll-step = 5; format = "{volume}% {icon} {format_source}"; @@ -167,7 +213,7 @@ "wlr/workspaces" = { on-click = "activate"; disable-scroll = true; - all-outputs = true; + all-outputs = false; format = "{icon}"; format-icons = { "1" = "󰟀"; @@ -181,8 +227,6 @@ urgent = ""; default = "󰣘"; }; - sort-by-name = true; - sort-by-coordinates = false; - sort-by-number = false; + sort-by-number = true; }; } diff --git a/home/desktop/waybar/style.css b/home/desktop/waybar/style.css index 818bb04e..6959c4c5 100644 --- a/home/desktop/waybar/style.css +++ b/home/desktop/waybar/style.css @@ -75,12 +75,12 @@ window#waybar.hidden { } /* left section */ -#clock, +#workspaces, #cpu, #memory, #temperature, /* centre section */ -#workspaces, +#clock, /* right section */ #pulseaudio, #bluetooth, @@ -99,7 +99,7 @@ window#waybar.hidden { background: @lavender; } -#clock { +#workspaces { background: @lavender; } #cpu { @@ -111,7 +111,7 @@ window#waybar.hidden { #temperature { background: @red; } -#workspaces { +#clock { background: @yellow; } #pulseaudio { diff --git a/home/desktop/waybar/vertical.nix b/home/desktop/waybar/vertical.nix index fde19d31..650c1c3e 100644 --- a/home/desktop/waybar/vertical.nix +++ b/home/desktop/waybar/vertical.nix @@ -11,10 +11,12 @@ in { margin-left = 20; margin-right = 20; margin-bottom = 5; - "modules-left" = []; - "modules-center" = ["wlr/workspaces"]; - "modules-right" = []; + "modules-left" = ["wlr/workspaces"]; + "modules-center" = ["clock#compact"]; + "modules-right" = ["tray"]; "wlr/workspaces" = modules."wlr/workspaces"; + "clock#compact" = modules."clock#compact"; + tray = modules.tray; }; }; }