Skip to content

Commit 3bc248b

Browse files
authored
add niri DankMaterialShell profile (archlinux#4554)
1 parent af2120c commit 3bc248b

12 files changed

Lines changed: 676 additions & 1 deletion

File tree

archinstall/default_profiles/desktops/niri.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
class NiriProfile(Profile):
88
def __init__(self) -> None:
99
super().__init__(
10-
'Niri',
10+
'niri',
1111
ProfileType.WindowMgr,
1212
support_gfx_driver=True,
1313
display_server=DisplayServerType.Wayland,
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
import shutil
2+
from pathlib import Path
3+
from typing import TYPE_CHECKING, override
4+
5+
from archinstall.default_profiles.profile import DisplayServerType, GreeterType, Profile, ProfileType
6+
7+
if TYPE_CHECKING:
8+
from archinstall.lib.installer import Installer
9+
from archinstall.lib.models.users import User
10+
11+
12+
_TERMINAL = 'alacritty'
13+
_ASSETS_DIR = Path(__file__).parent / 'niri_dms_assets'
14+
15+
16+
class NiriDmsProfile(Profile):
17+
def __init__(self) -> None:
18+
super().__init__(
19+
'niri - DankMaterialShell',
20+
ProfileType.WindowMgr,
21+
support_gfx_driver=True,
22+
display_server=DisplayServerType.Wayland,
23+
)
24+
25+
@property
26+
@override
27+
def packages(self) -> list[str]:
28+
return [
29+
'niri',
30+
'dms-shell-niri',
31+
'polkit',
32+
'xdg-desktop-portal-gnome',
33+
'xorg-xwayland',
34+
'matugen',
35+
'cava',
36+
'kimageformats',
37+
'cups-pk-helper',
38+
'tuned-ppd',
39+
_TERMINAL,
40+
]
41+
42+
@property
43+
@override
44+
def default_greeter_type(self) -> GreeterType:
45+
return GreeterType.GreetdDms
46+
47+
@override
48+
def provision(self, install_session: Installer, users: list[User]) -> None:
49+
binds = (_ASSETS_DIR / 'dms/binds.kdl').read_text().replace('{{TERMINAL_COMMAND}}', _TERMINAL)
50+
51+
for user in users:
52+
home = install_session.target / 'home' / user.username
53+
niri_dir = home / '.config/niri'
54+
dms_dir = niri_dir / 'dms'
55+
dms_dir.mkdir(parents=True, exist_ok=True)
56+
57+
shutil.copy(_ASSETS_DIR / 'niri.kdl', niri_dir / 'config.kdl')
58+
for name in ('colors.kdl', 'layout.kdl', 'alttab.kdl', 'outputs.kdl', 'cursor.kdl'):
59+
shutil.copy(_ASSETS_DIR / 'dms' / name, dms_dir / name)
60+
(dms_dir / 'binds.kdl').write_text(binds)
61+
62+
niri_unit_dropin = home / '.config/systemd/user/niri.service.d'
63+
niri_unit_dropin.mkdir(parents=True, exist_ok=True)
64+
(niri_unit_dropin / 'dms.conf').write_text('[Unit]\nWants=dms.service\n')
65+
66+
install_session.arch_chroot(f'chown -R {user.username}:{user.username} /home/{user.username}/.config')
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// ! DO NOT EDIT !
2+
// ! AUTO-GENERATED BY DMS !
3+
// ! CHANGES WILL BE OVERWRITTEN !
4+
// ! PLACE YOUR CUSTOM CONFIGURATION ELSEWHERE !
5+
6+
recent-windows {
7+
highlight {
8+
corner-radius 12
9+
}
10+
}
Lines changed: 221 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,221 @@
1+
binds {
2+
// === System & Overview ===
3+
Mod+D repeat=false { toggle-overview; }
4+
Mod+Tab repeat=false { toggle-overview; }
5+
Mod+Shift+Slash { show-hotkey-overlay; }
6+
7+
// === Application Launchers ===
8+
Mod+T hotkey-overlay-title="Open Terminal" { spawn "{{TERMINAL_COMMAND}}"; }
9+
Mod+Space hotkey-overlay-title="Application Launcher" {
10+
spawn "dms" "ipc" "call" "spotlight" "toggle";
11+
}
12+
Mod+V hotkey-overlay-title="Clipboard Manager" {
13+
spawn "dms" "ipc" "call" "clipboard" "toggle";
14+
}
15+
Mod+M hotkey-overlay-title="Task Manager" {
16+
spawn "dms" "ipc" "call" "processlist" "focusOrToggle";
17+
}
18+
19+
Super+X hotkey-overlay-title="Power Menu: Toggle" { spawn "dms" "ipc" "call" "powermenu" "toggle"; }
20+
Mod+Comma hotkey-overlay-title="Settings" {
21+
spawn "dms" "ipc" "call" "settings" "focusOrToggle";
22+
}
23+
Mod+Y hotkey-overlay-title="Browse Wallpapers" {
24+
spawn "dms" "ipc" "call" "dankdash" "wallpaper";
25+
}
26+
Mod+N hotkey-overlay-title="Notification Center" { spawn "dms" "ipc" "call" "notifications" "toggle"; }
27+
Mod+Shift+N hotkey-overlay-title="Notepad" { spawn "dms" "ipc" "call" "notepad" "toggle"; }
28+
29+
// === Security ===
30+
Mod+Alt+L hotkey-overlay-title="Lock Screen" {
31+
spawn "dms" "ipc" "call" "lock" "lock";
32+
}
33+
Mod+Shift+E { quit; }
34+
Ctrl+Alt+Delete hotkey-overlay-title="Task Manager" {
35+
spawn "dms" "ipc" "call" "processlist" "focusOrToggle";
36+
}
37+
38+
// === Audio Controls ===
39+
XF86AudioRaiseVolume allow-when-locked=true {
40+
spawn "dms" "ipc" "call" "audio" "increment" "3";
41+
}
42+
XF86AudioLowerVolume allow-when-locked=true {
43+
spawn "dms" "ipc" "call" "audio" "decrement" "3";
44+
}
45+
XF86AudioMute allow-when-locked=true {
46+
spawn "dms" "ipc" "call" "audio" "mute";
47+
}
48+
XF86AudioMicMute allow-when-locked=true {
49+
spawn "dms" "ipc" "call" "audio" "micmute";
50+
}
51+
XF86AudioPause allow-when-locked=true {
52+
spawn "dms" "ipc" "call" "mpris" "playPause";
53+
}
54+
XF86AudioPlay allow-when-locked=true {
55+
spawn "dms" "ipc" "call" "mpris" "playPause";
56+
}
57+
XF86AudioPrev allow-when-locked=true {
58+
spawn "dms" "ipc" "call" "mpris" "previous";
59+
}
60+
XF86AudioNext allow-when-locked=true {
61+
spawn "dms" "ipc" "call" "mpris" "next";
62+
}
63+
Ctrl+XF86AudioRaiseVolume allow-when-locked=true {
64+
spawn "dms" "ipc" "call" "mpris" "increment" "3";
65+
}
66+
Ctrl+XF86AudioLowerVolume allow-when-locked=true {
67+
spawn "dms" "ipc" "call" "mpris" "decrement" "3";
68+
}
69+
70+
// === Brightness Controls ===
71+
XF86MonBrightnessUp allow-when-locked=true {
72+
spawn "dms" "ipc" "call" "brightness" "increment" "5" "";
73+
}
74+
XF86MonBrightnessDown allow-when-locked=true {
75+
spawn "dms" "ipc" "call" "brightness" "decrement" "5" "";
76+
}
77+
78+
// === Window Management ===
79+
Mod+Q repeat=false { close-window; }
80+
Mod+F { maximize-column; }
81+
Mod+Shift+F { fullscreen-window; }
82+
Mod+Shift+T { toggle-window-floating; }
83+
Mod+Shift+V { switch-focus-between-floating-and-tiling; }
84+
Mod+W { toggle-column-tabbed-display; }
85+
Mod+Shift+W hotkey-overlay-title="Create window rule" { spawn "dms" "ipc" "call" "window-rules" "toggle"; }
86+
87+
// === Focus Navigation ===
88+
Mod+Left { focus-column-left; }
89+
Mod+Down { focus-window-down; }
90+
Mod+Up { focus-window-up; }
91+
Mod+Right { focus-column-right; }
92+
Mod+H { focus-column-left; }
93+
Mod+J { focus-window-down; }
94+
Mod+K { focus-window-up; }
95+
Mod+L { focus-column-right; }
96+
97+
// === Window Movement ===
98+
Mod+Shift+Left { move-column-left; }
99+
Mod+Shift+Down { move-window-down; }
100+
Mod+Shift+Up { move-window-up; }
101+
Mod+Shift+Right { move-column-right; }
102+
Mod+Shift+H { move-column-left; }
103+
Mod+Shift+J { move-window-down; }
104+
Mod+Shift+K { move-window-up; }
105+
Mod+Shift+L { move-column-right; }
106+
107+
// === Column Navigation ===
108+
Mod+Home { focus-column-first; }
109+
Mod+End { focus-column-last; }
110+
Mod+Ctrl+Home { move-column-to-first; }
111+
Mod+Ctrl+End { move-column-to-last; }
112+
113+
// === Monitor Navigation ===
114+
Mod+Ctrl+Left { focus-monitor-left; }
115+
//Mod+Ctrl+Down { focus-monitor-down; }
116+
//Mod+Ctrl+Up { focus-monitor-up; }
117+
Mod+Ctrl+Right { focus-monitor-right; }
118+
Mod+Ctrl+H { focus-monitor-left; }
119+
Mod+Ctrl+J { focus-monitor-down; }
120+
Mod+Ctrl+K { focus-monitor-up; }
121+
Mod+Ctrl+L { focus-monitor-right; }
122+
123+
// === Move to Monitor ===
124+
Mod+Shift+Ctrl+Left { move-column-to-monitor-left; }
125+
Mod+Shift+Ctrl+Down { move-column-to-monitor-down; }
126+
Mod+Shift+Ctrl+Up { move-column-to-monitor-up; }
127+
Mod+Shift+Ctrl+Right { move-column-to-monitor-right; }
128+
Mod+Shift+Ctrl+H { move-column-to-monitor-left; }
129+
Mod+Shift+Ctrl+J { move-column-to-monitor-down; }
130+
Mod+Shift+Ctrl+K { move-column-to-monitor-up; }
131+
Mod+Shift+Ctrl+L { move-column-to-monitor-right; }
132+
133+
// === Workspace Navigation ===
134+
Mod+Page_Down { focus-workspace-down; }
135+
Mod+Page_Up { focus-workspace-up; }
136+
Mod+U { focus-workspace-down; }
137+
Mod+I { focus-workspace-up; }
138+
Mod+Ctrl+Down { move-column-to-workspace-down; }
139+
Mod+Ctrl+Up { move-column-to-workspace-up; }
140+
Mod+Ctrl+U { move-column-to-workspace-down; }
141+
Mod+Ctrl+I { move-column-to-workspace-up; }
142+
143+
// === Workspace Management ===
144+
Ctrl+Shift+R hotkey-overlay-title="Rename Workspace" {
145+
spawn "dms" "ipc" "call" "workspace-rename" "open";
146+
}
147+
148+
// === Move Workspaces ===
149+
Mod+Shift+Page_Down { move-workspace-down; }
150+
Mod+Shift+Page_Up { move-workspace-up; }
151+
Mod+Shift+U { move-workspace-down; }
152+
Mod+Shift+I { move-workspace-up; }
153+
154+
// === Mouse Wheel Navigation ===
155+
Mod+WheelScrollDown cooldown-ms=150 { focus-workspace-down; }
156+
Mod+WheelScrollUp cooldown-ms=150 { focus-workspace-up; }
157+
Mod+Ctrl+WheelScrollDown cooldown-ms=150 { move-column-to-workspace-down; }
158+
Mod+Ctrl+WheelScrollUp cooldown-ms=150 { move-column-to-workspace-up; }
159+
160+
Mod+WheelScrollRight { focus-column-right; }
161+
Mod+WheelScrollLeft { focus-column-left; }
162+
Mod+Ctrl+WheelScrollRight { move-column-right; }
163+
Mod+Ctrl+WheelScrollLeft { move-column-left; }
164+
165+
Mod+Shift+WheelScrollDown { focus-column-right; }
166+
Mod+Shift+WheelScrollUp { focus-column-left; }
167+
Mod+Ctrl+Shift+WheelScrollDown { move-column-right; }
168+
Mod+Ctrl+Shift+WheelScrollUp { move-column-left; }
169+
170+
// === Numbered Workspaces ===
171+
Mod+1 { focus-workspace 1; }
172+
Mod+2 { focus-workspace 2; }
173+
Mod+3 { focus-workspace 3; }
174+
Mod+4 { focus-workspace 4; }
175+
Mod+5 { focus-workspace 5; }
176+
Mod+6 { focus-workspace 6; }
177+
Mod+7 { focus-workspace 7; }
178+
Mod+8 { focus-workspace 8; }
179+
Mod+9 { focus-workspace 9; }
180+
181+
// === Move to Numbered Workspaces ===
182+
Mod+Shift+1 { move-column-to-workspace 1; }
183+
Mod+Shift+2 { move-column-to-workspace 2; }
184+
Mod+Shift+3 { move-column-to-workspace 3; }
185+
Mod+Shift+4 { move-column-to-workspace 4; }
186+
Mod+Shift+5 { move-column-to-workspace 5; }
187+
Mod+Shift+6 { move-column-to-workspace 6; }
188+
Mod+Shift+7 { move-column-to-workspace 7; }
189+
Mod+Shift+8 { move-column-to-workspace 8; }
190+
Mod+Shift+9 { move-column-to-workspace 9; }
191+
192+
// === Column Management ===
193+
Mod+BracketLeft { consume-or-expel-window-left; }
194+
Mod+BracketRight { consume-or-expel-window-right; }
195+
Mod+Period { expel-window-from-column; }
196+
197+
// === Sizing & Layout ===
198+
Mod+R { switch-preset-column-width; }
199+
Mod+Shift+R { switch-preset-window-height; }
200+
Mod+Ctrl+R { reset-window-height; }
201+
Mod+Ctrl+F { expand-column-to-available-width; }
202+
Mod+C { center-column; }
203+
Mod+Ctrl+C { center-visible-columns; }
204+
205+
// === Manual Sizing ===
206+
Mod+Minus { set-column-width "-10%"; }
207+
Mod+Equal { set-column-width "+10%"; }
208+
Mod+Shift+Minus { set-window-height "-10%"; }
209+
Mod+Shift+Equal { set-window-height "+10%"; }
210+
211+
// === Screenshots ===
212+
XF86Launch1 { screenshot; }
213+
Ctrl+XF86Launch1 { screenshot-screen; }
214+
Alt+XF86Launch1 { screenshot-window; }
215+
Print { screenshot; }
216+
Ctrl+Print { screenshot-screen; }
217+
Alt+Print { screenshot-window; }
218+
// === System Controls ===
219+
Mod+Escape allow-inhibiting=false { toggle-keyboard-shortcuts-inhibit; }
220+
Mod+Shift+P { power-off-monitors; }
221+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// ! Auto-generated file. Do not edit directly.
2+
// Remove `include "dms/colors.kdl"` from your config to override.
3+
4+
layout {
5+
background-color "transparent"
6+
7+
focus-ring {
8+
active-color "#d0bcff"
9+
inactive-color "#948f99"
10+
urgent-color "#f2b8b5"
11+
}
12+
13+
border {
14+
active-color "#d0bcff"
15+
inactive-color "#948f99"
16+
urgent-color "#f2b8b5"
17+
}
18+
19+
shadow {
20+
color "#00000070"
21+
}
22+
23+
tab-indicator {
24+
active-color "#d0bcff"
25+
inactive-color "#948f99"
26+
urgent-color "#f2b8b5"
27+
}
28+
29+
insert-hint {
30+
color "#d0bcff80"
31+
}
32+
}
33+
34+
recent-windows {
35+
highlight {
36+
active-color "#4f378b"
37+
urgent-color "#f2b8b5"
38+
}
39+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// Place cursor configuration here.
2+
// Example:
3+
// cursor {
4+
// xcursor-theme "Adwaita"
5+
// xcursor-size 24
6+
// }
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// ! DO NOT EDIT !
2+
// ! AUTO-GENERATED BY DMS !
3+
// ! CHANGES WILL BE OVERWRITTEN !
4+
// ! PLACE YOUR CUSTOM CONFIGURATION ELSEWHERE !
5+
6+
layout {
7+
gaps 4
8+
9+
border {
10+
width 2
11+
}
12+
13+
focus-ring {
14+
width 2
15+
}
16+
}
17+
window-rule {
18+
geometry-corner-radius 12
19+
clip-to-geometry true
20+
tiled-state true
21+
draw-border-with-background false
22+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// Place per-output configuration here.
2+
// Example:
3+
// output "DP-1" {
4+
// mode "2560x1440@165"
5+
// position x=0 y=0
6+
// scale 1
7+
// }

0 commit comments

Comments
 (0)