{ osConfig, config, pkgs, lib, ... }: let cfg = config.desktop.niri; hostname = osConfig.networking.hostName; cursor_size = config.stylix.cursor.size; colors = config.lib.stylix.colors; keyboard = if hostname == "eldrid" then "chromeos" else "platform"; xdgPics = config.xdg.userDirs.pictures; ifLaptop = lib.mkIf (hostname != "dunamis"); terminal = "ghostty"; launcher = "fuzzel"; browser = "app.zen_browser.zen"; lockscreen = lib.getExe pkgs.gtklock; in { options = { desktop.niri.enable = lib.mkEnableOption "enable niri desktop"; }; config = lib.mkIf cfg.enable { stylix.targets = { waybar.enable = false; hyprlock.enable = false; wpaperd.enable = true; qt.enable = false; }; services = { wpaperd.enable = true; playerctld.enable = true; network-manager-applet.enable = true; copyq.enable = true; gnome-keyring = { enable = true; components = ["secrets"]; }; gammastep = { enable = true; provider = "manual"; latitude = 49.6; longitude = 36.1; tray = true; temperature = { day = 6500; night = 3000; }; }; udiskie = { enable = true; automount = false; notify = true; tray = "auto"; }; 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 = 400; # 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; } ''; }; dunst = { enable = false; settings = { global = { width = 300; height = 300; icon_theme = "${config.dconf.settings."org/gnome/desktop/interface".icon-theme}"; corner_radius = 12; #corners = "top-right,bottom-left"; offset = "16x16"; origin = "top-right"; timeout = 15; frame_width = 3; notification_limit = 5; }; rule-telegram = { "desktop_entry" = "org.telegram.desktop"; "urgency" = "normal"; }; }; }; hypridle = { enable = true; settings = { general = { before_sleep_cmd = "loginctl lock-session"; lock_cmd = "pidof ${lockscreen} || ${lockscreen}"; # unlock_cmd = "loginctl unlock-session"; }; listener = [ { timeout = 600; on-timeout = "pidof ${lockscreen} || ${lockscreen}"; } { timeout = 601; on-timeout = "${pkgs.niri}/bin/niri msg action power-off-monitors"; } ]; }; }; }; programs.fuzzel = { enable = true; settings = { main = { terminal = "${terminal} -e"; fields = "filename,name,generic,keywords,categories,exec"; dpi-aware = false; horizontal-pad = 4; vertical-pad = 4; show-actions = true; match-mode = "fuzzy"; icon-theme = "${config.dconf.settings."org/gnome/desktop/interface".icon-theme}"; }; border = lib.mkDefault { width = 3; radius = 12; }; }; }; programs.hyprlock = { enable = false; settings = { general = { disable_loading_bar = true; #grace = 300; hide_cursor = true; no_fade_in = false; }; background = [ { path = "screenshot"; blur_passes = 3; blur_size = 8; } ]; input-field = [ { size = "274, 50"; rounding = 12; outline_thickness = 4; position = "0, -30"; monitor = ""; dots_center = true; fade_on_empty = false; font_family = "${config.stylix.fonts.serif.name}"; font_color = "rgb(${colors.base05})"; inner_color = "rgb(${colors.base00})"; outer_color = "rgb(${colors.base0D})"; check_color = "rgb(${colors.base0A})"; fail_color = "rgb(${colors.base08})"; placeholder_text = "locked..."; fail_text = "wrong"; shadow_passes = 0; } ]; shape = [ { rounding = 12; size = "150, 50"; color = "rgb(${colors.base00})"; border_color = "rgb(${colors.base0D})"; position = "-62, 30"; halign = "center"; valign = "center"; } { rounding = 12; size = "120, 50"; color = "rgb(${colors.base00})"; border_color = "rgb(${colors.base0D})"; position = "77, 28"; halign = "center"; valign = "center"; } ]; label = [ { monitor = ""; text = "$LAYOUT"; text_align = "center"; font_size = 16; font_family = "${config.stylix.fonts.serif.name}"; outer_color = "rgb(${colors.base00})"; color = "rgb(${colors.base05})"; position = "-62, 28"; halign = "center"; valign = "center"; } { monitor = ""; text = "cmd[update:1000] ${pkgs.uutils-coreutils-noprefix}/bin/echo $(${pkgs.uutils-coreutils-noprefix}/bin/date +%H:%M:%S)"; text_align = "center"; font_size = 16; font_family = "${config.stylix.fonts.serif.name}"; outer_color = "rgb(${colors.base00})"; color = "rgb(${colors.base05})"; position = "77, 28"; halign = "center"; valign = "center"; } ]; }; }; xdg.configFile = { niri = { target = "niri/config.kdl"; text = let cursor_size = toString config.stylix.cursor.size; left = "n"; down = "e"; up = "i"; right = "o"; in '' environment { DISPLAY ":123" QT_QPA_PLATFORM "wayland" QT_QPA_PLATFORMTHEME "gtk3" GDK_BACKEND "wayland" MOZ_ENABLE_WAYLAND "1" MOZ_WEBRENDER "1" XDG_SESSION_TYPE "wayland" CLUTTER_BACKEND "wayland" SDL_VIDEODRIVER "wayland" } input { keyboard { xkb { layout "us,ua" ${ if hostname == "dunamis" then "// variant \"colemak_dh_ortho,\"" else "variant \"colemak_dh_ortho,\"" } } repeat-delay 200 repeat-rate 50 track-layout "global" } touchpad { // off tap // dwt // dwtp natural-scroll accel-speed 0.2 accel-profile "flat" // scroll-method "two-finger" // disabled-on-external-mouse } mouse { // off // natural-scroll accel-speed 0.0 accel-profile "flat" // scroll-method "no-scroll" } warp-mouse-to-focus // focus-follows-mouse } output "eDP-1" { // off scale 1.2 transform "normal" // position x=1920 y=0 } output "Samsung Electric Company S24R65x H4TMA03291" { position x=0 y=0 variable-refresh-rate } output "Philips Consumer Electronics Company 27M2N5500 UK02418033254" { mode "2560x1440@180.000" variable-refresh-rate position x=0 y=0 scale 1.33 } output "PNP(AOC) 27V2G5 0x0000026C" { position x=1920 y=0 mode "1920x1080@74.973" variable-refresh-rate } cursor { xcursor-theme "${config.stylix.cursor.name}" xcursor-size ${cursor_size} } layout { gaps 11 center-focused-column "never" // "on-overflow" preset-column-widths { proportion 0.33333 proportion 0.5 proportion 0.66667 } // default-column-width { proportion 0.9; } default-column-width {} tab-indicator { active-color "#${colors.base04}" inactive-color "#${colors.base03}" width 8 gap 6 corner-radius 4 gaps-between-tabs 0 length total-proportion=0.3 position "bottom" place-within-column } focus-ring { // off width 3 active-gradient from="#${colors.base0D}" to="#${colors.base0F}" angle=40 relative-to="workspace-view" inactive-color "#${colors.base03}" } struts { left 52 right 52 } } prefer-no-csd hotkey-overlay { skip-at-startup } window-rule { geometry-corner-radius 12 clip-to-geometry true } window-rule { match is-window-cast-target=true focus-ring { width 3 active-color "#${colors.base0F}" inactive-color "#${colors.base03}" } border { width 3 active-color "#${colors.base0F}" inactive-color "#${colors.base03}" } shadow { on color "#${colors.base0F}" inactive-color "#${colors.base03}" } } screenshot-path "${xdgPics}/screenshots/screenshot-%Y-%m-%d-%H-%M-%S.png" animations { slowdown 0.8 } window-rule { match title="TelegramDesktop" match app-id="org.telegram.desktop" match title="Картинка в картинці" match title="Picture-in-Picture" open-floating true } window-rule { match app-id="org.wezfurlong.wezterm" default-column-width { proportion 1.0; } } window-rule { match app-id="re.sonny.Junction" open-floating true open-focused true } window-rule { match app-id="com.mitchellh.ghostty" draw-border-with-background false } window-rule { match app-id=r#"^org\.keepassxc\.KeePassXC$"# match app-id=r#"^org\.gnome\.World\.Secrets$"# match app-id=r#"^Bitwarden$"# match app-id="org.telegram.desktop" match app-id="org.signal.Signal" match app-id="WebCord" // block-out-from "screen-capture" block-out-from "screencast" } // workspace "general" // workspace "browse" // workspace "chat" // workspace "code" // workspace "uni" // workspace "games" // workspace "sysadmin" // workspace "media" // workspace "bg" // window-rule { // match app-id=r#"^org\.telegram\.desktop$"# // match app-id=r#"^im\.riot\.Riot$"# // match app-id=r#"^WebCord$"# // match app-id=r#"^signal$"# // open-on-workspace "chat" // } // window-rule { // match app-id=r#"^com\.heroicgameslauncher\.hgl$"# // match app-id=r#"^net\.lutris\.Lutris$"# // match app-id="steam" // // match app-id=r#"^$"# // open-on-workspace "games" // } // window-rule { // match app-id=r#"^com\.obsproject\.Studio$"# // open-on-workspace "bg" // } binds { Mod+Shift+Slash { show-hotkey-overlay; } Mod+Tab { focus-workspace-previous; } Mod+C { center-column; } Mod+M { maximize-column; } Mod+H { set-column-width "50%"; } Mod+T { switch-preset-column-width; } Mod+V { toggle-column-tabbed-display; } Mod+G { switch-focus-between-floating-and-tiling; } Mod+Ctrl+Comma { consume-or-expel-window-left; } Mod+Ctrl+Period { consume-or-expel-window-right; } Mod+Ctrl+Q { close-window; } Mod+Ctrl+M { fullscreen-window; } Mod+Ctrl+G { toggle-window-floating; } Mod+Minus { set-column-width "-10%"; } Mod+Equal { set-column-width "+10%"; } Mod+Comma { set-column-width "-10%"; } Mod+Period { set-column-width "+10%"; } Mod+Shift+Comma { set-window-height "-10%"; } Mod+Shift+Period { set-window-height "+10%"; } Mod+Shift+T { reset-window-height; } Mod+Escape { switch-layout "next"; } Mod+Return repeat=false { spawn "${terminal}"; } Mod+Space repeat=false { spawn "${launcher}"; } Mod+Alt+L repeat=false { spawn "${lockscreen}"; } Mod+Alt+B repeat=false { spawn "${browser}"; } Mod+Alt+V repeat=false { spawn "copyq" "toggle"; } Mod+Ctrl+Shift+BracketLeft { quit; } Mod+Ctrl+Shift+BracketRight { power-off-monitors; } Print { screenshot; } Ctrl+Print { screenshot-screen; } Shift+Print { screenshot-window; } XF86AudioRaiseVolume allow-when-locked=true { spawn "wpctl" "set-volume" "-l" "1.0" "@DEFAULT_AUDIO_SINK@" "5%+"; } XF86AudioLowerVolume allow-when-locked=true { spawn "wpctl" "set-volume" "-l" "1.0" "@DEFAULT_AUDIO_SINK@" "5%-"; } XF86AudioMute allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"; } XF86AudioMicMute allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle"; } XF86AudioPlay allow-when-locked=true { spawn "playerctl" "play-pause"; } XF86AudioPause allow-when-locked=true { spawn "playerctl" "pause"; } XF86AudioPrev allow-when-locked=true { spawn "playerctl" "previous"; } XF86AudioNext allow-when-locked=true { spawn "playerctl" "next"; } XF86MonBrightnessUp allow-when-locked=true { spawn "brightnessctl" "s" "5%+"; } XF86MonBrightnessDown allow-when-locked=true { spawn "brightnessctl" "s" "5%-"; } Alt+XF86MonBrightnessUp allow-when-locked=true { spawn "brightnessctl" "s" "5%+" "-d" "${keyboard}::kbd_backlight"; } Alt+XF86MonBrightnessDown allow-when-locked=true { spawn "brightnessctl" "s" "5%-" "-d" "${keyboard}::kbd_backlight"; } Mod+Left { focus-column-left; } Mod+Down { focus-window-or-workspace-down; } Mod+Up { focus-window-or-workspace-up; } Mod+Right { focus-column-right; } Mod+${left} { focus-column-left; } Mod+${down} { focus-window-or-workspace-down; } Mod+${up} { focus-window-or-workspace-up; } Mod+${right} { focus-column-right; } Mod+Ctrl+Left { move-column-left; } Mod+Ctrl+Down { move-window-down-or-to-workspace-down; } Mod+Ctrl+Up { move-window-up-or-to-workspace-up; } Mod+Ctrl+Right { move-column-right; } Mod+Ctrl+${left} { move-column-left; } Mod+Ctrl+${down} { move-window-down-or-to-workspace-down; } Mod+Ctrl+${up} { move-window-up-or-to-workspace-up; } Mod+Ctrl+${right} { move-column-right; } Mod+Home { focus-column-first; } Mod+End { focus-column-last; } Mod+Ctrl+Home { move-column-to-first; } Mod+Ctrl+End { move-column-to-last; } Mod+Shift+Left { focus-monitor-left; } Mod+Shift+Down { focus-monitor-down; } Mod+Shift+Up { focus-monitor-up; } Mod+Shift+Right { focus-monitor-right; } Mod+Shift+${left} { focus-monitor-left; } Mod+Shift+${down} { focus-monitor-down; } Mod+Shift+${up} { focus-monitor-up; } Mod+Shift+${right} { focus-monitor-right; } Mod+Shift+Ctrl+Left { move-column-to-monitor-left; } Mod+Shift+Ctrl+Down { move-column-to-monitor-down; } Mod+Shift+Ctrl+Up { move-column-to-monitor-up; } Mod+Shift+Ctrl+Right { move-column-to-monitor-right; } Mod+Shift+Ctrl+${left} { move-column-to-monitor-left; } Mod+Shift+Ctrl+${down} { move-column-to-monitor-down; } Mod+Shift+Ctrl+${up} { move-column-to-monitor-up; } Mod+Shift+Ctrl+${right} { move-column-to-monitor-right; } Mod+Next { focus-workspace-down; } Mod+Prior { focus-workspace-up; } Mod+Ctrl+Next { move-column-to-workspace-down; } Mod+Ctrl+Prior { move-column-to-workspace-up; } Mod+Shift+Next { move-workspace-down; } Mod+Shift+Prior { move-workspace-up; } Mod+WheelScrollDown cooldown-ms=150 { focus-workspace-down; } Mod+WheelScrollUp cooldown-ms=150 { focus-workspace-up; } Mod+Ctrl+WheelScrollDown cooldown-ms=150 { move-column-to-workspace-down; } Mod+Ctrl+WheelScrollUp cooldown-ms=150 { move-column-to-workspace-up; } Mod+WheelScrollRight { focus-column-right; } Mod+WheelScrollLeft { focus-column-left; } Mod+Ctrl+WheelScrollRight { move-column-right; } Mod+Ctrl+WheelScrollLeft { move-column-left; } Mod+Shift+WheelScrollDown { focus-column-right; } Mod+Shift+WheelScrollUp { focus-column-left; } Mod+Ctrl+Shift+WheelScrollDown { move-column-right; } Mod+Ctrl+Shift+WheelScrollUp { move-column-left; } Mod+TouchpadScrollDown { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.02+"; } Mod+TouchpadScrollUp { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.02-"; } // Mod+1 { focus-workspace "general"; } // Mod+2 { focus-workspace "browse"; } // Mod+3 { focus-workspace "chat"; } // Mod+4 { focus-workspace "code"; } // Mod+5 { focus-workspace "uni"; } // Mod+6 { focus-workspace "games"; } // Mod+7 { focus-workspace "sysadmin"; } // Mod+8 { focus-workspace "media"; } // Mod+9 { focus-workspace "bg"; } // Mod+Ctrl+1 { move-column-to-workspace "general"; } // Mod+Ctrl+2 { move-column-to-workspace "browse"; } // Mod+Ctrl+3 { move-column-to-workspace "chat"; } // Mod+Ctrl+4 { move-column-to-workspace "code"; } // Mod+Ctrl+5 { move-column-to-workspace "uni"; } // Mod+Ctrl+6 { move-column-to-workspace "games"; } // Mod+Ctrl+7 { move-column-to-workspace "sysadmin"; } // Mod+Ctrl+8 { move-column-to-workspace "media"; } // Mod+Ctrl+9 { move-column-to-workspace "bg"; } Mod+Q { focus-workspace 1; } Mod+W { focus-workspace 2; } Mod+F { focus-workspace 3; } Mod+P { focus-workspace 4; } Mod+B { focus-workspace 5; } Mod+J { focus-workspace 6; } Mod+L { focus-workspace 7; } Mod+U { focus-workspace 8; } Mod+Y { focus-workspace 9; } Mod+Ctrl+Shift+Q { move-column-to-workspace 1; } Mod+Ctrl+Shift+W { move-column-to-workspace 2; } Mod+Ctrl+Shift+F { move-column-to-workspace 3; } Mod+Ctrl+Shift+P { move-column-to-workspace 4; } Mod+Ctrl+Shift+B { move-column-to-workspace 5; } Mod+Ctrl+Shift+J { move-column-to-workspace 6; } Mod+Ctrl+Shift+L { move-column-to-workspace 7; } Mod+Ctrl+Shift+U { move-column-to-workspace 8; } Mod+Ctrl+Shift+Y { move-column-to-workspace 9; } Mod+1 { focus-workspace 1; } Mod+2 { focus-workspace 2; } Mod+3 { focus-workspace 3; } Mod+4 { focus-workspace 4; } Mod+5 { focus-workspace 5; } Mod+6 { focus-workspace 6; } Mod+7 { focus-workspace 7; } Mod+8 { focus-workspace 8; } Mod+9 { focus-workspace 9; } Mod+Ctrl+Shift+1 { move-column-to-workspace 1; } Mod+Ctrl+Shift+2 { move-column-to-workspace 2; } Mod+Ctrl+Shift+3 { move-column-to-workspace 3; } Mod+Ctrl+Shift+4 { move-column-to-workspace 4; } Mod+Ctrl+Shift+5 { move-column-to-workspace 5; } Mod+Ctrl+Shift+6 { move-column-to-workspace 6; } Mod+Ctrl+Shift+7 { move-column-to-workspace 7; } Mod+Ctrl+Shift+8 { move-column-to-workspace 8; } Mod+Ctrl+Shift+9 { move-column-to-workspace 9; } } ''; }; }; programs.way-edges = { enable = false; settings = { "$schema" = "https://raw.githubusercontent.com/way-edges/way-edges/master/config/config.schema.json"; ensure_load_group = ["niri" "tray" "common"]; groups = [ { name = "niri"; widgets = [ { edge = "top"; layer = "overlay"; margins = {left = "25%";}; monitor = 0; position = "left"; widget = { event_map = { "272" = "niri msg action focus-column-left"; "273" = "niri msg action focus-workspace-up"; }; length = "25%"; thickness = 20; type = "btn"; }; } { edge = "top"; layer = "overlay"; margins = {right = "25%";}; monitor = 0; position = "right"; widget = { event_map = { "272" = "niri msg action focus-column-right"; "273" = "niri msg action focus-workspace-down"; }; frame_rate = 144; length = "25%"; thickness = 20; type = "btn"; }; } { edge = "top"; layer = "overlay"; margins = {left = "25%";}; monitor = 0; position = "left"; widget = { color = "#${colors.base00}"; event_map = { "272" = "niri msg action focus-column-left"; "273" = "niri msg action focus-workspace-up"; }; length = "25%"; thickness = 20; type = "btn"; }; } { edge = "top"; layer = "overlay"; margins = {right = "25%";}; monitor = 0; position = "right"; widget = { color = "#${colors.base00}"; event_map = { "272" = "niri msg action focus-column-right"; "273" = "niri msg action focus-workspace-down"; }; length = "25%"; thickness = 20; type = "btn"; }; } { edge = "left"; layer = "overlay"; monitor = 0; position = "bottom"; widget = { active_increase = 0.5; default_color = "#${colors.base00}"; hover_color = "#${colors.base03}"; focus_color = "#${colors.base0C}"; length = "20%"; preset = "niri"; thickness = 30; type = "workspace"; }; } ]; } { name = "common"; widgets = [ { edge = "bottom"; layer = "overlay"; monitor = 0; widget = { color = "#${colors.base00}"; event_map = { "272" = "niri msg action maximize-column"; # "273" = "sh -c pkill nwg-drawer || nwg-drawer"; "276" = "niri msg action toggle-column-tabbed-display"; }; length = "40%"; thickness = 20; type = "btn"; }; } { edge = "left"; layer = "overlay"; margins = {top = 40;}; monitor = 0; name = "stats"; position = "top"; widget = { outlook = { color = "#5d3f3c"; type = "window"; }; type = "wrap-box"; widgets = [ { index = [ (lib.strings.toInt "-1") (lib.strings.toInt "-1") ]; widget = { bg_color = "#00000044"; fg_color = "#82B2E3"; font_family = config.stylix.fonts.serif.name; font_size = 20; prefix = " "; preset = { type = "disk"; update_interval = 500; }; suffix = " {preset}"; suffix_hide = true; type = "ring"; }; } { index = [ (lib.strings.toInt "-1") (lib.strings.toInt "-1") ]; widget = { bg_color = "#00000044"; fg_color = "#FFB77B"; font_family = config.stylix.fonts.serif.name; font_size = 20; prefix = " "; preset = { type = "battery"; update_interval = 500; }; suffix = " {preset}"; suffix_hide = true; type = "ring"; }; } { index = [ (lib.strings.toInt "-1") (lib.strings.toInt "-1") ]; widget = { bg_color = "#00000044"; fg_color = "#FB8893"; font_family = config.stylix.fonts.serif.name; font_size = 20; prefix = " "; preset = { type = "cpu"; update_interval = 500; }; suffix = " {preset}"; suffix_hide = true; type = "ring"; }; } { index = [ (lib.strings.toInt "-1") (lib.strings.toInt "-1") ]; widget = { bg_color = "#00000044"; fg_color = "#BEAFD9"; font_family = config.stylix.fonts.serif.name; font_size = 20; prefix = "󰾶 "; preset = { type = "swap"; update_interval = 500; }; suffix = " {preset}"; suffix_hide = true; type = "ring"; }; } { index = [ (lib.strings.toInt "-1") (lib.strings.toInt "-1") ]; widget = { bg_color = "#00000044"; font_family = config.stylix.fonts.serif.name; font_size = 20; prefix = " "; preset = { type = "ram"; update_interval = 500; }; suffix = " {preset}"; suffix_hide = true; type = "ring"; }; } ]; }; } { edge = "top"; layer = "overlay"; monitor = 0; name = "time"; position = "right"; widget = { font_family = config.stylix.fonts.serif.name; outlook = { color = "#${colors.base00}"; margins = { bottom = 10; left = 30; right = 30; top = 10; }; type = "window"; }; type = "wrap-box"; widgets = [ { index = [ (lib.strings.toInt "-1") (lib.strings.toInt "-1") ]; widget = { font_family = config.stylix.fonts.serif.name; fg_color = "#${colors.base07}"; font_size = 30; preset = { format = "%v %T %A"; type = "time"; update_interval = 500; }; type = "text"; }; } ]; }; } { edge = "top"; layer = "overlay"; monitor = 0; position = "left"; preview_size = 7; widget = { font_family = config.stylix.fonts.serif.name; border_width = 4; length = "12.5%"; bg_color = "#${colors.base00}"; fg_color = "#${colors.base0C}"; mute_color = "#${colors.base0A}"; preset.type = "speaker"; redraw_only_on_internal_update = true; thickness = 30; type = "slider"; }; } ] ++ (lib.optionals (hostname != "dunamis") [ { edge = "top"; layer = "overlay"; margins = {left = "12.5%";}; monitor = 0; position = "left"; preview_size = 7; widget = { font_family = config.stylix.fonts.serif.name; border_width = 4; bg_color = "#${colors.base00}"; fg_color = "#${colors.base0B}"; length = "12.5%"; preset.type = "backlight"; redraw_only_on_internal_update = true; thickness = 30; type = "slider"; }; } ]); } { name = "tray"; widgets = [ { edge = "bottom"; layer = "overlay"; monitor = 0; name = "tray"; position = "right"; widget = { align = "bottom_left"; outlook = { font_family = config.stylix.fonts.serif.name; color = "#${colors.base07}"; type = "window"; }; type = "wrap-box"; widgets = [ { index = [ (lib.strings.toInt "-1") (lib.strings.toInt "-1") ]; widget = { font_family = config.stylix.fonts.serif.name; grid_align = "bottom_left"; header_draw_config = {text_color = "#${colors.base00}";}; header_menu_align = "left"; header_menu_stack = "menu_top"; icon_size = 42; menu_draw_config = { border_color = "#${colors.base00}"; text_color = "#${colors.base00}"; font_pixel_height = 18; }; type = "tray"; }; } ]; }; } ]; } ]; }; }; programs.waybar = { enable = true; systemd = { enable = true; target = "graphical-session.target"; }; settings = { bar-0 = { # layer = "top"; position = "top"; height = 32; spacing = 4; margin-left = 63; margin-right = 63; reload_style_on_change = true; modules-left = [ "niri/language" "niri/workspaces" "wlr/taskbar" ]; modules-center = ["mpris"]; modules-right = [ "wireplumber" (ifLaptop "group/laptop") "tray" "privacy" (ifLaptop "power-profiles-daemon") "idle_inhibitor" "custom/notification" "clock" ]; "niri/workspaces" = { format = "{icon}"; format-icons = { "1" = "I"; "2" = "II"; "3" = "III"; "4" = "IV"; "5" = "V"; "6" = "VI"; "7" = "VII"; "8" = "IIX"; "9" = "IX"; "10" = "X"; general = "󰘧"; web = "󰖟"; chat = "󰻞"; code = "󰅩"; uni = "󱆀"; games = "󰺶"; system = "󰢻"; media = "󱜐"; tray = "󱊖"; }; }; "niri/language" = { format = "{}"; format-en = "🇺🇸"; format-uk = "🇺🇦"; }; "custom/separator" = { format = "󰝠"; interval = "once"; tooltip = false; }; "group/laptop" = { orientation = "inherit"; modules = [ "battery" "backlight" ]; }; "backlight" = { format = "{percent}% {icon}"; format-icons = ["" ""]; }; "idle_inhibitor" = { format = "{icon}"; format-icons = { activated = "󰅶"; deactivated = "󰾪"; }; }; "tray" = { icon-size = 24; spacing = 2; }; "clock" = { interval = 1; format = "{:%H:%M:%S}"; tooltip-format = "{:%d.%m.%Y}"; }; battery = { states = { good = 95; warning = 30; critical = 15; }; format = "{capacity}% {icon}"; format-full = "{capacity}% 󱟢"; format-charging = "{capacity}% 󰂄"; format-plugged = "{capacity}% 󰚥"; format-alt = "{icon} {time}"; format-icons = ["󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂" "󰁹"]; }; mpris = { format = "{player_icon} {dynamic}"; format-paused = "{status_icon} {dynamic}"; playing-len = 30; playing-paused = 30; player-icons = { default = "▶"; mpv = "🎵"; }; status-icons = {paused = "⏸";}; }; "upower" = { icon-size = 16; format = "{percentage}"; hide-if-empty = true; tooltip = true; tooltip-spacing = 20; }; "power-profiles-daemon" = { format = "{icon}"; tooltip-format = "Power profile: {profile}\nDriver: {driver}"; tooltip = true; format-icons = { default = "󱡮"; performance = "󱡮"; balanced = ""; power-saver = ""; }; }; "wireplumber" = { scroll-step = 3; format = "{volume}% {icon}"; format-muted = "󰖁"; format-icons = ["󰕿" "󰖀" "󰕾"]; on-click = "${pkgs.pwvucontrol}/bin/pwvucontrol"; on-click-right = "wpctl set-mute @DEFAULT_SINK@ toggle"; }; "custom/notification" = { tooltip = false; format = "{icon}"; format-icons = { notification = ""; none = ""; dnd-notification = ""; dnd-none = ""; }; return-type = "json"; exec-if = "which swaync-client"; exec = "swaync-client -swb"; on-click = "swaync-client -t -sw"; on-click-right = "swaync-client -d -sw"; escape = true; }; "privacy" = { icon-spacing = 2; icon-size = 16; transition-duration = 250; screenshare = { type = "screenshare"; tooltip = true; tooltip-icon-size = 24; }; audio-in = { type = "audio-in"; tooltip = true; tooltip-icon-size = 24; }; }; "wlr/taskbar" = { format = "{icon}"; icon-size = 24; icon-theme = "${config.dconf.settings."org/gnome/desktop/interface".icon-theme}"; tooltip-format = "{title}"; on-click = "activate"; }; }; }; style = '' @define-color base00 #${colors.base00}; @define-color base01 #${colors.base01}; @define-color base02 #${colors.base02}; @define-color base03 #${colors.base03}; @define-color base04 #${colors.base04}; @define-color base05 #${colors.base05}; @define-color base06 #${colors.base06}; @define-color base07 #${colors.base07}; @define-color base08 #${colors.base08}; @define-color base09 #${colors.base09}; @define-color base0A #${colors.base0A}; @define-color base0B #${colors.base0B}; @define-color base0C #${colors.base0C}; @define-color base0D #${colors.base0D}; @define-color base0E #${colors.base0E}; @define-color base0F #${colors.base0F}; * { font-family: ${config.stylix.fonts.sansSerif.name}, FontAwesome; font-weight: 500; font-size: 100%; } window#waybar { background-color: transparent; color: @base05; transition-property: background-color; transition-duration: 0.5s; } .modules-center { background-color: transparent; } .mpris.stopped { background-color: transparent; } .mpris.playing, .mpris.paused, .modules-left, .modules-right { border-bottom-left-radius: 12px; border-bottom-right-radius: 12px; border-top-left-radius: 0px; border-top-right-radius: 0px; background-color: @base00; color: @base05; padding: 0 0.5em; } tooltip { background: @base01; border: 1px solid @base0E; } tooltip label { color: @base05; } button { box-shadow: inset 0 -3px transparent; border-radius: 16px; } button:hover { background: inherit; box-shadow: inset 0 -3px transparent; } #mode { background-color: rgba(0, 0, 0, 0.2); box-shadow: inset 0 -3px @base05; } #battery, #backlight, #workspaces, #taskbar, #language, #clock, #battery, #backlight, #wireplumber, #custom-separator { padding: 0 0.3em; } #privacy, #tray button, #privacy-item, #idle_inhibitor, #custom-notification, #power-profiles-daemon, #workspaces button { padding: 0 0.2em; } #taskbar button { padding: 0 0.1em; } #workspaces button.active { color: @base0D; } #taskbar button:hover { box-shadow: transparent; } #taskbar.empty, window#empty { background-color: transparent; } #battery.critical:not(.charging) { color: @base09; animation-name: blink; animation-duration: 0.5s; animation-timing-function: steps(12); animation-iteration-count: infinite; animation-direction: alternate; } #power-profiles-daemon.performance { color: @base0D; } #power-profiles-daemon.balanced { color: @base0B; } #power-profiles-daemon.power-saver { color: @base0A; } label:focus { background-color: #000000; } #tray > .passive { -gtk-icon-effect: dim; } #tray > .needs-attention { -gtk-icon-effect: highlight; background-color: @base08; } #privacy-item.screenshare { color: @base0C; } #privacy-item.audio-in { color: @base0E; } ''; }; home.packages = with pkgs; [ (ifLaptop brightnessctl) nautilus helvum loupe evince junction celluloid mission-center dconf libnotify playerctl wdisplays pwvucontrol wl-clipboard-rs libqalculate ]; gtk = { enable = true; iconTheme = { name = if config.stylix.polarity == "dark" then "Papirus-Dark" else "Papirus-Light"; package = pkgs.papirus-nord; }; }; qt = { enable = true; platformTheme.name = "gtk3"; }; dconf.settings = { "org/gnome/desktop/interface" = { icon-theme = "${config.gtk.iconTheme.name}"; }; }; xdg = { mime.enable = true; mimeApps = { enable = true; defaultApplications = let file_manager = ["org.gnome.Nautilus.desktop"]; web_browser = ["re.sonny.Junction.desktop"]; image_viewer = ["org.gnome.Loupe.desktop"]; video_player = ["io.github.celluloid_player.Celluloid.desktop"]; pdf_reader = ["org.gnome.Evince.desktop"]; in { "inode/directory" = file_manager; "video/x-matroska" = video_player; "video/mp4" = video_player; "video/mpeg" = video_player; "video/x-mpeg" = video_player; "image/png" = image_viewer; "image/jpeg" = image_viewer; "application/pdf" = pdf_reader; "text/html" = web_browser; "x-scheme-handler/http" = web_browser; "x-scheme-handler/https" = web_browser; "x-scheme-handler/about" = web_browser; "x-scheme-handler/unknown" = web_browser; }; }; # desktopEntries = { # zen-browser-profile = { # name = "Zen Browser (Choose profile)"; # icon = "app.zen_browser.zen"; # exec = "flatpak run --branch=stable --arch=x86_64 --command=launch-script.sh --file-forwarding app.zen_browser.zen --ProfileManager @@u %u @@"; # }; # logseq-wayland = { # name = "Logseq Desktop (Wayland)"; # icon = "com.logseq.Logseq"; # exec = "flatpak run --branch=stable --arch=x86_64 --command=run.sh --file-forwarding com.logseq.Logseq @@u %U @@ --enable-features=UseOzonePlatform --ozone-platform=wayland --enable-features=WaylandWindowDecorations"; # }; # }; }; systemd.user = { settings.Manager.DefaultEnvironment = { QT_QPA_PLATFORM = "wayland"; DISPLAY = ":123"; }; targets.tray.Unit.Description = "Home Manager System Tray"; # workaround for udiskie services = let mkGraphicalService = config: graphicalService // config; graphicalService = { Install.WantedBy = ["niri.service"]; Unit = { Requisite = ["graphical-session.target"]; PartOf = ["graphical-session.target"]; After = ["graphical-session.target"]; }; Service = { Restart = "on-failure"; TimeoutStopSec = 10; RestartSec = 1; }; }; in { udiskie = mkGraphicalService {}; waybar = mkGraphicalService {}; network-manager-applet = mkGraphicalService {}; # wlsunset = mkGraphicalService {}; # hypridle = mkGraphicalService {}; copyq = mkGraphicalService { Service = graphicalService.Service // { Environment = lib.mkForce "QT_QPA_PLATFORM=wayland"; }; }; xwayland-satellite = mkGraphicalService { Service = graphicalService.Service // { Type = "simple"; ExecStart = "${lib.getExe pkgs.xwayland-satellite} :123"; }; }; wpaperd = mkGraphicalService { Service = graphicalService.Service // { Restart = "always"; RestartSec = "10"; }; }; gnome-polkit-agent = mkGraphicalService { Service = graphicalService.Service // { Type = "simple"; ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; }; }; }; }; }; }