From 3e1a2d075ff789bda4ac78d63bb153414b199e21 Mon Sep 17 00:00:00 2001 From: Matt Nish-Lapidus Date: Tue, 11 Feb 2025 12:46:32 -0500 Subject: [PATCH] some niri and waybar tweaks --- flake.lock | 54 ++++++------- homes/emenel/default.nix | 1 + homes/emenel/dotfiles/dot_config/eww/eww.yuck | 11 +-- .../emenel/dotfiles/dot_config/waybar/config | 11 ++- modules/home/desktop.nix | 72 ++++++------------ modules/home/niri.nix | 18 +++-- modules/home/swaync.nix | 76 +++++++++++++++++++ 7 files changed, 149 insertions(+), 94 deletions(-) create mode 100644 modules/home/swaync.nix diff --git a/flake.lock b/flake.lock index 199b9bb..f71870b 100644 --- a/flake.lock +++ b/flake.lock @@ -69,11 +69,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1739207663, - "narHash": "sha256-H0Z/Uxh1EIoZRzpXgezQPekp3ccFd/WdUVinILVnM+Y=", + "lastModified": 1739266093, + "narHash": "sha256-Xs9Lvwh3mXARVY0DEgwN6pdPxueUmV/w8xUA5gR1m4M=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "66b6a800edf6c6ef58d021b81ab7e6a10ae34834", + "rev": "20e2333eb7184318ddfa0c9269a8e509b6de85d6", "type": "github" }, "original": { @@ -323,11 +323,11 @@ ] }, "locked": { - "lastModified": 1739198052, - "narHash": "sha256-fvAgCGK2phagbKv2S4YH4AIM566TKasfWMqYl3c3mPQ=", + "lastModified": 1739287084, + "narHash": "sha256-CtRNJsqsXIArJV+AKWZVBMO8PD1FQB69br+WMtTJEgI=", "owner": "nix-community", "repo": "home-manager", - "rev": "b0bd29bb4b8df265b13bbb4a6639afa74faaa831", + "rev": "8f351726c5841d86854e7fa6003ea472352f5208", "type": "github" }, "original": { @@ -649,11 +649,11 @@ }, "locked": { "dir": "nix", - "lastModified": 1738565510, - "narHash": "sha256-xmr17yq6/wlcF/69GkRlKKkWAUC8ZjPeZMIuHdJnpfk=", + "lastModified": 1739117194, + "narHash": "sha256-2TVzGZFBLFnDXyvNP/dqQMNefdp6UtAQCTsIJSTJ448=", "owner": "kmonad", "repo": "kmonad", - "rev": "7784e590405429f5105d9d038cbe13f887160805", + "rev": "21ad4d354e2ac6befb9679f12299942f318923ee", "type": "github" }, "original": { @@ -712,11 +712,11 @@ "xwayland-satellite-unstable": "xwayland-satellite-unstable" }, "locked": { - "lastModified": 1739206396, - "narHash": "sha256-dfU3l47sxFQbqLe5R9um//V5hplv/MhSwsZJR7JzBrg=", + "lastModified": 1739274409, + "narHash": "sha256-3FcN9tdRvU6U5DMaMYmXhqNermMn/E/fYXjYLSGjmGc=", "owner": "sodiboo", "repo": "niri-flake", - "rev": "9f15e7ace2dea798ce3490d2f723095ad4cce0d4", + "rev": "9d12c75d0956f3abcbd3e8084f5c5f6e4ce2b2c2", "type": "github" }, "original": { @@ -745,11 +745,11 @@ "niri-unstable": { "flake": false, "locked": { - "lastModified": 1739201373, - "narHash": "sha256-6upEicgdJH3JaS1oXS+wsgLToU14XL8/aOyL2KcS3KY=", + "lastModified": 1739269331, + "narHash": "sha256-6l7NMhvbgUOQpv6KVK9PI7YGa2s+M+4L0sIv9CAsH3k=", "owner": "YaLTeR", "repo": "niri", - "rev": "20769b4c2f843566880f020f117e7bde36edc332", + "rev": "7b18ff8870c2610b3d532afef81a387a7a3f21d3", "type": "github" }, "original": { @@ -1195,11 +1195,11 @@ ] }, "locked": { - "lastModified": 1738291974, - "narHash": "sha256-wkwYJc8cKmmQWUloyS9KwttBnja2ONRuJQDEsmef320=", + "lastModified": 1739262228, + "narHash": "sha256-7JAGezJ0Dn5qIyA2+T4Dt/xQgAbhCglh6lzCekTVMeU=", "owner": "Mic92", "repo": "sops-nix", - "rev": "4c1251904d8a08c86ac6bc0d72cc09975e89aef7", + "rev": "07af005bb7d60c7f118d9d9f5530485da5d1e975", "type": "github" }, "original": { @@ -1373,11 +1373,11 @@ }, "locked": { "dir": "nix", - "lastModified": 1739213592, - "narHash": "sha256-/KPhlBr2a3Be6X72H3oOubQBDIF21+ViU9czwEhL1A8=", + "lastModified": 1739250321, + "narHash": "sha256-MDmCkHp2BS1pS6LmQu2jQy+cFd9Aj/IORKE6zPEqGZY=", "owner": "wez", "repo": "wezterm", - "rev": "52c1ca749552af4d8a2f18ec10fe8f14b6622519", + "rev": "3eb95c4668cad1ecb9c556c46a16303bee4d13a6", "type": "github" }, "original": { @@ -1407,11 +1407,11 @@ "xwayland-satellite-unstable": { "flake": false, "locked": { - "lastModified": 1737837494, - "narHash": "sha256-wIMowP8Juas4ZwMRcpc+58sZ0kKTDu8fm13THPmv/F8=", + "lastModified": 1739246919, + "narHash": "sha256-/hBM43/Gd0/tW+egrhlWgOIISeJxEs2uAOIYVpfDKeU=", "owner": "Supreeeme", "repo": "xwayland-satellite", - "rev": "3944c9a0e40e5629f16ad023bbc90dac80d35a0f", + "rev": "44590a416d4a3e8220e19e29e0b6efe64a80315d", "type": "github" }, "original": { @@ -1429,11 +1429,11 @@ "rust-overlay": "rust-overlay_2" }, "locked": { - "lastModified": 1739209832, - "narHash": "sha256-HIguPyqa25pNd9sZr9V4Hc+9LtrLri8EtEXdMu1kgQM=", + "lastModified": 1739275518, + "narHash": "sha256-jcNiDYYDeQzVS5TIayo5mf3aMq1p8rOIcJgF1e3oCW8=", "owner": "sxyazi", "repo": "yazi", - "rev": "498623191a86b31cba990c963e22508db14a51ee", + "rev": "a4dde6a8484c06b25013433433374186bbb81971", "type": "github" }, "original": { diff --git a/homes/emenel/default.nix b/homes/emenel/default.nix index 59b716b..d406e7c 100644 --- a/homes/emenel/default.nix +++ b/homes/emenel/default.nix @@ -16,6 +16,7 @@ music langs emacs + swaync ]; home = { diff --git a/homes/emenel/dotfiles/dot_config/eww/eww.yuck b/homes/emenel/dotfiles/dot_config/eww/eww.yuck index 7057f7e..66fb09b 100644 --- a/homes/emenel/dotfiles/dot_config/eww/eww.yuck +++ b/homes/emenel/dotfiles/dot_config/eww/eww.yuck @@ -1,6 +1,7 @@ (defwidget bar [] (centerbox :orientation "h" - (workspaces) + (time) +(workspaces) (music) (sidestuff))) @@ -15,7 +16,7 @@ (metric :label "💾" :value {round((1 - (EWW_DISK["/"].free / EWW_DISK["/"].total)) * 100, 0)} :onchange "") - time)) + )) (defwidget workspaces [] (box :class "workspaces" @@ -55,9 +56,6 @@ (deflisten music :initial "" "playerctl --follow metadata --format '{{ artist }} - {{ title }}' || true") -(defpoll volume :interval "1s" - "scripts/getvol") - (defpoll time :interval "10s" "date '+%H:%M %b %d, %Y'") @@ -66,8 +64,7 @@ :windowtype "dock" :geometry (geometry :x "0%" :y "0%" - :width "90%" + :width "99%" :height "10px" :anchor "top center") - :reserve (struts :side "top" :distance "4%") (bar)) diff --git a/homes/emenel/dotfiles/dot_config/waybar/config b/homes/emenel/dotfiles/dot_config/waybar/config index 9be8541..0dc23b6 100644 --- a/homes/emenel/dotfiles/dot_config/waybar/config +++ b/homes/emenel/dotfiles/dot_config/waybar/config @@ -61,9 +61,9 @@ }, "network": { "format-wifi": "", - "format-ethernet": "", - "format-disconnected": "!", - "tooltip-format": "{essid} {ifname}" + "format-ethernet": "", + "format-disconnected": "󰱟", + "tooltip-format": "{essid} {ifname}", "max-length": 50, "on-click": "$HOME/.local/bin/wezlauncher nmtui", }, @@ -92,16 +92,15 @@ "format-paused": "{status_icon} {dynamic}", "dynamic-len": 75, "player-icons": { - "default": "▶", + "default": "", }, "status-icons": { - "paused": "⏸" + "paused": "" }, }, "wlr/taskbar": { "format": "{icon}", "icon-size": 20, - "icon-theme": "Numix-Circle", "tooltip-format": "{title}", "on-click": "activate", "app_ids-mapping": { diff --git a/modules/home/desktop.nix b/modules/home/desktop.nix index ad2cb01..11f85df 100644 --- a/modules/home/desktop.nix +++ b/modules/home/desktop.nix @@ -31,16 +31,13 @@ soundconverter wmctrl - # colloid-icon-theme - bibata-cursors - adwaita-qt godot_4 gdtoolkit_4 sane-airscan xsane - # bitwarden-cli + nix-config.pkgs-stable.bitwarden-cli bitwarden-desktop tailscale trayscale @@ -80,7 +77,7 @@ switcheroo - # blender + nix-config.pkgs-stable.blender davinci-resolve-studio steam processing @@ -131,10 +128,27 @@ name = pkgs.rice.cursor.name; package = pkgs.bibata-cursors; }; + theme = { + name = "Colloid-Dark"; + package = pkgs.colloid-gtk-theme.override { + tweaks = [ "normal" "nord" ]; + themeVariants = [ "grey" ]; + + }; + }; + iconTheme = { + name = "Colloid"; + package = nix-config.pkgs-stable.colloid-icon-theme; + }; }; qt = { enable = true; + platformTheme.name = "gtk3"; + style = { + package = pkgs.adwaita-qt; + name = "adwaita-dark"; + }; }; fonts = { @@ -151,51 +165,11 @@ ]; }; - services.swaync = { - enable = true; - settings = { - positionX = "right"; - positionY = "top"; - layer = "overlay"; - control-center-layer = "top"; - layer-shell = true; - cssPriority = "application"; - control-center-margin-top = 0; - control-center-margin-bottom = 0; - control-center-margin-right = 0; - control-center-margin-left = 0; - notification-2fa-action = true; - notification-inline-replies = false; - notification-icon-size = 64; - notification-body-image-height = 100; - notification-body-image-width = 200; - }; - style = -'' - .notification-row { - outline: none; - } - - .notification-row:focus, - .notification-row:hover { - background: @noti-bg-focus; - } - - .notification { - border-radius: 12px; - margin: 6px 12px; - box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3), 0 1px 3px 1px rgba(0, 0, 0, 0.7), - 0 2px 6px 2px rgba(0, 0, 0, 0.3); - padding: 0; - } -''; - }; - programs = { - eww = { - enable = true; - configDir = ../../homes/emenel/dotfiles/dot_config/eww; - }; + # eww = { + # enable = true; + # configDir = ../../homes/emenel/dotfiles/dot_config/eww; + # }; firefox.enable = true; }; diff --git a/modules/home/niri.nix b/modules/home/niri.nix index 0177262..091a43e 100644 --- a/modules/home/niri.nix +++ b/modules/home/niri.nix @@ -15,6 +15,7 @@ in { { command = ["clipse" "-listen"]; } { command = ["swayosd-server"]; } { command = ["waybar"]; } + # { command = ["eww" "daemon"]; } { command = [ "systemctl" "--user" "restart" "hypridle.service" "xwayland-satellite.service" ]; } ]; @@ -165,12 +166,19 @@ in { }; } - # Open the Firefox picture-in-picture player as floating by default. - { # This app-id regular expression will work for both: + { # Open the Firefox picture-in-picture player as floating by default. + # This app-id regular expression will work for both: # host Firefox (app-id is "firefox") # Flatpak Firefox (app-id is "org.mozilla.firefox") matches = [ { app-id= "r#\"firefox$\"# title=\"^Picture-in-Picture$\""; } ]; - open-floating = true; } + open-floating = true; + } + + { matches = [ { app-id="Renoise"; } + { app-id="Bitwig"; } + { app-id="labwc"; }]; + open-maximized = true; + } ]; switch-events = with config.lib.niri.actions; { @@ -273,8 +281,8 @@ in { "Mod+Page_Up".action = focus-workspace-up; "Mod+U".action = focus-workspace-down; "Mod+I".action = focus-workspace-up; - "Mod+Alt+Down".action = move-column-to-workspace-down; - "Mod+Alt+Up".action = move-column-to-workspace-up; + "Mod+Ctrl+Page_Down".action = move-column-to-workspace-down; + "Mod+Ctrl+Page_Up".action = move-column-to-workspace-up; "Mod+Ctrl+U".action = move-column-to-workspace-down; "Mod+Ctrl+I".action = move-column-to-workspace-up; diff --git a/modules/home/swaync.nix b/modules/home/swaync.nix new file mode 100644 index 0000000..f81a45a --- /dev/null +++ b/modules/home/swaync.nix @@ -0,0 +1,76 @@ +{ config, lib, pkgs, ... }: + +{ + services.swaync = { + enable = true; + settings = { + positionX = "right"; + positionY = "top"; + layer = "overlay"; + control-center-layer = "top"; + layer-shell = true; + cssPriority = "application"; + control-center-margin-top = 0; + control-center-margin-bottom = 0; + control-center-margin-right = 0; + control-center-margin-left = 0; + notification-2fa-action = true; + notification-inline-replies = false; + notification-icon-size = 64; + notification-body-image-height = 100; + notification-body-image-width = 200; + image-visibility = "when-available"; + + widgets = [ + "inhibitors" + "dnd" + "notifications" + ]; + + widget-config = { + inhibitors = { + "text" = "Inhibitors"; + "button-text" = "Clear All"; + "clear-all-button" = true; + }; + title = { + "text" = "Notifications"; + "clear-all-button" = false; + "button-text" = "Clear All"; + }; + dnd = { + "text" = "Do Not Disturb"; + }; + label = { + "max-lines" = 5; + "text" = "Label Text"; + }; + }; + }; + style = + '' + .control-center { + background: #111111; + border-radius: 6px; + padding: 6px; + border: 2px solid #34548a; + } + .notification-row { + outline: none; + } + + .notification-row:focus, + .notification-row:hover { + background: @noti-bg-focus; + } + + .notification { + border-radius: 6px; + margin: 6px 12px; + box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3), 0 1px 3px 1px rgba(0, 0, 0, 0.7), + 0 2px 6px 2px rgba(0, 0, 0, 0.3); + padding: 0; + } +''; + }; +}