swaync and gtklock

This commit is contained in:
unexplrd
2025-02-09 23:40:59 +02:00
parent e897825573
commit ec5faa59a9
3 changed files with 476 additions and 307 deletions

8
flake.lock generated
View File

@ -635,11 +635,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1738941286, "lastModified": 1739126593,
"narHash": "sha256-rBm+US6iZoimF2/AkrWNL3omc+6v4Fj39MbJ4r2U//g=", "narHash": "sha256-aVixbVsMsb63xH8Bi/6/xaN1rEF8uMvx0vWbN41Or6o=",
"ref": "refs/heads/main", "ref": "refs/heads/main",
"rev": "5bb8ba507ea45fb8a6865526c8b81bdc41e431c2", "rev": "c528a43b7ab04cd818441dc87ccde082b33bd12f",
"revCount": 3, "revCount": 6,
"type": "git", "type": "git",
"url": "https://gitea.linerds.us/unexplrd/Neve" "url": "https://gitea.linerds.us/unexplrd/Neve"
}, },

View File

@ -7,6 +7,10 @@
}: }:
with lib; let with lib; let
cfg = config.desktop.niri; cfg = config.desktop.niri;
terminal = "ghostty";
launcher = "walker";
browser = "app.zen_browser.zen";
lockscreen = "gtklock";
in { in {
options = { options = {
desktop.niri.enable = desktop.niri.enable =
@ -41,8 +45,186 @@ in {
}; };
systemdTarget = "graphical-session.target"; systemdTarget = "graphical-session.target";
}; };
dunst = { swaync = {
enable = true; 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;
}
.notification-content,
.floating-notifications {
border: transparent;
background: transparent;
}
.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;
}
'';
};
dunst = {
enable = false;
settings = { settings = {
global = { global = {
width = 300; width = 300;
@ -67,13 +249,13 @@ in {
settings = { settings = {
general = { general = {
before_sleep_cmd = "loginctl lock-session"; before_sleep_cmd = "loginctl lock-session";
lock_cmd = "pidof hyprlock || hyprlock"; lock_cmd = "pidof ${lockscreen} || ${lockscreen}";
# unlock_cmd = "loginctl unlock-session"; # unlock_cmd = "loginctl unlock-session";
}; };
listener = [ listener = [
{ {
timeout = 600; timeout = 600;
on-timeout = "pidof hyprlock || hyprlock"; on-timeout = "pidof ${lockscreen} || ${lockscreen}";
} }
{ {
timeout = 601; timeout = 601;
@ -84,7 +266,7 @@ in {
}; };
}; };
programs.hyprlock = { programs.hyprlock = {
enable = true; enable = false;
settings = { settings = {
general = { general = {
disable_loading_bar = true; disable_loading_bar = true;
@ -173,11 +355,6 @@ in {
target = "niri/config.kdl"; target = "niri/config.kdl";
text = let text = let
cursor_size = toString config.stylix.cursor.size; cursor_size = toString config.stylix.cursor.size;
terminal = "ghostty";
launcher = "walker";
browser = "app.zen_browser.zen";
lockscreen = "hyprlock";
# clipboard = "copyq toggle";
left = "n"; left = "n";
down = "e"; down = "e";
up = "i"; up = "i";
@ -278,7 +455,6 @@ in {
width 3 width 3
active-gradient from="#${config.lib.stylix.colors.base0D}" to="#${config.lib.stylix.colors.base04}" angle=40 relative-to="workspace-view" active-gradient from="#${config.lib.stylix.colors.base0D}" to="#${config.lib.stylix.colors.base04}" angle=40 relative-to="workspace-view"
inactive-color "#${config.lib.stylix.colors.base03}" inactive-color "#${config.lib.stylix.colors.base03}"
// inactive-gradient from="#1c1c1c" to="#4e4e4e" angle=60 relative-to="workspace-view"
} }
// You can also add a border. It's similar to the focus ring, but always visible. // You can also add a border. It's similar to the focus ring, but always visible.
@ -288,13 +464,8 @@ in {
off off
width 4 width 4
// active-color "#ffc87f"
inactive-color "#${config.lib.stylix.colors.base00}" inactive-color "#${config.lib.stylix.colors.base00}"
// active-gradient from="#${config.lib.stylix.colors.base0D}" to="#${config.lib.stylix.colors.base0C}" angle=40 relative-to="workspace-view" // active-gradient from="#${config.lib.stylix.colors.base0D}" to="#${config.lib.stylix.colors.base0C}" angle=40 relative-to="workspace-view"
// inactive-gradient from="#1c1c1c" to="#4e4e4e" angle=60 relative-to="workspace-view"
// active-gradient from="#ffbb66" to="#ffc880" angle=45 relative-to="workspace-view"
// inactive-gradient from="#505050" to="#808080" angle=45 relative-to="workspace-view"
} }
struts { struts {
@ -313,7 +484,7 @@ in {
clip-to-geometry true clip-to-geometry true
} }
screenshot-path "~/pics/screenshots/screenshot-%Y-%m-%d-%H-%M-%S.png" screenshot-path "${config.xdg.userDirs.pictures}/screenshots/screenshot-%Y-%m-%d-%H-%M-%S.png"
// screenshot-path null // screenshot-path null
animations { animations {
@ -331,10 +502,10 @@ in {
open-focused true open-focused true
} }
// window-rule { window-rule {
// match app-id=r#"^com\.mitchellh\.ghostty$"# match app-id=r#"^com\.mitchellh\.ghostty$"#
// draw-border-with-background false draw-border-with-background false
// } }
window-rule { window-rule {
match app-id=r#"^org\.keepassxc\.KeePassXC$"# match app-id=r#"^org\.keepassxc\.KeePassXC$"#
@ -355,9 +526,6 @@ in {
Super+Alt+L repeat=false { spawn "${lockscreen}"; } Super+Alt+L repeat=false { spawn "${lockscreen}"; }
Super+Alt+B repeat=false { spawn "${browser}"; } Super+Alt+B repeat=false { spawn "${browser}"; }
Super+Alt+V repeat=false { spawn "copyq" "toggle"; } Super+Alt+V repeat=false { spawn "copyq" "toggle"; }
Super+Alt+D repeat=false { spawn "dunstctl" "set-paused" "toggle"; }
Super+Alt+C repeat=false { spawn "dunstctl" "close-all"; }
Super+Alt+X repeat=false { spawn "dunstctl" "history-pop"; }
Mod+Alt+Q { quit; } Mod+Alt+Q { quit; }
Mod+Alt+P { power-off-monitors; } Mod+Alt+P { power-off-monitors; }
@ -547,7 +715,11 @@ in {
"clock" "clock"
"wlr/taskbar" "wlr/taskbar"
]; ];
modules-center = ["group/niri" "privacy"]; modules-center = [
"custom/notification"
"group/niri"
"privacy"
];
modules-right = [ modules-right = [
"tray" "tray"
"wireplumber" "wireplumber"
@ -641,14 +813,6 @@ in {
on-scroll-down = "~/.local/bin/keyboard-brightness.nu change -1"; on-scroll-down = "~/.local/bin/keyboard-brightness.nu change -1";
interval = 1; interval = 1;
}; };
# "custom/kbd-backlight" = {
# exec = "cat /sys/class/leds/platform::kbd_backlight/brightness";
# interval = 1;
# format = "{}% {icon}";
# format-icons = ["󰌌"];
# on-scroll-up = "light -s sysfs/leds/platform::kbd_backlight -A 5%";
# on-scroll-down = "light -s sysfs/leds/platform::kbd_backlight -U 5%";
# };
battery = { battery = {
states = { states = {
good = 95; good = 95;
@ -728,23 +892,25 @@ in {
}; };
}; };
}; };
style = '' style = let
@define-color base00 #${config.lib.stylix.colors.base00}; stylix = config.lib.stylix.colors;
@define-color base01 #${config.lib.stylix.colors.base01}; in ''
@define-color base02 #${config.lib.stylix.colors.base02}; @define-color base00 #${stylix.base00};
@define-color base03 #${config.lib.stylix.colors.base03}; @define-color base01 #${stylix.base01};
@define-color base04 #${config.lib.stylix.colors.base04}; @define-color base02 #${stylix.base02};
@define-color base05 #${config.lib.stylix.colors.base05}; @define-color base03 #${stylix.base03};
@define-color base06 #${config.lib.stylix.colors.base06}; @define-color base04 #${stylix.base04};
@define-color base07 #${config.lib.stylix.colors.base07}; @define-color base05 #${stylix.base05};
@define-color base08 #${config.lib.stylix.colors.base08}; @define-color base06 #${stylix.base06};
@define-color base09 #${config.lib.stylix.colors.base09}; @define-color base07 #${stylix.base07};
@define-color base0A #${config.lib.stylix.colors.base0A}; @define-color base08 #${stylix.base08};
@define-color base0B #${config.lib.stylix.colors.base0B}; @define-color base09 #${stylix.base09};
@define-color base0C #${config.lib.stylix.colors.base0C}; @define-color base0A #${stylix.base0A};
@define-color base0D #${config.lib.stylix.colors.base0D}; @define-color base0B #${stylix.base0B};
@define-color base0E #${config.lib.stylix.colors.base0E}; @define-color base0C #${stylix.base0C};
@define-color base0F #${config.lib.stylix.colors.base0F}; @define-color base0D #${stylix.base0D};
@define-color base0E #${stylix.base0E};
@define-color base0F #${stylix.base0F};
* { * {
font-family: Iosevka Nerd Font Propo, FontAwesome; font-family: Iosevka Nerd Font Propo, FontAwesome;
font-size: 100%; font-size: 100%;
@ -1148,23 +1314,25 @@ in {
}; };
}; };
}; };
style = '' style = let
@define-color base00 #${config.lib.stylix.colors.base00}; stylix = config.lib.stylix.colors;
@define-color base01 #${config.lib.stylix.colors.base01}; in ''
@define-color base02 #${config.lib.stylix.colors.base02}; @define-color base00 #${stylix.base00};
@define-color base03 #${config.lib.stylix.colors.base03}; @define-color base01 #${stylix.base01};
@define-color base04 #${config.lib.stylix.colors.base04}; @define-color base02 #${stylix.base02};
@define-color base05 #${config.lib.stylix.colors.base05}; @define-color base03 #${stylix.base03};
@define-color base06 #${config.lib.stylix.colors.base06}; @define-color base04 #${stylix.base04};
@define-color base07 #${config.lib.stylix.colors.base07}; @define-color base05 #${stylix.base05};
@define-color base08 #${config.lib.stylix.colors.base08}; @define-color base06 #${stylix.base06};
@define-color base09 #${config.lib.stylix.colors.base09}; @define-color base07 #${stylix.base07};
@define-color base0A #${config.lib.stylix.colors.base0A}; @define-color base08 #${stylix.base08};
@define-color base0B #${config.lib.stylix.colors.base0B}; @define-color base09 #${stylix.base09};
@define-color base0C #${config.lib.stylix.colors.base0C}; @define-color base0A #${stylix.base0A};
@define-color base0D #${config.lib.stylix.colors.base0D}; @define-color base0B #${stylix.base0B};
@define-color base0E #${config.lib.stylix.colors.base0E}; @define-color base0C #${stylix.base0C};
@define-color base0F #${config.lib.stylix.colors.base0F}; @define-color base0D #${stylix.base0D};
@define-color base0E #${stylix.base0E};
@define-color base0F #${stylix.base0F};
#window, #window,
#box, #box,
@ -1283,22 +1451,18 @@ in {
programs.wpaperd.enable = true; programs.wpaperd.enable = true;
home.packages = with pkgs; [ home.packages = with pkgs; [
niri celluloid
nautilus nautilus
gtklock
helvum helvum
loupe loupe
niri
evince evince
celluloid
junction junction
swayidle
swaylock-effects
libnotify libnotify
playerctl
wdisplays wdisplays
pwvucontrol pwvucontrol
wl-clipboard-rs wl-clipboard-rs
polkit_gnome
xwayland-satellite
]; ];
gtk = { gtk = {
@ -1317,8 +1481,9 @@ in {
icon-theme = "${config.gtk.iconTheme.name}"; icon-theme = "${config.gtk.iconTheme.name}";
}; };
}; };
xdg.mime.enable = true; xdg = {
xdg.mimeApps = { mime.enable = true;
mimeApps = {
enable = true; enable = true;
defaultApplications = let defaultApplications = let
file_manager = ["org.gnome.Nautilus.desktop"]; file_manager = ["org.gnome.Nautilus.desktop"];
@ -1342,18 +1507,20 @@ in {
"x-scheme-handler/unknown" = web_browser; "x-scheme-handler/unknown" = web_browser;
}; };
}; };
systemd.user.settings.Manager.DefaultEnvironment = { };
systemd.user = {
settings.Manager.DefaultEnvironment = {
# QT_QPA_PLATFORMTHEME = "gtk3"; # QT_QPA_PLATFORMTHEME = "gtk3";
QT_QPA_PLATFORM = "wayland"; QT_QPA_PLATFORM = "wayland";
DISPLAY = ":123"; DISPLAY = ":123";
}; };
systemd.user.targets.tray = { targets.tray = {
# workaround for udiskie # workaround for udiskie
Unit = { Unit = {
Description = "Home Manager System Tray"; Description = "Home Manager System Tray";
}; };
}; };
systemd.user.services = { services = {
udiskie = { udiskie = {
Unit = { Unit = {
PartOf = ["graphical-session.target"]; PartOf = ["graphical-session.target"];
@ -1465,7 +1632,7 @@ in {
}; };
Service = { Service = {
Type = "simple"; Type = "simple";
ExecStart = "${pkgs.xwayland-satellite}/bin/xwayland-satellite :123"; ExecStart = "${lib.getExe pkgs.xwayland-satellite} :123";
Restart = "on-failure"; Restart = "on-failure";
RestartSec = 1; RestartSec = 1;
TimeoutStopSec = 10; TimeoutStopSec = 10;
@ -1473,4 +1640,5 @@ in {
}; };
}; };
}; };
};
} }

View File

@ -20,6 +20,7 @@ in {
fonts.fontDir.enable = true; fonts.fontDir.enable = true;
security.pam = { security.pam = {
services.hyprlock = {}; services.hyprlock = {};
services.gtklock = {};
loginLimits = [ loginLimits = [
{ {
domain = "@users"; domain = "@users";