refactor dms, new import fsckery
This commit is contained in:
14
modules/home/desktop/dms/dconf.nix
Normal file
14
modules/home/desktop/dms/dconf.nix
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
dconf.settings = {
|
||||||
|
"org/gnome/desktop/wm/preferences" = {
|
||||||
|
button-layout = "icon:maximize,close";
|
||||||
|
};
|
||||||
|
# "org/gnome/desktop/interface" = {
|
||||||
|
# icon-theme = config.gtk.iconTheme.name;
|
||||||
|
# color-scheme =
|
||||||
|
# if config.stylix.polarity == "dark"
|
||||||
|
# then lib.mkDefault "prefer-dark"
|
||||||
|
# else lib.mkDefault "prefer-light";
|
||||||
|
# };
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -9,39 +9,6 @@
|
|||||||
with lib; let
|
with lib; let
|
||||||
cfg = config.desktop.dms;
|
cfg = config.desktop.dms;
|
||||||
# inherit (config.lib.stylix) colors;
|
# inherit (config.lib.stylix) colors;
|
||||||
binds = {
|
|
||||||
suffixes,
|
|
||||||
prefixes,
|
|
||||||
substitutions ? {},
|
|
||||||
}: let
|
|
||||||
replacer = replaceStrings (attrNames substitutions) (attrValues substitutions);
|
|
||||||
format = prefix: suffix: let
|
|
||||||
actual-suffix =
|
|
||||||
if isList suffix.action
|
|
||||||
then {
|
|
||||||
action = head suffix.action;
|
|
||||||
args = tail suffix.action;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
inherit (suffix) action;
|
|
||||||
args = [];
|
|
||||||
};
|
|
||||||
|
|
||||||
action = replacer "${prefix.action}-${actual-suffix.action}";
|
|
||||||
in {
|
|
||||||
name = "${prefix.key}+${suffix.key}";
|
|
||||||
value.action.${action} = actual-suffix.args;
|
|
||||||
};
|
|
||||||
pairs = attrs: fn:
|
|
||||||
concatMap (
|
|
||||||
key:
|
|
||||||
fn {
|
|
||||||
inherit key;
|
|
||||||
action = attrs.${key};
|
|
||||||
}
|
|
||||||
) (attrNames attrs);
|
|
||||||
in
|
|
||||||
listToAttrs (pairs prefixes (prefix: pairs suffixes (suffix: [(format prefix suffix)])));
|
|
||||||
in {
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
# inputs.niri.homeModules.niri
|
# inputs.niri.homeModules.niri
|
||||||
@@ -52,350 +19,74 @@ in {
|
|||||||
desktop.dms.enable =
|
desktop.dms.enable =
|
||||||
mkEnableOption "enable DankMaterialShell";
|
mkEnableOption "enable DankMaterialShell";
|
||||||
};
|
};
|
||||||
config = mkIf cfg.enable {
|
config = let
|
||||||
# stylix.targets.gtk.enable = false;
|
importWithArgs = file: import file {inherit config inputs lib perSystem pkgs;};
|
||||||
# stylix.targets.qt.enable = false;
|
in
|
||||||
|
mkIf cfg.enable (mkMerge [
|
||||||
# stylix.targets.niri.enable = false;
|
(import ./dconf.nix)
|
||||||
|
(importWithArgs ./mimeapps.nix)
|
||||||
services = {
|
(importWithArgs ./programs/niri.nix)
|
||||||
gnome-keyring = {
|
(importWithArgs ./programs/wl-kbptr.nix)
|
||||||
enable = true;
|
(importWithArgs ./services.nix)
|
||||||
components = ["secrets"];
|
{
|
||||||
};
|
home.packages = with pkgs; [
|
||||||
kanshi = import ../niri/services/kanshi;
|
# gui libadwaita utilities
|
||||||
udiskie = {
|
helvum # pipewire patchbay in rust
|
||||||
enable = true;
|
pwvucontrol # pipewire gui in rust
|
||||||
automount = false;
|
wdisplays # wlroots display configurator
|
||||||
notify = true;
|
|
||||||
tray = "auto";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
|
||||||
# gui libadwaita apps
|
|
||||||
celluloid # mpv gui in libadwaita
|
|
||||||
gnome-text-editor
|
|
||||||
helvum # pipewire patchbay in rust
|
|
||||||
junction # app chooser
|
|
||||||
loupe # image viewer and editor in rust
|
|
||||||
nautilus # file manager
|
|
||||||
papers # pdf reader in rust
|
|
||||||
pwvucontrol # pipewire gui in rust
|
|
||||||
wdisplays # wlroots display configurator
|
|
||||||
];
|
|
||||||
# gtk = {
|
|
||||||
# enable = true;
|
|
||||||
# theme = {
|
|
||||||
# name = "adw-gtk3";
|
|
||||||
# package = pkgs.adw-gtk3;
|
|
||||||
# };
|
|
||||||
# };
|
|
||||||
xdg.configFile = {
|
|
||||||
"DankMaterialShell/stylix.json".source = with config.lib.stylix.colors.withHashtag;
|
|
||||||
lib.mkIf config.stylix.enable (
|
|
||||||
pkgs.writers.writeJSON "dms-stylix-theme.json" {
|
|
||||||
"name" = "Stylix";
|
|
||||||
"primary" = base0C;
|
|
||||||
"primaryText" = base00;
|
|
||||||
"primaryContainer" = base0D;
|
|
||||||
"secondary" = base0E;
|
|
||||||
"surface" = base00;
|
|
||||||
"surfaceText" = base05;
|
|
||||||
"surfaceVariant" = base01;
|
|
||||||
"surfaceVariantText" = base04;
|
|
||||||
"surfaceTint" = base0C;
|
|
||||||
"background" = base00;
|
|
||||||
"backgroundText" = base07;
|
|
||||||
"outline" = base03;
|
|
||||||
"surfaceContainer" = base01;
|
|
||||||
"surfaceContainerHigh" = base02;
|
|
||||||
"error" = base08;
|
|
||||||
"warning" = base0A;
|
|
||||||
"info" = base0D;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
# niri = import ./niri.nix commonArgs;
|
|
||||||
"mimeapps.list".force = true;
|
|
||||||
};
|
|
||||||
xdg = {
|
|
||||||
mime.enable = true;
|
|
||||||
mimeApps = {
|
|
||||||
enable = true;
|
|
||||||
defaultApplications = let
|
|
||||||
file_manager = ["org.gnome.Nautilus.desktop"];
|
|
||||||
image_viewer = ["org.gnome.Loupe.desktop"];
|
|
||||||
pdf_reader = ["org.gnome.Papers.desktop"];
|
|
||||||
video_player = ["io.github.celluloid_player.Celluloid.desktop"];
|
|
||||||
web_browser = ["re.sonny.Junction.desktop"];
|
|
||||||
in {
|
|
||||||
"application/pdf" = pdf_reader;
|
|
||||||
"image/jpeg" = image_viewer;
|
|
||||||
"image/png" = image_viewer;
|
|
||||||
"inode/directory" = file_manager;
|
|
||||||
"text/html" = web_browser;
|
|
||||||
"video/mp4" = video_player;
|
|
||||||
"video/mpeg" = video_player;
|
|
||||||
"video/x-matroska" = video_player;
|
|
||||||
"video/x-mpeg" = video_player;
|
|
||||||
"x-scheme-handler/about" = web_browser;
|
|
||||||
"x-scheme-handler/http" = web_browser;
|
|
||||||
"x-scheme-handler/https" = web_browser;
|
|
||||||
"x-scheme-handler/unknown" = web_browser;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
programs.dankMaterialShell = {
|
|
||||||
enable = true;
|
|
||||||
systemd.enable = true;
|
|
||||||
niri = {
|
|
||||||
enableKeybinds = false; # Automatic keybinding configuration
|
|
||||||
# enableSpawn = true; # Auto-start DMS with niri
|
|
||||||
};
|
|
||||||
};
|
|
||||||
programs.niri.settings = {
|
|
||||||
input = {
|
|
||||||
keyboard = {
|
|
||||||
xkb = {
|
|
||||||
layout = "us,ua";
|
|
||||||
variant = "colemak_dh_ortho,";
|
|
||||||
};
|
|
||||||
repeat-delay = 200;
|
|
||||||
repeat-rate = 50;
|
|
||||||
track-layout = "window";
|
|
||||||
};
|
|
||||||
mouse = {
|
|
||||||
accel-speed = 0.0;
|
|
||||||
accel-profile = "flat";
|
|
||||||
};
|
|
||||||
touchpad = {
|
|
||||||
tap = true;
|
|
||||||
dwt = true;
|
|
||||||
natural-scroll = true;
|
|
||||||
click-method = "clickfinger";
|
|
||||||
};
|
|
||||||
|
|
||||||
tablet.map-to-output = "eDP-1";
|
|
||||||
touch.map-to-output = "eDP-1";
|
|
||||||
};
|
|
||||||
|
|
||||||
animations.enable = false;
|
|
||||||
|
|
||||||
clipboard.disable-primary = true;
|
|
||||||
hotkey-overlay.skip-at-startup = true;
|
|
||||||
prefer-no-csd = true;
|
|
||||||
xwayland-satellite.path = lib.getExe perSystem.xwst.xwayland-satellite;
|
|
||||||
|
|
||||||
screenshot-path = "${config.xdg.userDirs.pictures}/screenshots/screenshot-%Y-%m-%d-%H-%M-%S.png";
|
|
||||||
|
|
||||||
layout = {
|
|
||||||
gaps = 3;
|
|
||||||
struts.left = 32;
|
|
||||||
struts.right = 32;
|
|
||||||
always-center-single-column = true;
|
|
||||||
center-focused-column = "on-overflow";
|
|
||||||
|
|
||||||
default-column-width.proportion = 2.0 / 3.0;
|
|
||||||
preset-column-widths = [
|
|
||||||
{proportion = 1.0 / 3.0;}
|
|
||||||
{proportion = 1.0 / 2.0;}
|
|
||||||
{proportion = 2.0 / 3.0;}
|
|
||||||
];
|
];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
# stylix.targets.niri.enable = false;
|
||||||
|
|
||||||
background-color = "transparent";
|
# stylix.targets.gtk.enable = false;
|
||||||
|
# gtk = {
|
||||||
empty-workspace-above-first = true;
|
# enable = true;
|
||||||
|
# theme = {
|
||||||
focus-ring.enable = false;
|
# name = "adw-gtk3";
|
||||||
border = {
|
# package = pkgs.adw-gtk3;
|
||||||
enable = true;
|
# };
|
||||||
width = 1;
|
|
||||||
# active.color = "#${colors.base03}";
|
|
||||||
# inactive.color = "#${colors.base02}";
|
|
||||||
# urgent.color = "#${colors.base08}";
|
|
||||||
};
|
|
||||||
# };
|
# };
|
||||||
|
#
|
||||||
|
|
||||||
shadow.enable = false;
|
stylix.targets.qt.enable = false;
|
||||||
|
qt = {
|
||||||
# default-column-display = "tabbed";
|
enable = true;
|
||||||
|
platformTheme.name = "gtk3";
|
||||||
tab-indicator = {
|
|
||||||
position = "top";
|
|
||||||
gaps-between-tabs = 10;
|
|
||||||
|
|
||||||
# hide-when-single-tab = true;
|
|
||||||
# place-within-column = true;
|
|
||||||
|
|
||||||
# active.color = "red";
|
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
{
|
||||||
binds = with config.lib.niri.actions; let
|
programs.dankMaterialShell = {
|
||||||
dms-ipc = spawn "dms" "ipc";
|
enable = true;
|
||||||
sh = spawn "sh" "-c";
|
systemd.enable = true;
|
||||||
in
|
niri.enableKeybinds = false; # Automatic keybinding configuration
|
||||||
lib.attrsets.mergeAttrsList [
|
# niri.enableSpawn = true; # Auto-start DMS with niri
|
||||||
{
|
};
|
||||||
"Mod+Shift+Slash" = {action = show-hotkey-overlay;};
|
}
|
||||||
|
{
|
||||||
"Mod+Tab" = {action = focus-workspace-previous;};
|
xdg.configFile."DankMaterialShell/stylix.json".source = with config.lib.stylix.colors.withHashtag;
|
||||||
"Mod+C" = {action = center-column;};
|
lib.mkIf config.stylix.enable (
|
||||||
"Mod+M" = lib.mkForce {action = maximize-column;};
|
pkgs.writers.writeJSON "dms-stylix-theme.json" {
|
||||||
"Mod+H" = {action = set-column-width "50%";};
|
"name" = "Stylix";
|
||||||
"Mod+T" = {action = set-column-width "33%";};
|
"primary" = base0C;
|
||||||
"Mod+Shift+T" = {action = set-column-width "67%";};
|
"primaryText" = base00;
|
||||||
# "Mod+V" = {action = toggle-column-tabbed-display;};
|
"primaryContainer" = base0D;
|
||||||
"Mod+G" = {action = switch-focus-between-floating-and-tiling;};
|
"secondary" = base0E;
|
||||||
"Mod+Space" = {action = switch-layout "next";};
|
"surface" = base00;
|
||||||
|
"surfaceText" = base05;
|
||||||
"Mod+Ctrl+Comma" = {action = consume-or-expel-window-left;};
|
"surfaceVariant" = base01;
|
||||||
"Mod+Ctrl+Period" = {action = consume-or-expel-window-right;};
|
"surfaceVariantText" = base04;
|
||||||
|
"surfaceTint" = base0C;
|
||||||
"Mod+Ctrl+Q" = {action = close-window;};
|
"background" = base00;
|
||||||
"Mod+Ctrl+M" = {action = fullscreen-window;};
|
"backgroundText" = base07;
|
||||||
"Mod+Ctrl+G" = {action = toggle-window-floating;};
|
"outline" = base03;
|
||||||
|
"surfaceContainer" = base01;
|
||||||
"Mod+Shift+M" = {action = maximize-window-to-edges;};
|
"surfaceContainerHigh" = base02;
|
||||||
|
"error" = base08;
|
||||||
"Mod+Ctrl+Shift+M" = {action = toggle-windowed-fullscreen;};
|
"warning" = base0A;
|
||||||
|
"info" = base0D;
|
||||||
"Mod+Minus".action = set-column-width "-10%";
|
}
|
||||||
"Mod+Equal" = {action = set-column-width "+10%";};
|
);
|
||||||
"Mod+Plus".action = set-column-width "+10%";
|
}
|
||||||
"Mod+Shift+Minus".action = set-window-height "-10%";
|
]);
|
||||||
"Mod+Shift+Plus".action = set-window-height "+10%";
|
|
||||||
|
|
||||||
"Mod+D" = {
|
|
||||||
action = dms-ipc "spotlight" "toggle";
|
|
||||||
hotkey-overlay.title = "Toggle Application Launcher";
|
|
||||||
};
|
|
||||||
# "Mod+N" = {
|
|
||||||
# action = dms-ipc "notifications" "toggle";
|
|
||||||
# hotkey-overlay.title = "Toggle Notification Center";
|
|
||||||
# };
|
|
||||||
# "Mod+Comma" = {
|
|
||||||
# action = dms-ipc "settings" "toggle";
|
|
||||||
# hotkey-overlay.title = "Toggle Settings";
|
|
||||||
# };
|
|
||||||
# "Mod+P" = {
|
|
||||||
# action = dms-ipc "notepad" "toggle";
|
|
||||||
# hotkey-overlay.title = "Toggle Notepad";
|
|
||||||
# };
|
|
||||||
"Super+Ctrl+L" = {
|
|
||||||
action = dms-ipc "lock" "lock";
|
|
||||||
hotkey-overlay.title = "Toggle Lock Screen";
|
|
||||||
};
|
|
||||||
"Mod+Alt+Q" = {
|
|
||||||
action = dms-ipc "powermenu" "toggle";
|
|
||||||
hotkey-overlay.title = "Toggle Power Menu";
|
|
||||||
};
|
|
||||||
"XF86AudioRaiseVolume" = {
|
|
||||||
allow-when-locked = true;
|
|
||||||
action = dms-ipc "audio" "increment" "3";
|
|
||||||
};
|
|
||||||
"XF86AudioLowerVolume" = {
|
|
||||||
allow-when-locked = true;
|
|
||||||
action = dms-ipc "audio" "decrement" "3";
|
|
||||||
};
|
|
||||||
"XF86AudioMute" = {
|
|
||||||
allow-when-locked = true;
|
|
||||||
action = dms-ipc "audio" "mute";
|
|
||||||
};
|
|
||||||
"Shift+XF86AudioMute" = {
|
|
||||||
allow-when-locked = true;
|
|
||||||
action = dms-ipc "audio" "micmute";
|
|
||||||
};
|
|
||||||
"XF86AudioMicMute" = {
|
|
||||||
allow-when-locked = true;
|
|
||||||
action = dms-ipc "audio" "micmute";
|
|
||||||
};
|
|
||||||
"Mod+Alt+N" = {
|
|
||||||
allow-when-locked = true;
|
|
||||||
action = dms-ipc "night" "toggle";
|
|
||||||
hotkey-overlay.title = "Toggle Night Mode";
|
|
||||||
};
|
|
||||||
"Mod+V" = {
|
|
||||||
action = dms-ipc "clipboard" "toggle";
|
|
||||||
hotkey-overlay.title = "Toggle Clipboard Manager";
|
|
||||||
};
|
|
||||||
"XF86MonBrightnessUp" = {
|
|
||||||
allow-when-locked = true;
|
|
||||||
action = dms-ipc "brightness" "increment" "5" "";
|
|
||||||
};
|
|
||||||
"XF86MonBrightnessDown" = {
|
|
||||||
allow-when-locked = true;
|
|
||||||
action = dms-ipc "brightness" "decrement" "5" "";
|
|
||||||
};
|
|
||||||
|
|
||||||
"Mod+Return" = {action = sh "$TERMINAL";};
|
|
||||||
|
|
||||||
"Print" = {action = dms-ipc "niri" "screenshot";};
|
|
||||||
"Ctrl+Print" = {action = dms-ipc "niri" "screenshotScreen";};
|
|
||||||
"Shift+Print" = {action = dms-ipc "niri" "screenshotWindow";};
|
|
||||||
|
|
||||||
"Mod+Ctrl+Space" = {
|
|
||||||
repeat = false;
|
|
||||||
action = toggle-overview;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
(binds {
|
|
||||||
suffixes."Left" = "column-left";
|
|
||||||
suffixes."Down" = "window-down";
|
|
||||||
suffixes."Up" = "window-up";
|
|
||||||
suffixes."Right" = "column-right";
|
|
||||||
prefixes."Mod" = "focus";
|
|
||||||
prefixes."Mod+Ctrl" = "move";
|
|
||||||
prefixes."Mod+Shift" = "focus-monitor";
|
|
||||||
prefixes."Mod+Shift+Ctrl" = "move-window-to-monitor";
|
|
||||||
substitutions."monitor-column" = "monitor";
|
|
||||||
substitutions."monitor-window" = "monitor";
|
|
||||||
})
|
|
||||||
# {
|
|
||||||
# "Mod+V".action = switch-focus-between-floating-and-tiling;
|
|
||||||
# "Mod+Shift+V".action = toggle-window-floating;
|
|
||||||
# }
|
|
||||||
(binds {
|
|
||||||
suffixes."Home" = "first";
|
|
||||||
suffixes."End" = "last";
|
|
||||||
prefixes."Mod" = "focus-column";
|
|
||||||
prefixes."Mod+Ctrl" = "move-column-to";
|
|
||||||
})
|
|
||||||
(binds {
|
|
||||||
suffixes."Down" = "workspace-down";
|
|
||||||
suffixes."Up" = "workspace-up";
|
|
||||||
prefixes."Mod" = "focus";
|
|
||||||
prefixes."Mod+Ctrl" = "move-window-to";
|
|
||||||
prefixes."Mod+Shift" = "move";
|
|
||||||
})
|
|
||||||
(binds {
|
|
||||||
suffixes = builtins.listToAttrs (
|
|
||||||
map (n: {
|
|
||||||
name = toString n;
|
|
||||||
value = [
|
|
||||||
"workspace"
|
|
||||||
(n + 1)
|
|
||||||
]; # workspace 1 is empty; workspace 2 is the logical first.
|
|
||||||
}) (range 1 9)
|
|
||||||
);
|
|
||||||
prefixes."Mod" = "focus";
|
|
||||||
prefixes."Mod+Ctrl" = "move-window-to";
|
|
||||||
})
|
|
||||||
];
|
|
||||||
window-rules = [
|
|
||||||
{
|
|
||||||
geometry-corner-radius = let
|
|
||||||
r = 12.0;
|
|
||||||
in {
|
|
||||||
top-left = r;
|
|
||||||
top-right = r;
|
|
||||||
bottom-left = r;
|
|
||||||
bottom-right = r;
|
|
||||||
};
|
|
||||||
clip-to-geometry = true;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
45
modules/home/desktop/dms/mimeapps.nix
Normal file
45
modules/home/desktop/dms/mimeapps.nix
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
{
|
||||||
|
# config,
|
||||||
|
# lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
celluloid # mpv gui in libadwaita
|
||||||
|
gnome-text-editor
|
||||||
|
helvum # pipewire patchbay in rust
|
||||||
|
junction # app chooser
|
||||||
|
loupe # image viewer and editor in rust
|
||||||
|
nautilus # file manager
|
||||||
|
papers # pdf reader in rust
|
||||||
|
];
|
||||||
|
xdg = {
|
||||||
|
configFile."mimeapps.list".force = true;
|
||||||
|
mime.enable = true;
|
||||||
|
mimeApps = {
|
||||||
|
enable = true;
|
||||||
|
defaultApplications = let
|
||||||
|
file_manager = ["org.gnome.Nautilus.desktop"];
|
||||||
|
image_viewer = ["org.gnome.Loupe.desktop"];
|
||||||
|
pdf_reader = ["org.gnome.Papers.desktop"];
|
||||||
|
video_player = ["io.github.celluloid_player.Celluloid.desktop"];
|
||||||
|
web_browser = ["re.sonny.Junction.desktop"];
|
||||||
|
in {
|
||||||
|
# TODO: add text/ mimetypes for gnome-editor
|
||||||
|
"application/pdf" = pdf_reader;
|
||||||
|
"image/jpeg" = image_viewer;
|
||||||
|
"image/png" = image_viewer;
|
||||||
|
"inode/directory" = file_manager;
|
||||||
|
"text/html" = web_browser;
|
||||||
|
"video/mp4" = video_player;
|
||||||
|
"video/mpeg" = video_player;
|
||||||
|
"video/x-matroska" = video_player;
|
||||||
|
"video/x-mpeg" = video_player;
|
||||||
|
"x-scheme-handler/about" = web_browser;
|
||||||
|
"x-scheme-handler/http" = web_browser;
|
||||||
|
"x-scheme-handler/https" = web_browser;
|
||||||
|
"x-scheme-handler/unknown" = web_browser;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
6
modules/home/desktop/dms/programs/default.nix
Normal file
6
modules/home/desktop/dms/programs/default.nix
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./niri.nix
|
||||||
|
./wl-kbptr.nix
|
||||||
|
];
|
||||||
|
}
|
||||||
382
modules/home/desktop/dms/programs/niri.nix
Normal file
382
modules/home/desktop/dms/programs/niri.nix
Normal file
@@ -0,0 +1,382 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
perSystem,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
binds = {
|
||||||
|
suffixes,
|
||||||
|
prefixes,
|
||||||
|
substitutions ? {},
|
||||||
|
}: let
|
||||||
|
replacer = replaceStrings (attrNames substitutions) (attrValues substitutions);
|
||||||
|
format = prefix: suffix: let
|
||||||
|
actual-suffix =
|
||||||
|
if isList suffix.action
|
||||||
|
then {
|
||||||
|
action = head suffix.action;
|
||||||
|
args = tail suffix.action;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
inherit (suffix) action;
|
||||||
|
args = [];
|
||||||
|
};
|
||||||
|
|
||||||
|
action = replacer "${prefix.action}-${actual-suffix.action}";
|
||||||
|
in {
|
||||||
|
name = "${prefix.key}+${suffix.key}";
|
||||||
|
value.action.${action} = actual-suffix.args;
|
||||||
|
};
|
||||||
|
pairs = attrs: fn:
|
||||||
|
concatMap (
|
||||||
|
key:
|
||||||
|
fn {
|
||||||
|
inherit key;
|
||||||
|
action = attrs.${key};
|
||||||
|
}
|
||||||
|
) (attrNames attrs);
|
||||||
|
in
|
||||||
|
listToAttrs (pairs prefixes (prefix: pairs suffixes (suffix: [(format prefix suffix)])));
|
||||||
|
in {
|
||||||
|
programs.niri.settings = {
|
||||||
|
environment = {
|
||||||
|
ELECTRON_OZONE_PLATFORM_HINT = "auto";
|
||||||
|
QT_QPA_PLATFORM = "wayland";
|
||||||
|
QT_QPA_PLATFORMTHEME = "gtk3";
|
||||||
|
QT_QPA_PLATFORMTHEME_QT6 = "gtk3";
|
||||||
|
XDG_CURRENT_DESKTOP = "niri";
|
||||||
|
};
|
||||||
|
input = {
|
||||||
|
keyboard = {
|
||||||
|
xkb = {
|
||||||
|
layout = "us,ua";
|
||||||
|
variant = "colemak_dh_ortho,";
|
||||||
|
};
|
||||||
|
repeat-delay = 200;
|
||||||
|
repeat-rate = 50;
|
||||||
|
track-layout = "window";
|
||||||
|
};
|
||||||
|
mouse = {
|
||||||
|
accel-speed = 0.0;
|
||||||
|
accel-profile = "flat";
|
||||||
|
};
|
||||||
|
touchpad = {
|
||||||
|
tap = true;
|
||||||
|
dwt = true;
|
||||||
|
natural-scroll = true;
|
||||||
|
click-method = "clickfinger";
|
||||||
|
};
|
||||||
|
|
||||||
|
tablet.map-to-output = "eDP-1";
|
||||||
|
touch.map-to-output = "eDP-1";
|
||||||
|
};
|
||||||
|
|
||||||
|
animations.enable = true;
|
||||||
|
animations.slowdown = 0.4;
|
||||||
|
|
||||||
|
clipboard.disable-primary = true;
|
||||||
|
hotkey-overlay.skip-at-startup = true;
|
||||||
|
overview.workspace-shadow.enable = false;
|
||||||
|
prefer-no-csd = true;
|
||||||
|
xwayland-satellite.path = lib.getExe perSystem.xwst.xwayland-satellite;
|
||||||
|
|
||||||
|
screenshot-path = "${config.xdg.userDirs.pictures}/screenshots/screenshot-%Y-%m-%d-%H-%M-%S.png";
|
||||||
|
|
||||||
|
layout = {
|
||||||
|
gaps = 3;
|
||||||
|
struts.left = 32;
|
||||||
|
struts.right = 32;
|
||||||
|
|
||||||
|
always-center-single-column = true;
|
||||||
|
center-focused-column = "on-overflow";
|
||||||
|
# default-column-display = "tabbed";
|
||||||
|
empty-workspace-above-first = true;
|
||||||
|
|
||||||
|
default-column-width.proportion = 2.0 / 3.0;
|
||||||
|
preset-column-widths = [
|
||||||
|
{proportion = 1.0 / 3.0;}
|
||||||
|
{proportion = 1.0 / 2.0;}
|
||||||
|
{proportion = 2.0 / 3.0;}
|
||||||
|
];
|
||||||
|
|
||||||
|
background-color = "transparent";
|
||||||
|
|
||||||
|
border.enable = true;
|
||||||
|
border.width = 1;
|
||||||
|
|
||||||
|
focus-ring.enable = false;
|
||||||
|
|
||||||
|
shadow.enable = false;
|
||||||
|
|
||||||
|
tab-indicator = let
|
||||||
|
i = 4;
|
||||||
|
in {
|
||||||
|
position = "bottom";
|
||||||
|
gaps-between-tabs = i;
|
||||||
|
corner-radius = i;
|
||||||
|
width = i;
|
||||||
|
place-within-column = true;
|
||||||
|
|
||||||
|
# hide-when-single-tab = true;
|
||||||
|
# place-within-column = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
binds = with config.lib.niri.actions; let
|
||||||
|
dms-ipc = spawn "dms" "ipc";
|
||||||
|
sh = spawn "sh" "-c";
|
||||||
|
in
|
||||||
|
lib.attrsets.mergeAttrsList [
|
||||||
|
{
|
||||||
|
"Mod+Shift+Slash".action = show-hotkey-overlay;
|
||||||
|
|
||||||
|
"Mod+Tab".action = focus-workspace-previous;
|
||||||
|
"Mod+C".action = center-column;
|
||||||
|
|
||||||
|
"Mod+Q".action = close-window;
|
||||||
|
|
||||||
|
"Mod+Ctrl+G".action = toggle-window-floating;
|
||||||
|
|
||||||
|
"Mod+M".action = maximize-column;
|
||||||
|
"Mod+Ctrl+M".action = fullscreen-window;
|
||||||
|
"Mod+Shift+M".action = maximize-window-to-edges;
|
||||||
|
"Mod+Ctrl+Shift+M".action = toggle-windowed-fullscreen;
|
||||||
|
|
||||||
|
"Mod+S" = {action = set-column-width "50%";};
|
||||||
|
"Mod+Shift+S" = {action = set-column-width "33%";};
|
||||||
|
"Mod+Ctrl+S" = {action = set-column-width "67%";};
|
||||||
|
|
||||||
|
"Mod+T" = {action = toggle-column-tabbed-display;};
|
||||||
|
|
||||||
|
"Mod+F".action = switch-focus-between-floating-and-tiling;
|
||||||
|
|
||||||
|
"Mod+Ctrl+Comma".action = consume-or-expel-window-left;
|
||||||
|
"Mod+Ctrl+Period".action = consume-or-expel-window-right;
|
||||||
|
|
||||||
|
"Mod+Minus".action = set-column-width "-10%";
|
||||||
|
"Mod+Equal".action = set-column-width "+10%";
|
||||||
|
"Mod+Plus".action = set-column-width "+10%";
|
||||||
|
"Mod+Shift+Minus".action = set-window-height "-10%";
|
||||||
|
"Mod+Shift+Plus".action = set-window-height "+10%";
|
||||||
|
|
||||||
|
"Print".action = dms-ipc "niri" "screenshot";
|
||||||
|
"Ctrl+Print".action = dms-ipc "niri" "screenshotScreen";
|
||||||
|
"Shift+Print".action = dms-ipc "niri" "screenshotWindow";
|
||||||
|
|
||||||
|
"Mod+Space" = {action = switch-layout "next";};
|
||||||
|
"Mod+Ctrl+Space" = {
|
||||||
|
repeat = false;
|
||||||
|
action = toggle-overview;
|
||||||
|
};
|
||||||
|
|
||||||
|
"Mod+Return" = {action = sh "$TERMINAL";};
|
||||||
|
|
||||||
|
"Mod+R".action = sh "wl-kbptr -o modes=floating,click";
|
||||||
|
"Mod+Ctrl+R".action = sh "while wl-kbptr -o modes=split,click; do :; done";
|
||||||
|
"Mod+Shift+R".action = sh "wl-kbptr -o modes=tile,bisect,click";
|
||||||
|
|
||||||
|
"Mod+D" = {
|
||||||
|
action = spawn "vicinae" "toggle";
|
||||||
|
hotkey-overlay.title = "Toggle Application Launcher";
|
||||||
|
};
|
||||||
|
# "Mod+N" = {
|
||||||
|
# action = dms-ipc "notifications" "toggle";
|
||||||
|
# hotkey-overlay.title = "Toggle Notification Center";
|
||||||
|
# };
|
||||||
|
# "Mod+Comma" = {
|
||||||
|
# action = dms-ipc "settings" "toggle";
|
||||||
|
# hotkey-overlay.title = "Toggle Settings";
|
||||||
|
# };
|
||||||
|
# "Mod+P" = {
|
||||||
|
# action = dms-ipc "notepad" "toggle";
|
||||||
|
# hotkey-overlay.title = "Toggle Notepad";
|
||||||
|
# };
|
||||||
|
"Mod+Ctrl+L" = {
|
||||||
|
action = dms-ipc "lock" "lock";
|
||||||
|
hotkey-overlay.title = "Toggle Lock Screen";
|
||||||
|
};
|
||||||
|
"Mod+Ctrl+Q" = {
|
||||||
|
action = dms-ipc "powermenu" "toggle";
|
||||||
|
hotkey-overlay.title = "Toggle Power Menu";
|
||||||
|
};
|
||||||
|
"XF86AudioRaiseVolume" = {
|
||||||
|
allow-when-locked = true;
|
||||||
|
action = dms-ipc "audio" "increment" "3";
|
||||||
|
};
|
||||||
|
"XF86AudioLowerVolume" = {
|
||||||
|
allow-when-locked = true;
|
||||||
|
action = dms-ipc "audio" "decrement" "3";
|
||||||
|
};
|
||||||
|
"XF86AudioMute" = {
|
||||||
|
allow-when-locked = true;
|
||||||
|
action = dms-ipc "audio" "mute";
|
||||||
|
};
|
||||||
|
"Shift+XF86AudioMute" = {
|
||||||
|
allow-when-locked = true;
|
||||||
|
action = dms-ipc "audio" "micmute";
|
||||||
|
};
|
||||||
|
"XF86AudioMicMute" = {
|
||||||
|
allow-when-locked = true;
|
||||||
|
action = dms-ipc "audio" "micmute";
|
||||||
|
};
|
||||||
|
"XF86AudioPlay".action = dms-ipc "mpris" "playPause";
|
||||||
|
"XF86AudioPause".action = dms-ipc "mpris" "pause";
|
||||||
|
"XF86AudioPrev".action = dms-ipc "mpris" "previous";
|
||||||
|
"XF86AudioNext".action = dms-ipc "mpris" "next";
|
||||||
|
"Mod+Alt+N" = {
|
||||||
|
allow-when-locked = true;
|
||||||
|
action = dms-ipc "night" "toggle";
|
||||||
|
hotkey-overlay.title = "Toggle Night Mode";
|
||||||
|
};
|
||||||
|
"Mod+V" = {
|
||||||
|
action = spawn "vicinae" "vicinae://extensions/vicinae/clipboard/history";
|
||||||
|
hotkey-overlay.title = "Toggle Clipboard Manager";
|
||||||
|
};
|
||||||
|
"XF86MonBrightnessUp" = {
|
||||||
|
allow-when-locked = true;
|
||||||
|
action = dms-ipc "brightness" "increment" "5" "";
|
||||||
|
};
|
||||||
|
"XF86MonBrightnessDown" = {
|
||||||
|
allow-when-locked = true;
|
||||||
|
action = dms-ipc "brightness" "decrement" "5" "";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
(let
|
||||||
|
left = "N";
|
||||||
|
up = "E";
|
||||||
|
down = "I";
|
||||||
|
right = "O";
|
||||||
|
in
|
||||||
|
binds rec {
|
||||||
|
suffixes = {
|
||||||
|
"Left" = "column-left";
|
||||||
|
"Down" = "window-or-workspace-down";
|
||||||
|
"Up" = "window-or-workspace-up";
|
||||||
|
"Right" = "column-right";
|
||||||
|
${left} = suffixes."Left";
|
||||||
|
${down} = suffixes."Down";
|
||||||
|
${up} = suffixes."Up";
|
||||||
|
${right} = suffixes."Right";
|
||||||
|
};
|
||||||
|
prefixes = {
|
||||||
|
"Mod" = "focus";
|
||||||
|
"Mod+Ctrl" = "move";
|
||||||
|
"Mod+Shift" = "focus-monitor";
|
||||||
|
"Mod+Shift+Ctrl" = "move-window-to-monitor";
|
||||||
|
};
|
||||||
|
substitutions = {
|
||||||
|
"monitor-column" = "monitor";
|
||||||
|
"monitor-window-or-workspace" = "monitor";
|
||||||
|
"move-window-or-workspace" = "move-window";
|
||||||
|
};
|
||||||
|
})
|
||||||
|
# {
|
||||||
|
# "Mod+V".action = switch-focus-between-floating-and-tiling;
|
||||||
|
# "Mod+Shift+V".action = toggle-window-floating;
|
||||||
|
# }
|
||||||
|
(binds {
|
||||||
|
suffixes."Home" = "first";
|
||||||
|
suffixes."End" = "last";
|
||||||
|
prefixes."Mod" = "focus-column";
|
||||||
|
prefixes."Mod+Ctrl" = "move-column-to";
|
||||||
|
})
|
||||||
|
(binds {
|
||||||
|
# PageDown and PageUp
|
||||||
|
suffixes."Prior" = "workspace-up";
|
||||||
|
suffixes."Next" = "workspace-down";
|
||||||
|
suffixes."WheelScrollUp" = "workspace-up";
|
||||||
|
suffixes."WheelScrollDown" = "workspace-down";
|
||||||
|
prefixes."Mod" = "focus";
|
||||||
|
prefixes."Mod+Ctrl" = "move-column-to";
|
||||||
|
prefixes."Mod+Shift" = "move";
|
||||||
|
})
|
||||||
|
(binds {
|
||||||
|
suffixes = builtins.listToAttrs (
|
||||||
|
map (n: {
|
||||||
|
name = toString n;
|
||||||
|
value = [
|
||||||
|
"workspace"
|
||||||
|
(n + 1)
|
||||||
|
]; # workspace 1 is empty; workspace 2 is the logical first.
|
||||||
|
}) (range 1 9)
|
||||||
|
);
|
||||||
|
prefixes."Mod" = "focus";
|
||||||
|
prefixes."Mod+Ctrl" = "move-window-to";
|
||||||
|
})
|
||||||
|
];
|
||||||
|
window-rules = [
|
||||||
|
{
|
||||||
|
clip-to-geometry = true;
|
||||||
|
geometry-corner-radius = let
|
||||||
|
r = 12.0;
|
||||||
|
in {
|
||||||
|
top-left = r;
|
||||||
|
top-right = r;
|
||||||
|
bottom-left = r;
|
||||||
|
bottom-right = r;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
{
|
||||||
|
matches = [{is-active = false;}];
|
||||||
|
draw-border-with-background = false;
|
||||||
|
opacity = 0.9;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
matches = [
|
||||||
|
{title = "Picture-in-Picture";}
|
||||||
|
{title = "Картинка в картинці";}
|
||||||
|
{
|
||||||
|
# telegram's picture-in-picture mode
|
||||||
|
app-id = "io.github.kukuruzka165.materialgram";
|
||||||
|
title = "materialgram";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
open-floating = true;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
matches = [
|
||||||
|
{app-id = "re.sonny.Junction";}
|
||||||
|
{app-id = "com.github.hluk.copyq";}
|
||||||
|
{title = "r\"^.* - Choose User Profile$\"";}
|
||||||
|
];
|
||||||
|
open-floating = true;
|
||||||
|
open-focused = true;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
matches = [
|
||||||
|
{app-id = "org.keepassxc.KeePassXC";}
|
||||||
|
{app-id = "org.gnome.World.Secrets";}
|
||||||
|
{app-id = "Bitwarden";}
|
||||||
|
{app-id = "io.github.kukuruzka165.materialgram";}
|
||||||
|
{app-id = "org.telegram.desktop";}
|
||||||
|
{app-id = "org.signal.Signal";}
|
||||||
|
{app-id = "WebCord";}
|
||||||
|
{app-id = "equibop";}
|
||||||
|
];
|
||||||
|
block-out-from = "screencast";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
matches = [
|
||||||
|
{app-id = "Alacritty";}
|
||||||
|
{app-id = "com.mitchellh.ghostty";}
|
||||||
|
{app-id = "org.wezfurlong.wezterm";}
|
||||||
|
{app-id = "zen";}
|
||||||
|
];
|
||||||
|
# default-column-width = {proportion = 1.0;};
|
||||||
|
draw-border-with-background = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
matches = [{app-id = "org.quickshell";}];
|
||||||
|
open-floating = true;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
layer-rules = [
|
||||||
|
{
|
||||||
|
matches = [{namespace = "^quickshell$";}];
|
||||||
|
place-within-backdrop = true;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
51
modules/home/desktop/dms/programs/wl-kbptr.nix
Normal file
51
modules/home/desktop/dms/programs/wl-kbptr.nix
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
{config, ...}: {
|
||||||
|
programs.wl-kbptr = {
|
||||||
|
enable = true;
|
||||||
|
settings = with config.lib.stylix.colors.withHashtag; rec {
|
||||||
|
general.cancellation_status_code = 1;
|
||||||
|
mode_floating = {
|
||||||
|
source = "detect";
|
||||||
|
label_color = base05;
|
||||||
|
label_select_color = base0A;
|
||||||
|
unselectable_bg_color = "#2222";
|
||||||
|
selectable_bg_color = base01 + "cc";
|
||||||
|
selectable_border_color = base01;
|
||||||
|
label_font_family = config.stylix.fonts.sansSerif.name;
|
||||||
|
label_font_size = "12 50% 100";
|
||||||
|
label_symbols = "abcdefghijklmnopqrstuvwxyz";
|
||||||
|
};
|
||||||
|
mode_tile = {
|
||||||
|
inherit
|
||||||
|
(mode_floating)
|
||||||
|
label_color
|
||||||
|
label_select_color
|
||||||
|
unselectable_bg_color
|
||||||
|
selectable_bg_color
|
||||||
|
selectable_border_color
|
||||||
|
label_font_family
|
||||||
|
label_symbols
|
||||||
|
;
|
||||||
|
label_font_size = "8 50% 100";
|
||||||
|
};
|
||||||
|
mode_bisect = {
|
||||||
|
inherit (mode_floating) label_color unselectable_bg_color label_font_family;
|
||||||
|
label_font_size = 20;
|
||||||
|
label_padding = "12";
|
||||||
|
pointer_size = 24;
|
||||||
|
pointer_color = base08;
|
||||||
|
even_area_bg_color = base0C + "aa";
|
||||||
|
even_area_border_color = base0C;
|
||||||
|
odd_area_bg_color = base0D + "aa";
|
||||||
|
odd_area_border_color = base0D;
|
||||||
|
history_border_color = base01;
|
||||||
|
};
|
||||||
|
mode_split = {
|
||||||
|
inherit (mode_bisect) pointer_size pointer_color history_border_color;
|
||||||
|
bg_color = mode_floating.unselectable_bg_color;
|
||||||
|
area_bg_color = mode_floating.selectable_bg_color;
|
||||||
|
vertical_color = base09;
|
||||||
|
horizontal_color = mode_bisect.odd_area_border_color;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
44
modules/home/desktop/dms/services.nix
Normal file
44
modules/home/desktop/dms/services.nix
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
{
|
||||||
|
# config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
services = {
|
||||||
|
gnome-keyring = {
|
||||||
|
enable = true;
|
||||||
|
components = ["secrets"];
|
||||||
|
};
|
||||||
|
kanshi = import ../niri/services/kanshi;
|
||||||
|
udiskie = {
|
||||||
|
enable = true;
|
||||||
|
automount = false;
|
||||||
|
notify = true;
|
||||||
|
tray = "auto";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.user.services = let
|
||||||
|
mkGraphicalService = config: lib.attrsets.recursiveUpdate 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 {
|
||||||
|
polkit-agent = mkGraphicalService {
|
||||||
|
Service = {
|
||||||
|
Type = "simple";
|
||||||
|
ExecStart = pkgs.mate.mate-polkit + "/libexec/polkit-mate-authentication-agent-1";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -5,5 +5,6 @@
|
|||||||
./shell
|
./shell
|
||||||
./terminal
|
./terminal
|
||||||
./syncthing.nix
|
./syncthing.nix
|
||||||
|
./wl-kbptr.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
28
modules/home/programs/wl-kbptr.nix
Normal file
28
modules/home/programs/wl-kbptr.nix
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.programs.wl-kbptr;
|
||||||
|
iniFormat = pkgs.formats.ini {listsAsDuplicateKeys = true;};
|
||||||
|
in {
|
||||||
|
options = {
|
||||||
|
programs.wl-kbptr = {
|
||||||
|
enable = mkEnableOption "enable niri desktop";
|
||||||
|
settings = mkOption {
|
||||||
|
inherit (iniFormat) type;
|
||||||
|
default = {};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
wl-kbptr
|
||||||
|
];
|
||||||
|
xdg.configFile."wl-kbptr/config" = mkIf (cfg.settings != {}) {
|
||||||
|
source = iniFormat.generate "wl-kbptr-config" cfg.settings;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -33,6 +33,8 @@ in {
|
|||||||
package = perSystem.niri.niri;
|
package = perSystem.niri.niri;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
systemd.user.services.niri-flake-polkit.enable = false;
|
||||||
|
|
||||||
programs.dankMaterialShell = {
|
programs.dankMaterialShell = {
|
||||||
enable = true;
|
enable = true;
|
||||||
greeter = {
|
greeter = {
|
||||||
|
|||||||
Reference in New Issue
Block a user