From 969b566369db4472bc10c41cad90be5f4fe89f7c Mon Sep 17 00:00:00 2001 From: unexplrd Date: Sat, 8 Feb 2025 13:21:16 +0200 Subject: [PATCH] steal swaync from MaxMur --- flake.lock | 15 +- flake.nix | 2 +- modules/home/desktop/hyprland/default.nix | 197 ++++++++++++++++++++-- 3 files changed, 197 insertions(+), 17 deletions(-) diff --git a/flake.lock b/flake.lock index 1903229..a489d8d 100644 --- a/flake.lock +++ b/flake.lock @@ -567,14 +567,17 @@ ] }, "locked": { - "lastModified": 1738941289, - "narHash": "sha256-5weUK2SGAW53dNJo53ZoH2gO/Ce8Qc0l9SVFpy/TcMM=", - "path": "/home/user/.config/Neve", - "type": "path" + "lastModified": 1738941286, + "narHash": "sha256-rBm+US6iZoimF2/AkrWNL3omc+6v4Fj39MbJ4r2U//g=", + "ref": "refs/heads/main", + "rev": "5bb8ba507ea45fb8a6865526c8b81bdc41e431c2", + "revCount": 3, + "type": "git", + "url": "https://gitea.linerds.us/unexplrd/Neve" }, "original": { - "path": "/home/user/.config/Neve", - "type": "path" + "type": "git", + "url": "https://gitea.linerds.us/unexplrd/Neve" } }, "nix-darwin": { diff --git a/flake.nix b/flake.nix index 12fa6d3..7174da0 100644 --- a/flake.nix +++ b/flake.nix @@ -19,7 +19,7 @@ inputs.nixpkgs.follows = "nixpkgs"; }; neve = { - url = "path:/home/user/.config/Neve"; + url = "git+https://gitea.linerds.us/unexplrd/Neve"; inputs.nixpkgs.follows = "nixpkgs"; inputs.nixvim.follows = "nixvim"; }; diff --git a/modules/home/desktop/hyprland/default.nix b/modules/home/desktop/hyprland/default.nix index 1b59a8a..56a28a8 100644 --- a/modules/home/desktop/hyprland/default.nix +++ b/modules/home/desktop/hyprland/default.nix @@ -1,7 +1,6 @@ { osConfig, config, - inputs, pkgs, lib, ... @@ -112,7 +111,7 @@ in { enable_gesture = true; # laptop touchpad gesture_fingers = 3; # 3 or 4 gesture_distance = 400; # how far is the "max" - gesture_positive = true; # positive = swipe down. Negative = swipe up.; + gesture_positive = false; # positive = swipe down. Negative = swipe up.; }; } { @@ -352,11 +351,11 @@ in { "float, class:(com.github.hluk.copyq)" "float, class:(nm-connection-editor)" "float, class:(.blueman-manager-wrapped)" - # flameshot - "noanim, class:^(flameshot)$" - "float, class:^(flameshot)$" - "move 0 0, class:^(flameshot)$" - "pin, class:^(flameshot)$" + # screenshot editor + "noanim, class:^(com.gabm.satty)$" + "float, class:^(com.gabm.satty)$" + "move 0 0, class:^(com.gabm.satty)$" + "pin, class:^(com.gabm.satty)$" ## games "float, class:(com.mojang.minecraft.java-edition)" "immediate, class:(com.mojang.minecraft.java-edition)" @@ -463,7 +462,7 @@ in { "clock" "wlr/taskbar" ]; - modules-center = ["group/hypr"]; + modules-center = ["group/hypr" "custom/notification"]; modules-right = [ "privacy" "tray" @@ -784,6 +783,7 @@ in { } #taskbar, + #idle_inhibitor, #workspaces { padding: 0 0.5em; } @@ -1416,8 +1416,185 @@ in { ''; }; }; - services.dunst = { + services.swaync = { enable = true; + settings = { + cssPriority = "user"; + image-visibility = "when-available"; + keyboard-shortcut = true; + relative-timestamps = true; + timeout = 5; + timeout-low = 5; + timeout-critical = 0; + script-fail-notify = true; + transition-time = 200; + + # Layer settings + layer-shell = true; + layer = "overlay"; + control-center-layer = "overlay"; + + # Notification settings + positionX = "right"; + positionY = "top"; + notification-2fa-action = true; + notification-inline-replies = false; + notification-icon-size = 32; + notification-body-image-height = 100; + notification-body-image-width = 200; + notification-window-width = 300; + + # Control center settings + control-center-positionX = "right"; + control-center-positionY = "top"; + control-center-width = 500; + control-center-exclusive-zone = true; + fit-to-screen = true; + hide-on-action = true; + hide-on-clear = false; + + # Widget settings + widgets = [ + "title" + "dnd" + "notifications" + "mpris" + ]; + + widget-config = { + title = { + text = "Notifications"; + clear-all-button = true; + button-text = "Clear All"; + }; + dnd = { + text = "Do Not Disturb"; + }; + mpris = { + image-size = 96; + image-radius = 12; + blur = true; + }; + }; + }; + style = '' + /*** Global ***/ + progress, + progressbar, + trough { + border-radius: 16px; + } + + .app-icon, + .image { + -gtk-icon-effect: none; + } + + .notification-action { + border-radius: 12px; + margin: 0.5rem; + } + + .close-button { + margin: 24px; + padding: 0.2rem; + border-radius: 16px; + } + + /*** Notifications ***/ + .notification-group.collapsed + .notification-row:not(:last-child) + .notification-action, + .notification-group.collapsed + .notification-row:not(:last-child) + .notification-default-action { + opacity: 0; + } + + .trough { + margin: 4px; + border-radius: 7px; + } + + .notification, + .notification.low, + .notification.normal, + .notification.critical, + .control-center { + margin: 16px; + border-radius: 7px; + } + + .floating-notifications, + .notification-content { + border-radius: 7px; + } + + .control-center-list { + background: transparent; + } + + /*** Widgets ***/ + /* Title widget */ + .widget-title { + margin: 0.5rem; + } + + .widget-title > label { + font-weight: bold; + } + + .widget-title > button { + border-radius: 16px; + padding: 0.5rem; + } + + /* DND Widget */ + .widget-dnd { + margin: 0.5rem; + } + + .widget-dnd > label { + font-weight: bold; + } + + .widget-dnd > switch { + border-radius: 16px; + } + + .widget-dnd > switch slider { + border-radius: 16px; + padding: 0.25rem; + } + + /* Mpris widget */ + .widget-mpris .widget-mpris-player { + border-radius: 16px; + margin: 0.5rem; + padding: 0.5rem; + } + + .widget-mpris .widget-mpris-player .widget-mpris-album-art { + border-radius: 16px; + } + + .widget-mpris .widget-mpris-player .widget-mpris-title { + font-weight: bold; + } + + .widget-mpris .widget-mpris-player .widget-mpris-subtitle { + font-weight: normal; + } + + .widget-mpris .widget-mpris-player > box > button { + border: 1px solid transparent; + border-radius: 16px; + padding: 0.25rem; + } + ''; + }; + services.dunst = { + enable = false; settings = { global = { width = 300; @@ -1546,7 +1723,7 @@ in { tray = "auto"; }; services.flameshot = { - enable = true; + enable = false; settings = { General = { buttons = "@Variant(000x7f000vQList0000x130000000x1000x2000x3000x4000x5000x6000x12000xf000x13000b000 000x10000000v000x17000xe000f000x11)";