desktop/niri: experimental refactor
Signed-off-by: unexplrd <unexplrd@linerds.us>
This commit is contained in:
@ -20,10 +20,7 @@
|
||||
xdgPics =
|
||||
config.xdg.userDirs.pictures;
|
||||
ifLaptop = mkIf (hostName != "dunamis");
|
||||
# TODO: make terminal depent on thing outside a module
|
||||
terminal = getExe pkgs.ghostty;
|
||||
launcher = getExe pkgs.fuzzel;
|
||||
browser = "app.zen_browser.zen";
|
||||
lockscreen = getExe pkgs.gtklock;
|
||||
in {
|
||||
options = {
|
||||
@ -36,255 +33,6 @@ in {
|
||||
wpaperd.enable = true;
|
||||
qt.enable = false;
|
||||
};
|
||||
services = {
|
||||
copyq.enable = true;
|
||||
copyq.package = perSystem.nixpkgs-stable.copyq;
|
||||
network-manager-applet.enable = true;
|
||||
playerctld.enable = true;
|
||||
swayosd = {
|
||||
enable = true;
|
||||
topMargin = 0.8;
|
||||
};
|
||||
wpaperd.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;
|
||||
}
|
||||
'';
|
||||
};
|
||||
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 = getExe pkgs.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;
|
||||
width = 20;
|
||||
horizontal-pad = 12;
|
||||
vertical-pad = 12;
|
||||
show-actions = true;
|
||||
match-mode = "fuzzy";
|
||||
icon-theme = config.dconf.settings."org/gnome/desktop/interface".icon-theme;
|
||||
};
|
||||
border = mkDefault {
|
||||
width = 3;
|
||||
radius = 12;
|
||||
};
|
||||
};
|
||||
};
|
||||
xdg.configFile = {
|
||||
niri = {
|
||||
target = "niri/config.kdl";
|
||||
@ -566,10 +314,9 @@ in {
|
||||
|
||||
Mod+Escape { switch-layout "next"; }
|
||||
|
||||
Mod+Return repeat=false { spawn "${terminal}"; }
|
||||
Mod+Return repeat=false { spawn "sh" "-c" "$TERMINAL"; }
|
||||
Mod+Space repeat=false { spawn "${launcher}"; }
|
||||
Mod+Ctrl+L repeat=false { spawn "${lockscreen}"; }
|
||||
Mod+Ctrl+B repeat=false { spawn "${browser}"; }
|
||||
Mod+Ctrl+V repeat=false { spawn "copyq" "toggle"; }
|
||||
|
||||
Mod+Ctrl+Shift+BracketLeft { quit; }
|
||||
@ -639,345 +386,32 @@ in {
|
||||
'';
|
||||
};
|
||||
};
|
||||
programs.waybar = {
|
||||
enable = true;
|
||||
systemd = {
|
||||
enable = true;
|
||||
target = "graphical-session.target";
|
||||
};
|
||||
settings = {
|
||||
bar-0 = {
|
||||
# layer = "top";
|
||||
position = "top";
|
||||
height = 24;
|
||||
spacing = 4;
|
||||
# margin-left = 63;
|
||||
# margin-right = 63;
|
||||
reload_style_on_change = true;
|
||||
modules-left = [
|
||||
"niri/language"
|
||||
"niri/workspaces"
|
||||
"wlr/taskbar"
|
||||
];
|
||||
modules-center = ["clock"];
|
||||
modules-right = [
|
||||
(ifLaptop "group/laptop")
|
||||
"wireplumber"
|
||||
"tray"
|
||||
"privacy"
|
||||
(ifLaptop "power-profiles-daemon")
|
||||
"idle_inhibitor"
|
||||
"custom/notification"
|
||||
];
|
||||
"niri/workspaces" = {
|
||||
format = "{index}";
|
||||
format-icons = {
|
||||
"1" = "൧";
|
||||
"2" = "൨";
|
||||
"3" = "൩";
|
||||
"4" = "൪";
|
||||
"5" = "൫";
|
||||
"6" = "൬";
|
||||
"7" = "൭";
|
||||
"8" = "൮";
|
||||
"9" = "൯";
|
||||
"10" = "൰";
|
||||
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 = "{icon} {percent}%";
|
||||
format-icons = [
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
];
|
||||
};
|
||||
"idle_inhibitor" = {
|
||||
format = "{icon}";
|
||||
format-icons = {
|
||||
activated = "";
|
||||
deactivated = "";
|
||||
};
|
||||
};
|
||||
"tray" = {
|
||||
icon-size = 16;
|
||||
spacing = 6;
|
||||
};
|
||||
"clock" = {
|
||||
interval = 1;
|
||||
format = "{:%H:%M:%S}";
|
||||
tooltip-format = "{:%d.%m.%Y}";
|
||||
};
|
||||
battery = {
|
||||
states = {
|
||||
good = 95;
|
||||
warning = 30;
|
||||
critical = 15;
|
||||
};
|
||||
format = "{icon} {capacity}%";
|
||||
format-full = " {capacity}%";
|
||||
format-charging = " {capacity}%";
|
||||
format-plugged = " {capacity}%";
|
||||
format-alt = "{icon} {time}";
|
||||
format-icons = ["" "" "" "" "" "" "" "" "" ""];
|
||||
};
|
||||
mpris = {
|
||||
format = "{player_icon} {dynamic}";
|
||||
format-paused = "{status_icon} <i>{dynamic}</i>";
|
||||
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 = "{icon} {volume}%";
|
||||
format-muted = "";
|
||||
format-icons = ["" "" ""];
|
||||
on-click = getExe pkgs.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 = 20;
|
||||
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: @base00;
|
||||
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-top-left-radius: 12px;
|
||||
border-top-right-radius: 12px;
|
||||
border-bottom-left-radius: 0px;
|
||||
border-bottom-right-radius: 0px;
|
||||
background-color: @base00;
|
||||
color: @base05; */
|
||||
margin: 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,
|
||||
#taskbar button,
|
||||
#language,
|
||||
#clock,
|
||||
#battery,
|
||||
#backlight,
|
||||
#wireplumber,
|
||||
#workspaces button,
|
||||
#custom-separator {
|
||||
padding: 0 0.3em;
|
||||
}
|
||||
#custom-notification,
|
||||
#idle_inhibitor,
|
||||
#power-profiles-daemon,
|
||||
#privacy,
|
||||
#privacy-item,
|
||||
#tray button {
|
||||
padding: 0 0.4em;
|
||||
margin: 0 0.2em;
|
||||
}
|
||||
#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
|
||||
papers
|
||||
junction
|
||||
celluloid
|
||||
mission-center
|
||||
dconf
|
||||
libnotify
|
||||
playerctl
|
||||
wdisplays
|
||||
pwvucontrol
|
||||
wl-clipboard-rs
|
||||
libqalculate
|
||||
];
|
||||
services = import ./services {inherit pkgs lockscreen getExe perSystem;};
|
||||
programs.fuzzel = import ./programs/fuzzel {inherit config mkDefault;};
|
||||
programs.waybar = import ./programs/waybar {inherit colors config getExe ifLaptop pkgs;};
|
||||
home.packages = with pkgs;
|
||||
[
|
||||
# gui libadwaita apps
|
||||
celluloid # mpv gui in libadwaita
|
||||
helvum # pipewire patchbay in rust
|
||||
junction # app chooser
|
||||
loupe # image viewer and editor in rust
|
||||
mission-center # task manager in rust (partly)
|
||||
nautilus # file manager
|
||||
overskride # bluetooth gui in rust
|
||||
papers # pdf reader in rust
|
||||
pika-backup # borg gui in rust
|
||||
pwvucontrol # pipewire gui in rust
|
||||
wdisplays # wlroots display configurator
|
||||
]
|
||||
++ [
|
||||
# misc utils
|
||||
(ifLaptop brightnessctl)
|
||||
dconf
|
||||
libnotify
|
||||
playerctl
|
||||
wl-clipboard-rs # wl-clipboard in rust
|
||||
];
|
||||
|
||||
gtk = {
|
||||
enable = true;
|
||||
|
6
modules/home/desktop/niri/programs/default.nix
Normal file
6
modules/home/desktop/niri/programs/default.nix
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
imports = [
|
||||
./fuzzel
|
||||
./waybar
|
||||
];
|
||||
}
|
23
modules/home/desktop/niri/programs/fuzzel/default.nix
Normal file
23
modules/home/desktop/niri/programs/fuzzel/default.nix
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
config,
|
||||
mkDefault,
|
||||
}: {
|
||||
enable = true;
|
||||
settings = {
|
||||
main = {
|
||||
terminal = "$TERMINAL -e";
|
||||
fields = "filename,name,generic,keywords,categories,exec";
|
||||
dpi-aware = false;
|
||||
width = 20;
|
||||
horizontal-pad = 12;
|
||||
vertical-pad = 12;
|
||||
show-actions = true;
|
||||
match-mode = "fuzzy";
|
||||
icon-theme = config.dconf.settings."org/gnome/desktop/interface".icon-theme;
|
||||
};
|
||||
border = mkDefault {
|
||||
width = 3;
|
||||
radius = 12;
|
||||
};
|
||||
};
|
||||
}
|
329
modules/home/desktop/niri/programs/waybar/default.nix
Normal file
329
modules/home/desktop/niri/programs/waybar/default.nix
Normal file
@ -0,0 +1,329 @@
|
||||
{
|
||||
colors,
|
||||
config,
|
||||
getExe,
|
||||
ifLaptop,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
enable = true;
|
||||
systemd = {
|
||||
enable = true;
|
||||
target = "graphical-session.target";
|
||||
};
|
||||
settings = {
|
||||
bar-0 = {
|
||||
# layer = "top";
|
||||
position = "top";
|
||||
height = 24;
|
||||
spacing = 4;
|
||||
# margin-left = 63;
|
||||
# margin-right = 63;
|
||||
reload_style_on_change = true;
|
||||
modules-left = [
|
||||
"niri/language"
|
||||
"niri/workspaces"
|
||||
"wlr/taskbar"
|
||||
];
|
||||
modules-center = ["clock"];
|
||||
modules-right = [
|
||||
(ifLaptop "group/laptop")
|
||||
"wireplumber"
|
||||
"tray"
|
||||
"privacy"
|
||||
(ifLaptop "power-profiles-daemon")
|
||||
"idle_inhibitor"
|
||||
"custom/notification"
|
||||
];
|
||||
"niri/workspaces" = {
|
||||
format = "{index}";
|
||||
format-icons = {
|
||||
"1" = "൧";
|
||||
"2" = "൨";
|
||||
"3" = "൩";
|
||||
"4" = "൪";
|
||||
"5" = "൫";
|
||||
"6" = "൬";
|
||||
"7" = "൭";
|
||||
"8" = "൮";
|
||||
"9" = "൯";
|
||||
"10" = "൰";
|
||||
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 = "{icon} {percent}%";
|
||||
format-icons = [
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
];
|
||||
};
|
||||
"idle_inhibitor" = {
|
||||
format = "{icon}";
|
||||
format-icons = {
|
||||
activated = "";
|
||||
deactivated = "";
|
||||
};
|
||||
};
|
||||
"tray" = {
|
||||
icon-size = 16;
|
||||
spacing = 6;
|
||||
};
|
||||
"clock" = {
|
||||
interval = 1;
|
||||
format = "{:%H:%M:%S}";
|
||||
tooltip-format = "{:%d.%m.%Y}";
|
||||
};
|
||||
battery = {
|
||||
states = {
|
||||
good = 95;
|
||||
warning = 30;
|
||||
critical = 15;
|
||||
};
|
||||
format = "{icon} {capacity}%";
|
||||
format-full = " {capacity}%";
|
||||
format-charging = " {capacity}%";
|
||||
format-plugged = " {capacity}%";
|
||||
format-alt = "{icon} {time}";
|
||||
format-icons = ["" "" "" "" "" "" "" "" "" ""];
|
||||
};
|
||||
mpris = {
|
||||
format = "{player_icon} {dynamic}";
|
||||
format-paused = "{status_icon} <i>{dynamic}</i>";
|
||||
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 = "{icon} {volume}%";
|
||||
format-muted = "";
|
||||
format-icons = ["" "" ""];
|
||||
on-click = getExe pkgs.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 = 20;
|
||||
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: @base00;
|
||||
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-top-left-radius: 12px;
|
||||
border-top-right-radius: 12px;
|
||||
border-bottom-left-radius: 0px;
|
||||
border-bottom-right-radius: 0px;
|
||||
background-color: @base00;
|
||||
color: @base05; */
|
||||
margin: 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,
|
||||
#taskbar button,
|
||||
#language,
|
||||
#clock,
|
||||
#battery,
|
||||
#backlight,
|
||||
#wireplumber,
|
||||
#workspaces button,
|
||||
#custom-separator {
|
||||
padding: 0 0.3em;
|
||||
}
|
||||
#custom-notification,
|
||||
#idle_inhibitor,
|
||||
#power-profiles-daemon,
|
||||
#privacy,
|
||||
#privacy-item,
|
||||
#tray button {
|
||||
padding: 0 0.4em;
|
||||
margin: 0 0.2em;
|
||||
}
|
||||
#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;
|
||||
}
|
||||
'';
|
||||
}
|
235
modules/home/desktop/niri/services/default.nix
Normal file
235
modules/home/desktop/niri/services/default.nix
Normal file
@ -0,0 +1,235 @@
|
||||
{
|
||||
getExe,
|
||||
perSystem,
|
||||
pkgs,
|
||||
lockscreen,
|
||||
...
|
||||
}: {
|
||||
copyq.enable = true;
|
||||
copyq.package = perSystem.nixpkgs-stable.copyq;
|
||||
network-manager-applet.enable = true;
|
||||
playerctld.enable = true;
|
||||
swayosd = {
|
||||
enable = true;
|
||||
topMargin = 0.8;
|
||||
};
|
||||
wpaperd.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;
|
||||
}
|
||||
'';
|
||||
};
|
||||
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 = getExe pkgs.niri + " msg action power-off-monitors";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user