Skip to content

Commit

Permalink
add basic copypasta swaync config
Browse files Browse the repository at this point in the history
  • Loading branch information
otosky committed Jul 29, 2024
1 parent 60a4e89 commit 2186293
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 1 deletion.
1 change: 1 addition & 0 deletions homes/_modules/desktop/common/wayland-wm/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
./swaylock.nix
./waybar.nix
./wofi.nix
./swaync.nix
];

xdg.mimeApps.enable = true;
Expand Down
74 changes: 74 additions & 0 deletions homes/_modules/desktop/common/wayland-wm/swaync.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{
services.swaync = {
settings = {
positionX = "center";
positionY = "top";
layer = "overlay";
control-center-layer = "overlay";
layer-shell = true;
cssPriority = "application";
control-center-positionX = "center";
control-center-positionY = "top";
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 = 48;
notification-body-image-height = 100;
notification-body-image-width = 200;
timeout = 5;
timeout-low = 10;
timeout-critical = 10;
fit-to-screen = false;
control-center-width = 400;
control-center-height = 650;
notification-window-width = 400;
keyboard-shortcuts = true;
image-visibility = "when-available";
transition-time = 200;
hide-on-clear = true;
hide-on-action = true;
script-fail-notify = true;
notification-visibility = {
spotify = {
state = "muted";
urgency = "Low";
app-name = "Spotify";
};
};
widgets = [
"inhibitors"
"title"
"mpris"
"notifications"
"dnd"
];
widget-config = {
inhibitors = {
text = "Inhibitors";
button-text = "Clear All";
clear-all-button = true;
};
title = {
text = "Notifications";
clear-all-button = true;
button-text = "Clear All";
};
dnd = {
text = "Do Not Disturb";
};
label = {
max-lines = 5;
text = "Label Text";
};
mpris = {
image-size = 64;
image-radius = 50;
};
};
};
# style = builtins.readFile ./style.css;
};
}
27 changes: 26 additions & 1 deletion homes/_modules/desktop/hyprland.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,30 @@ in {
];
};

extraConfig = ''
# exit mode
# inspired by https://github.com/coffebar/dotfiles/blob/main/.config/hyprland/hyprland.conf
bind=SUPER,escape,exec,hyprctl dispatch submap logout; hyprctl notify -2 10000 0 '\ne - exit\n\nr - reboot\n\ns - suspend\n\nS - poweroff\n\nl - lock'
submap=logout
bindr=,E,exec,hyprctl dispatch exit
bindr=,S,exec,hyprctl dispatch submap reset && systemctl suspend
bindr=,R,exec,systemctl reboot
bindr=SHIFT,S,exec,systemctl poweroff -i
bindr=,L,exec,hyprctl dispatch submap reset && swaylock
bindr=,escape,submap,reset
bind=,Return,submap,reset
submap=reset
'';

settings = {
general = {
gaps_in = 5;
gaps_out = 10;
border_size = 1;
};
# exec = ["${pkgs.swaybg}/bin/swaybg -i ${wallpaper} --mode fill"];
exec-once = ["${pkgs.swaynotificationcenter}/bin/swaync"];

decoration = {
rounding = 10;
Expand Down Expand Up @@ -94,7 +111,6 @@ in {
"SUPER, B, exec, brave"
", Print, exec, grimblast copy area"
"SUPER, return, exec, [float;tile] wezterm start --always-new-process"
"SUPER, M, exec, wlogout --protocol layer-shell"

"SUPER, 1, workspace, 1"
"SUPER, 2, workspace, 2"
Expand Down Expand Up @@ -138,6 +154,15 @@ in {
",XF86Launch4,exec,${swaylock} -S --grace 2"
"SUPER SHIFT,L,exec,${swaylock} -S --grace 2"
]
)
++
# NOTIFICATIONS
(
let
swaync-client = lib.getExe' pkgs.swaynotificationcenter "swaync-client";
in [
"SUPER, N, exec, ${swaync-client} -t -sw"
]
);
};
};
Expand Down

0 comments on commit 2186293

Please sign in to comment.