2022-04-20 17:05:02 +00:00
|
|
|
{ pkgs, config, lib, ... }:
|
2023-03-23 09:59:44 +00:00
|
|
|
let
|
|
|
|
notificationModule = { config, pkgs, lib, ... }:
|
|
|
|
let
|
2023-12-01 21:05:54 +00:00
|
|
|
swaync = pkgs.swaynotificationcenter;
|
2023-03-23 09:59:44 +00:00
|
|
|
in
|
|
|
|
with lib; mkIf (config.linux.graphical.type == "wayland") {
|
|
|
|
home.packages = [ swaync ];
|
|
|
|
wayland.windowManager.sway.config = {
|
|
|
|
startup = [
|
|
|
|
{ command = "swaync"; }
|
|
|
|
];
|
|
|
|
};
|
|
|
|
xdg.configFile = {
|
|
|
|
"swaync/config.json" = {
|
|
|
|
text = builtins.toJSON {
|
|
|
|
widgets = [ "inhibitors" "title" "dnd" "mpris" "notifications" ];
|
|
|
|
scripts = { };
|
|
|
|
};
|
|
|
|
onChange = "swaync-client -R";
|
|
|
|
};
|
|
|
|
"swaync/style.css" = {
|
|
|
|
source = ./swaync.css;
|
|
|
|
onChange = "swaync-client -rs";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
programs.my-sway.waybar = {
|
|
|
|
extraSettings = {
|
|
|
|
modules-right = mkAfter [ "custom/swaync" ];
|
|
|
|
modules."custom/swaync" = {
|
|
|
|
tooltip = false;
|
|
|
|
format = "{icon} {}";
|
|
|
|
format-icons = {
|
|
|
|
notification = "<span foreground='red'><sup></sup></span>";
|
|
|
|
none = "";
|
|
|
|
dnd-notification = "<span foreground='red'><sup></sup></span>";
|
|
|
|
dnd-none = "";
|
|
|
|
inhibited-notification = "<span foreground='red'><sup></sup></span>";
|
|
|
|
inhibited-none = "";
|
|
|
|
dnd-inhibited-notification = "<span foreground='red'><sup></sup></span>";
|
|
|
|
dnd-inhibited-none = "";
|
|
|
|
};
|
|
|
|
return-type = "json";
|
|
|
|
# exec-if = "which swaync-client";
|
|
|
|
exec = "${swaync}/bin/swaync-client -swb";
|
|
|
|
on-click = "${swaync}/bin/swaync-client -t -sw";
|
|
|
|
on-click-right = "${swaync}/bin/swaync-client -d -sw";
|
|
|
|
escape = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
extraStyle = mkAfter ''
|
|
|
|
#custom-swaync {
|
|
|
|
background: #F0FFFF;
|
|
|
|
color: #000000;
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
in
|
2022-04-20 17:05:02 +00:00
|
|
|
with lib;
|
|
|
|
{
|
2023-03-23 09:59:44 +00:00
|
|
|
imports = [ notificationModule ];
|
2022-04-20 17:05:02 +00:00
|
|
|
config = mkIf (config.linux.graphical.type == "wayland") {
|
|
|
|
# Additional packages
|
|
|
|
home.packages = with pkgs; [
|
|
|
|
wl-clipboard # Clipboard management
|
|
|
|
|
|
|
|
# Mimic the clipboard stuff in MacOS
|
|
|
|
(pkgs.writeShellScriptBin "pbcopy" ''
|
2024-04-26 17:16:10 +00:00
|
|
|
exec ${pkgs.wl-clipboard}/bin/wl-copy "$@"
|
2022-04-20 17:05:02 +00:00
|
|
|
'')
|
|
|
|
(pkgs.writeShellScriptBin "pbpaste" ''
|
2024-04-26 17:16:10 +00:00
|
|
|
exec ${pkgs.wl-clipboard}/bin/wl-paste "$@"
|
2022-04-20 17:05:02 +00:00
|
|
|
'')
|
|
|
|
];
|
|
|
|
|
|
|
|
# Notification system
|
2023-03-23 09:59:44 +00:00
|
|
|
# services.dunst = {
|
|
|
|
# enable = true;
|
|
|
|
# settings.global.follow = "keyboard";
|
2022-10-24 10:58:49 +00:00
|
|
|
|
2023-03-23 09:59:44 +00:00
|
|
|
# settings.global.width = "(400, 800)";
|
|
|
|
# settings.global.notification_limit = 5;
|
2022-10-24 10:58:49 +00:00
|
|
|
|
2023-03-23 09:59:44 +00:00
|
|
|
# settings.global.font = "Monospace 12";
|
2022-10-24 10:58:49 +00:00
|
|
|
|
2023-03-23 09:59:44 +00:00
|
|
|
# settings.global.dmenu = "${pkgs.bemenu}/bin/bemenu";
|
|
|
|
# settings.global.browser = "${pkgs.firefox-wayland}/bin/firefox";
|
2022-10-24 10:58:49 +00:00
|
|
|
|
2023-03-23 09:59:44 +00:00
|
|
|
# settings.global.mouse_left_click = "do_action, close_current";
|
|
|
|
# settings.global.mouse_right_click = "close_current";
|
|
|
|
# settings.global.mouse_middle_click = "close_all";
|
2022-10-24 10:58:49 +00:00
|
|
|
|
2023-03-23 09:59:44 +00:00
|
|
|
# settings.experimental.per_monitor_dpi = "true";
|
|
|
|
# };
|
2022-04-20 17:05:02 +00:00
|
|
|
|
|
|
|
# Forward wallpaper settings to sway
|
|
|
|
programs.my-sway.wallpaper = config.linux.graphical.wallpaper;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|