home/dms: split the config
This commit is contained in:
7
modules/home/desktop/dms/config/dconf.nix
Normal file
7
modules/home/desktop/dms/config/dconf.nix
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
dconf.settings = {
|
||||
"org/gnome/desktop/wm/preferences" = {
|
||||
button-layout = "icon:maximize,close";
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -5,10 +5,12 @@
|
||||
...
|
||||
}: {
|
||||
home.packages = with pkgs; [
|
||||
browsers # app chooser in rust (and without bugs)
|
||||
celluloid # mpv gui in libadwaita
|
||||
file-roller # archive manager
|
||||
gnome-text-editor
|
||||
helvum # pipewire patchbay in rust
|
||||
junction # app chooser
|
||||
# junction # app chooser
|
||||
loupe # image viewer and editor in rust
|
||||
nautilus # file manager
|
||||
papers # pdf reader in rust
|
||||
@@ -19,14 +21,21 @@
|
||||
mimeApps = {
|
||||
enable = true;
|
||||
defaultApplications = let
|
||||
archive_manager = ["org.gnome.FileRoller.desktop"];
|
||||
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"];
|
||||
web_browser = ["software.Browsers.desktop"];
|
||||
in {
|
||||
# TODO: add text/ mimetypes for gnome-editor
|
||||
"application/pdf" = pdf_reader;
|
||||
"application/vnd.rar" = archive_manager;
|
||||
"application/x-7z-compressed" = archive_manager;
|
||||
"application/x-bzip2-compressed-tar" = archive_manager;
|
||||
"application/x-compressed-tar" = archive_manager;
|
||||
"application/x-xz-compressed-tar" = archive_manager;
|
||||
"application/zip" = archive_manager;
|
||||
"image/jpeg" = image_viewer;
|
||||
"image/png" = image_viewer;
|
||||
"inode/directory" = file_manager;
|
||||
9
modules/home/desktop/dms/config/packages.nix
Normal file
9
modules/home/desktop/dms/config/packages.nix
Normal file
@@ -0,0 +1,9 @@
|
||||
{pkgs, ...}: {
|
||||
home.packages = with pkgs; [
|
||||
# gui libadwaita utilities
|
||||
helvum # pipewire patchbay in rust
|
||||
pwvucontrol # pipewire gui in rust
|
||||
wdisplays # wlroots display configurator
|
||||
wl-clipboard
|
||||
];
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
perSystem,
|
||||
...
|
||||
}:
|
||||
@@ -41,6 +42,7 @@ with lib; let
|
||||
in {
|
||||
programs.niri.settings = {
|
||||
environment = {
|
||||
DMS_SCREENSHOT_EDITOR = "satty";
|
||||
ELECTRON_OZONE_PLATFORM_HINT = "auto";
|
||||
QT_QPA_PLATFORM = "wayland";
|
||||
QT_QPA_PLATFORMTHEME = "gtk3";
|
||||
@@ -78,7 +80,7 @@ in {
|
||||
clipboard.disable-primary = true;
|
||||
hotkey-overlay.skip-at-startup = true;
|
||||
prefer-no-csd = true;
|
||||
xwayland-satellite.path = lib.getExe perSystem.xwst.xwayland-satellite;
|
||||
xwayland-satellite.path = lib.getExe perSystem.niri-flake.xwayland-satellite-unstable;
|
||||
|
||||
overview.workspace-shadow.enable = false;
|
||||
# TODO: enable when implemented in github:sodiboo/niri-flake
|
||||
@@ -129,6 +131,27 @@ in {
|
||||
binds = with config.lib.niri.actions; let
|
||||
dms-ipc = spawn "dms" "ipc";
|
||||
sh = spawn "sh" "-c";
|
||||
focus = spawn "wlrctl" "window" "focus";
|
||||
focus-meet = pkgs.writeShellApplication {
|
||||
name = "focus-zen-google-meet";
|
||||
runtimeInputs = with pkgs; [wlrctl jq gnugrep config.programs.niri.package];
|
||||
text = ''
|
||||
wlrctl window focus app_id:app.zen_browser.zen \
|
||||
title:"$(niri msg --json windows \
|
||||
| jq -r '.[].title' \
|
||||
| grep -E 'Meet: "[a-zA-Z0-9-]+?"')"
|
||||
'';
|
||||
};
|
||||
focus-equicord = pkgs.writeShellApplication {
|
||||
name = "focus-equicord";
|
||||
runtimeInputs = with pkgs; [wlrctl jq gnugrep config.programs.niri.package];
|
||||
text = ''
|
||||
wlrctl window focus app_id:equibop \
|
||||
title:"$(niri msg --json windows \
|
||||
| jq -r '.[].title' \
|
||||
| grep -E 'Meet: "[a-zA-Z0-9-]+?"')"
|
||||
'';
|
||||
};
|
||||
in
|
||||
lib.attrsets.mergeAttrsList [
|
||||
{
|
||||
@@ -139,20 +162,19 @@ in {
|
||||
|
||||
"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+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+F".action = toggle-window-floating;
|
||||
|
||||
"Mod+Ctrl+Comma".action = consume-or-expel-window-left;
|
||||
"Mod+Ctrl+Period".action = consume-or-expel-window-right;
|
||||
@@ -179,6 +201,13 @@ in {
|
||||
"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";
|
||||
|
||||
"Super+Alt+G".action = spawn "${lib.getExe focus-meet}";
|
||||
"Super+Alt+G".hotkey-overlay.title = "Focus Google Meet";
|
||||
"Super+Alt+U".action = focus "app.zen_browser.zen" "state:inactive";
|
||||
"Super+Alt+B".action = focus "io.github.ungoogled_software.ungoogled_chromium" "state:inactive";
|
||||
"Super+Alt+D".action = focus "equibop";
|
||||
"Super+Alt+T".action = focus "io.github.kukuruzka165.materialgram";
|
||||
|
||||
"Mod+D" = {
|
||||
action = spawn "vicinae" "toggle";
|
||||
hotkey-overlay.title = "Toggle Application Launcher";
|
||||
@@ -337,11 +366,20 @@ in {
|
||||
];
|
||||
open-floating = true;
|
||||
}
|
||||
# {
|
||||
# matches = [
|
||||
# {
|
||||
# # telegram's picture-in-picture mode
|
||||
# app-id = "io.github.kukuruzka165.materialgram";
|
||||
# title = "materialgram";
|
||||
# }
|
||||
# ];
|
||||
# }
|
||||
{
|
||||
matches = [
|
||||
{app-id = "re.sonny.Junction";}
|
||||
{app-id = "com.github.hluk.copyq";}
|
||||
{title = "r\"^.* - Choose User Profile$\"";}
|
||||
{title = "Zen - Choose User Profile";}
|
||||
];
|
||||
open-floating = true;
|
||||
open-focused = true;
|
||||
@@ -364,7 +402,7 @@ in {
|
||||
{app-id = "Alacritty";}
|
||||
{app-id = "com.mitchellh.ghostty";}
|
||||
{app-id = "org.wezfurlong.wezterm";}
|
||||
{app-id = "zen";}
|
||||
{app-id = "app.zen_browser.zen";}
|
||||
];
|
||||
# default-column-width = {proportion = 1.0;};
|
||||
draw-border-with-background = false;
|
||||
3
modules/home/desktop/dms/config/programs/satty.nix
Normal file
3
modules/home/desktop/dms/config/programs/satty.nix
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
programs.satty.enable = true;
|
||||
}
|
||||
@@ -15,6 +15,7 @@
|
||||
label_symbols = "abcdefghijklmnopqrstuvwxyz";
|
||||
};
|
||||
mode_tile = {
|
||||
label_font_size = "8 50% 100";
|
||||
inherit
|
||||
(mode_floating)
|
||||
label_color
|
||||
@@ -25,7 +26,6 @@
|
||||
label_font_family
|
||||
label_symbols
|
||||
;
|
||||
label_font_size = "8 50% 100";
|
||||
};
|
||||
mode_bisect = {
|
||||
inherit (mode_floating) label_color unselectable_bg_color label_font_family;
|
||||
@@ -9,7 +9,7 @@
|
||||
enable = true;
|
||||
components = ["secrets"];
|
||||
};
|
||||
kanshi = import ../niri/services/kanshi;
|
||||
kanshi = import ../../niri/services/kanshi;
|
||||
udiskie = {
|
||||
enable = true;
|
||||
automount = false;
|
||||
58
modules/home/desktop/dms/config/stylix.nix
Normal file
58
modules/home/desktop/dms/config/stylix.nix
Normal file
@@ -0,0 +1,58 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
# dconf.settings = {
|
||||
# "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";
|
||||
# };
|
||||
# };
|
||||
|
||||
# stylix.targets.niri.enable = false;
|
||||
|
||||
# stylix.targets.gtk.enable = false;
|
||||
# gtk = {
|
||||
# enable = true;
|
||||
# theme = {
|
||||
# name = "adw-gtk3";
|
||||
# package = pkgs.adw-gtk3;
|
||||
# };
|
||||
# };
|
||||
#
|
||||
|
||||
stylix.targets.qt.enable = false;
|
||||
qt = {
|
||||
enable = true;
|
||||
platformTheme.name = "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;
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
{
|
||||
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";
|
||||
# };
|
||||
};
|
||||
}
|
||||
@@ -10,83 +10,16 @@ with lib; let
|
||||
cfg = config.desktop.dms;
|
||||
# inherit (config.lib.stylix) colors;
|
||||
in {
|
||||
imports = [
|
||||
# inputs.niri.homeModules.niri
|
||||
inputs.dankMaterialShell.homeModules.dankMaterialShell.default
|
||||
inputs.dankMaterialShell.homeModules.dankMaterialShell.niri
|
||||
imports = with inputs; [
|
||||
dms.homeModules.dankMaterialShell.default
|
||||
dms.homeModules.dankMaterialShell.niri
|
||||
];
|
||||
options = {
|
||||
desktop.dms.enable =
|
||||
mkEnableOption "enable DankMaterialShell";
|
||||
};
|
||||
config = let
|
||||
importWithArgs = file: import file {inherit config inputs lib perSystem pkgs;};
|
||||
importWithArgs = file: import file {inherit config inputs lib perSystem pkgs importWithArgs;};
|
||||
in
|
||||
mkIf cfg.enable (mkMerge [
|
||||
(import ./dconf.nix)
|
||||
(importWithArgs ./mimeapps.nix)
|
||||
(importWithArgs ./programs/niri.nix)
|
||||
(importWithArgs ./programs/wl-kbptr.nix)
|
||||
(importWithArgs ./services.nix)
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
# gui libadwaita utilities
|
||||
helvum # pipewire patchbay in rust
|
||||
pwvucontrol # pipewire gui in rust
|
||||
wdisplays # wlroots display configurator
|
||||
];
|
||||
}
|
||||
{
|
||||
# stylix.targets.niri.enable = false;
|
||||
|
||||
# stylix.targets.gtk.enable = false;
|
||||
# gtk = {
|
||||
# enable = true;
|
||||
# theme = {
|
||||
# name = "adw-gtk3";
|
||||
# package = pkgs.adw-gtk3;
|
||||
# };
|
||||
# };
|
||||
#
|
||||
|
||||
stylix.targets.qt.enable = false;
|
||||
qt = {
|
||||
enable = true;
|
||||
platformTheme.name = "gtk3";
|
||||
};
|
||||
}
|
||||
{
|
||||
programs.dankMaterialShell = {
|
||||
enable = true;
|
||||
systemd.enable = true;
|
||||
niri.enableKeybinds = false; # Automatic keybinding configuration
|
||||
# niri.enableSpawn = true; # Auto-start DMS with niri
|
||||
};
|
||||
}
|
||||
{
|
||||
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;
|
||||
}
|
||||
);
|
||||
}
|
||||
]);
|
||||
mkIf cfg.enable (importWithArgs ./config);
|
||||
}
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
imports = [
|
||||
./niri.nix
|
||||
./wl-kbptr.nix
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user