Files
nixos-blueprint/modules/home/desktop/niri/default.nix
2025-03-16 01:08:34 +02:00

1573 lines
49 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
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";
xdgPictures =
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 = {
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";
};
wlsunset = {
enable = false;
latitude = "49.6";
longitude = "36.1";
temperature = {
day = 6500;
night = 3000;
};
systemdTarget = "graphical-session.target";
};
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(${config.lib.stylix.colors.base05})";
inner_color = "rgb(${config.lib.stylix.colors.base00})";
outer_color = "rgb(${config.lib.stylix.colors.base0D})";
check_color = "rgb(${config.lib.stylix.colors.base0A})";
fail_color = "rgb(${config.lib.stylix.colors.base08})";
placeholder_text = "locked...";
fail_text = "wrong";
shadow_passes = 0;
}
];
shape = [
{
rounding = 12;
size = "150, 50";
color = "rgb(${config.lib.stylix.colors.base00})";
border_color = "rgb(${config.lib.stylix.colors.base0D})";
position = "-62, 30";
halign = "center";
valign = "center";
}
{
rounding = 12;
size = "120, 50";
color = "rgb(${config.lib.stylix.colors.base00})";
border_color = "rgb(${config.lib.stylix.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(${config.lib.stylix.colors.base00})";
color = "rgb(${config.lib.stylix.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(${config.lib.stylix.colors.base00})";
color = "rgb(${config.lib.stylix.colors.base05})";
position = "77, 28";
halign = "center";
valign = "center";
}
];
};
};
# ifLaptop
xdg.configFile = {
niri = {
target = "niri/config.kdl";
text = let
cursor_size = toString config.stylix.cursor.size;
left = "n";
down = "e";
up = "i";
right = "o";
niriConfig = ''
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"
// variant "colemak_dh,"
options "grp:menu_toggle"
}
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"
}
/-touch {
off
}
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 "#${config.lib.stylix.colors.base0A}"
inactive-color "#${config.lib.stylix.colors.base05}"
width 8
gap 8
corner-radius 4
gaps-between-tabs 4
length total-proportion=0.9
position "left"
place-within-column
}
focus-ring {
//off
width 3
active-gradient from="#${config.lib.stylix.colors.base0D}" to="#${config.lib.stylix.colors.base0F}" angle=40 relative-to="workspace-view"
inactive-color "#${config.lib.stylix.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 "#${config.lib.stylix.colors.base0F}"
inactive-color "#${config.lib.stylix.colors.base03}"
}
border {
width 3
active-color "#${config.lib.stylix.colors.base0F}"
inactive-color "#${config.lib.stylix.colors.base03}"
}
shadow {
on
color "#${config.lib.stylix.colors.base0F}"
inactive-color "#${config.lib.stylix.colors.base03}"
}
}
screenshot-path "${config.xdg.userDirs.pictures}/screenshots/screenshot-%Y-%m-%d-%H-%M-%S.png"
// screenshot-path null
animations {
// off
slowdown 0.7
}
window-rule {
match title="TelegramDesktop"
match app-id="org.telegram.desktop"
open-floating true
}
window-rule {
match title="Картинка в картинці"
open-floating true
}
window-rule {
match title="Picture-in-Picture"
open-floating true
}
window-rule {
match app-id=r#"^org\.wezfurlong\.wezterm$"#
default-column-width { proportion 1.0; }
}
window-rule {
match app-id=r#"^re\.sonny\.Junction$"#
open-floating true
open-focused true
}
window-rule {
match app-id=r#"^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+Return repeat=false { spawn "${terminal}"; }
Mod+Space repeat=false { spawn "${launcher}"; }
Mod+Shift+Space repeat=false { spawn "walker" "-m" "windows"; }
Super+Alt+L repeat=false { spawn "${lockscreen}"; }
Super+Alt+B repeat=false { spawn "${browser}"; }
Super+Alt+V repeat=false { spawn "copyq" "toggle"; }
Mod+Alt+Q { quit; }
Mod+Alt+P { power-off-monitors; }
XF86AudioRaiseVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.05+"; }
XF86AudioLowerVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.05-"; }
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+Page_Down { focus-workspace-down; }
// Mod+Page_Up { focus-workspace-up; }
// Mod+N { focus-workspace-down; }
// Mod+E { focus-workspace-up; }
Mod+Ctrl+Page_Down { move-column-to-workspace-down; }
Mod+Ctrl+Page_Up { move-column-to-workspace-up; }
Mod+Shift+Page_Down { move-workspace-down; }
Mod+Shift+Page_Up { move-workspace-up; }
// Mod+Shift+N { move-workspace-down; }
// Mod+Shift+U { 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+Ctrl+1 { move-window-to-workspace 1; }
Mod+Tab { focus-workspace-previous; }
Mod+Ctrl+Comma { consume-or-expel-window-left; }
Mod+Ctrl+Period { consume-or-expel-window-right; }
Mod+Comma { set-column-width "-10%"; }
Mod+Period { set-column-width "+10%"; }
Mod+T { switch-preset-column-width; }
Mod+H { set-column-width "50%"; }
Mod+Shift+Comma { set-window-height "-10%"; }
Mod+Shift+Period { set-window-height "+10%"; }
Mod+Shift+T { reset-window-height; }
Mod+V { toggle-column-tabbed-display; }
Mod+M { maximize-column; }
Mod+G { switch-focus-between-floating-and-tiling; }
Mod+C { center-column; }
Mod+Ctrl+M { fullscreen-window; }
Mod+Ctrl+G { toggle-window-floating; }
Mod+Ctrl+Q { close-window; }
Mod+Minus { set-column-width "-10%"; }
Mod+Equal { set-column-width "+10%"; }
Mod+Escape { switch-layout "next"; }
// Mod+Shift+Space { switch-layout "prev"; }
Print { screenshot; }
Ctrl+Print { screenshot-screen; }
Alt+Print { screenshot-window; }
}
'';
in
if hostname != "dunamis"
then (builtins.replaceStrings ["// variant \"colemak_dh,\""] ["variant \"colemak_dh,\""] niriConfig)
else niriConfig;
};
};
programs.waybar = {
enable = true;
systemd = {
enable = true;
target = "graphical-session.target";
};
settings = {
bar-0 = {
layer = "top";
position = "bottom";
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 = [];
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 = ["󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂" "󰁹"];
};
"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-left,
.modules-right {
border-top-left-radius: 12px;
border-top-right-radius: 12px;
border-bottom-left-radius: 0px;
border-bottom-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;
}
'';
};
programs.walker = {
enable = true;
package = pkgs.walker;
runAsService = true;
config = {
activation_mode.labels = "neiotsra";
# theme = "stylix";
as_window = false;
builtins = {
applications = {
actions = {enabled = true;};
context_aware = true;
name = "applications";
placeholder = "Applications";
prioritize_new = true;
refresh = true;
show_generic = false;
show_icon_when_single = true;
show_sub_when_single = true;
weight = 5;
};
calc = {
icon = "accessories-calculator";
min_chars = 4;
name = "calc";
placeholder = "Calculator";
weight = 5;
};
clipboard = {
image_height = 300;
max_entries = 10;
name = "clipboard";
placeholder = "Clipboard";
switcher_only = true;
weight = 5;
};
commands = {
icon = "utilities-terminal";
name = "commands";
placeholder = "Commands";
switcher_only = true;
weight = 5;
};
custom_commands = {
icon = "utilities-terminal";
name = "custom_commands";
placeholder = "Custom Commands";
weight = 5;
};
dmenu = {
name = "dmenu";
placeholder = "Dmenu";
switcher_only = true;
weight = 5;
};
emojis = {
history = true;
name = "emojis";
placeholder = "Emojis";
switcher_only = true;
typeahead = true;
weight = 5;
};
finder = {
concurrency = 8;
icon = "folder";
ignore_gitignore = true;
name = "finder";
placeholder = "Finder";
refresh = true;
switcher_only = true;
weight = 5;
};
runner = {
generic_entry = false;
history = true;
icon = "utilities-terminal";
name = "runner";
placeholder = "Runner";
refresh = true;
typeahead = true;
weight = 5;
};
ssh = {
history = true;
icon = "preferences-system-network";
name = "ssh";
placeholder = "SSH";
refresh = true;
switcher_only = true;
weight = 5;
};
switcher = {
name = "switcher";
placeholder = "Switcher";
prefix = "/";
weight = 5;
};
# websearch = {
# engines = ["google"];
# icon = "applications-internet";
# name = "websearch";
# placeholder = "Websearch";
# weight = 5;
# };
windows = {
icon = "view-restore";
name = "windows";
placeholder = "Windows";
weight = 5;
};
};
disable_click_to_close = false;
force_keyboard_focus = true;
list = {
max_entries = 50;
show_initial_entries = true;
single_click = true;
};
search = {
delay = 0;
force_keyboard_focus = true;
history = true;
placeholder = "Search...";
};
};
theme = {
layout = {
ui = {
anchors = {
bottom = false;
left = false;
right = false;
top = false;
};
window = {
h_align = "center";
v_align = "center";
box = {
width = 500;
height = 300;
h_align = "center";
v_align = "center";
spacing = 12;
orientation = "vertical";
# margins = {
# bottom = 200;
# top = 200;
# start = 200;
# };
search = {
margins = {
# bottom = 0;
# top = 0;
start = 8;
end = 8;
};
spacing = 12;
# v_align = "baseline";
h_align = "top";
h_expand = true;
v_expand = true;
};
scroll = {
h_align = "fill";
v_align = "fill";
h_expand = false;
overlay_scrolling = true;
list = {
# max_height = 300;
margins = {
bottom = 8;
top = 0;
start = 8;
end = 8;
};
always_show = true;
v_align = "fill";
h_align = "bottom";
h_expand = false;
v_expand = true;
item = {
icon.theme = "${config.gtk.iconTheme.name}";
spacing = 4;
activation_label = {
h_align = "end";
# v_align = "bottom";
h_expand = false;
justify = "right";
spacing = 4;
margins.end = 12;
# x_align = 1;
};
text = {
h_align = "start";
h_expand = true;
revert = true;
wrap = true;
};
};
};
};
};
};
};
};
style = let
stylix = config.lib.stylix.colors;
in ''
@define-color base00 #${stylix.base00};
@define-color base01 #${stylix.base01};
@define-color base02 #${stylix.base02};
@define-color base03 #${stylix.base03};
@define-color base04 #${stylix.base04};
@define-color base05 #${stylix.base05};
@define-color base06 #${stylix.base06};
@define-color base07 #${stylix.base07};
@define-color base08 #${stylix.base08};
@define-color base09 #${stylix.base09};
@define-color base0A #${stylix.base0A};
@define-color base0B #${stylix.base0B};
@define-color base0C #${stylix.base0C};
@define-color base0D #${stylix.base0D};
@define-color base0E #${stylix.base0E};
@define-color base0F #${stylix.base0F};
#window,
#box,
#search,
#password,
#input,
#typeahead,
#spinner,
#list,
child,
scrollbar,
slider,
#item,
#text,
#label,
#sub,
#activationlabel {
all: unset;
}
#window {
background: none;
color: @base05;
}
#box {
border-radius: 20px;
border-width: 4px;
border-color: @base0D;
background: @base00;
}
#search {
background: @base01;
border-radius: 12px;
padding: 8px;
}
#password,
#input,
#typeahead {
background: none;
box-shadow: none;
border-radius: 12px;
}
#input > *:first-child,
#typeahead > *:first-child {
margin-right: 12px;
border-radius: 12px;
}
/* #spinner {
} */
#typeahead {
color: @base05;
}
#input placeholder {
opacity: 0.5;
}
#list {
padding: 8px;
border-radius: 12px;
background: @base01;
}
child {
box-shadow: none;
}
child:selected,
child:hover {
box-shadow: none;
border-radius: 8px;
background: @base02;
}
#item {
padding: 4px;
}
/* #icon {
}
#text {
}
#label {
} */
#sub {
font-size: smaller;
opacity: 0.5;
}
#activationlabel {
opacity: 0.5;
}
.activation #activationlabel {
opacity: 1;
color: @base05;
}
.activation #text,
.activation #icon,
.activation #search {
opacity: 0.5;
}
'';
};
};
programs.wpaperd.enable = true;
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-icon-theme;
};
};
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";
};
};
};
};
};
}