Add Niri, a scrolling tiling window manager.
This commit is contained in:
parent
325c176464
commit
b3d9d2f396
38 changed files with 758 additions and 376 deletions
23
modules/home/wms/niri/autostart/default.nix
Normal file
23
modules/home/wms/niri/autostart/default.nix
Normal file
|
@ -0,0 +1,23 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
config.home.niri.settings.autostart = pkgs.writeText "autostart" ''
|
||||
// Everpresent bar
|
||||
spawn-at-startup "waybar"
|
||||
|
||||
// Daemons and tray apps
|
||||
spawn-at-startup "hyprpaper"
|
||||
spawn-at-startup "wl-paste" "-t" "text --watch clipman store -P"
|
||||
spawn-at-startup "wl-copy"
|
||||
spawn-at-startup "mako"
|
||||
spawn-at-startup "sunshine"
|
||||
spawn-at-startup "${pkgs.mate.mate-polkit}/libexec/polkit-mate-authentication-agent-1"
|
||||
spawn-at-startup "${pkgs.xwayland-satellite}/bin/xwayland-satellite"
|
||||
|
||||
// Foreground apps
|
||||
spawn-at-startup "librewolf" "-p" "Misc" "--name" "MiscBrowser"
|
||||
spawn-at-startup "vesktop"
|
||||
spawn-at-startup "fractal"
|
||||
spawn-at-startup "telegram-desktop"
|
||||
spawn-at-startup "thunderbird"
|
||||
'';
|
||||
}
|
22
modules/home/wms/niri/default.nix
Normal file
22
modules/home/wms/niri/default.nix
Normal file
|
@ -0,0 +1,22 @@
|
|||
{ config, ... }:
|
||||
{
|
||||
imports = [
|
||||
./autostart
|
||||
./hotkeys
|
||||
./inputs
|
||||
./outputs
|
||||
./rules
|
||||
./settings
|
||||
./theme
|
||||
];
|
||||
|
||||
home.file.".config/niri/config.kdl".text = ''
|
||||
${builtins.readFile config.home.niri.settings.autostart}
|
||||
${builtins.readFile config.home.niri.settings.hotkeys}
|
||||
${builtins.readFile config.home.niri.settings.inputs}
|
||||
${builtins.readFile config.home.niri.settings.outputs}
|
||||
${builtins.readFile config.home.niri.settings.rules}
|
||||
${builtins.readFile config.home.niri.settings.settings}
|
||||
${builtins.readFile config.home.niri.settings.theme}
|
||||
'';
|
||||
}
|
151
modules/home/wms/niri/hotkeys/default.nix
Normal file
151
modules/home/wms/niri/hotkeys/default.nix
Normal file
|
@ -0,0 +1,151 @@
|
|||
{ pkgs, config, ... }:
|
||||
{
|
||||
config.home.niri.settings.hotkeys = let
|
||||
primeMod = "Mod";
|
||||
secMod = "Alt";
|
||||
resizeAmount = "5";
|
||||
in pkgs.writeText "hotkeys" ''
|
||||
binds {
|
||||
//// Launchers
|
||||
|
||||
// Browser
|
||||
${primeMod}+F1 { spawn "sh" "-c" "librewolf -p Main --name MainBrowser | notify-send \"Main Browser\""; }
|
||||
${primeMod}+F2 { spawn "sh" "-c" "librewolf -p Alt --name AltBrowser | notify-send \"Alternate Browser\""; }
|
||||
${primeMod}+F3 { spawn "sh" "-c" "librewolf -p Misc --name MiscBrowser | notify-send \"Miscellaneous Browser\""; }
|
||||
|
||||
// Virtual machines
|
||||
${primeMod}+F4 { spawn "sh" "-c" "virt-manager | notify-send \"Virtual Machines\""; }
|
||||
${primeMod}+F5 { spawn "sh" "-c" "looking-glass-client input:rawMouse=yes | notify-send \"Looking Glass\""; }
|
||||
|
||||
// ${primeMod} + key
|
||||
${primeMod}+s { spawn "sh" "-c" "rofi -show run -p Command"; }
|
||||
${primeMod}+c { spawn "sh" "-c" "clipman pick -t rofi"; }
|
||||
${primeMod}+x { spawn "sh" "-c" "rofiscripts --power"; }
|
||||
${primeMod}+b { spawn "sh" "-c" "pkill -USR1 waybar"; }
|
||||
${primeMod}+Return { spawn "sh" "-c" "foot"; }
|
||||
|
||||
// ${primeMod} + shift + key
|
||||
${primeMod}+Shift+s { spawn "sh" "-c" "rofi -show drun -modi drun -drun-display-format {name} -show-icons -disable-history"; }
|
||||
${primeMod}+Shift+t { spawn "sh" "-c" "pcmanfm"; }
|
||||
${primeMod}+Shift+e { spawn "sh" "-c" "bemoji -n -P 0"; }
|
||||
${primeMod}+Shift+b { spawn "sh" "-c" "rofi-bluetooth"; }
|
||||
${primeMod}+Shift+Return { spawn "sh" "-c" "foot ranger"; }
|
||||
|
||||
// ${primeMod} + ctrl + key
|
||||
${primeMod}+Ctrl+s { spawn "sh" "-c" "rofiscripts --scratchpads"; }
|
||||
${primeMod}+Ctrl+c { spawn "sh" "-c" "wlpicker && notify-send \"Color copied to clipboard\""; }
|
||||
|
||||
//// Media
|
||||
|
||||
// Volume
|
||||
${secMod}+j { spawn "sh" "-c" "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"; }
|
||||
${secMod}+k { spawn "sh" "-c" "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+"; }
|
||||
|
||||
// MPD
|
||||
${primeMod}+Backslash { spawn "sh" "-c" "mpc toggle"; }
|
||||
${secMod}+Shift+h { spawn "sh" "-c" "mpc prev"; }
|
||||
${secMod}+Shift+j { spawn "sh" "-c" "mpc volume -3"; }
|
||||
${secMod}+Shift+k { spawn "sh" "-c" "mpc volume +3"; }
|
||||
${secMod}+Shift+l { spawn "sh" "-c" "mpc next"; }
|
||||
|
||||
//// Miscellaneous
|
||||
|
||||
// Notifications
|
||||
${primeMod}+n { spawn "sh" "-c" "makotoggle"; }
|
||||
${primeMod}+Shift+n { spawn "sh" "-c" "makoctl restore"; }
|
||||
${primeMod}+Ctrl+n { spawn "sh" "-c" "makoctl dismiss -a"; }
|
||||
|
||||
// Screenshots
|
||||
${secMod}+F { screenshot; }
|
||||
${secMod}+Shift+F { screenshot-screen; }
|
||||
${secMod}+Ctrl+F { screenshot-window; }
|
||||
|
||||
// Display and keyboard brightness
|
||||
${primeMod}+equal { spawn "sh" "-c" "light -A 5"; }
|
||||
${primeMod}+minus { spawn "sh" "-c" "light -U 5"; }
|
||||
${primeMod}+Shift+equal { spawn "sh" "-c" "light -A 1"; }
|
||||
${primeMod}+Shift+minus { spawn "sh" "-c" "light -U 1"; }
|
||||
XF86KbdBrightnessUp { spawn "sh" "-c" "light -s sysfs/leds/smc::kbd_backlight -A 5"; }
|
||||
XF86KbdBrightnessDown { spawn "sh" "-c" "light -s sysfs/leds/smc::kbd_backlight -U 5"; }
|
||||
|
||||
//// Window manager
|
||||
${primeMod}+q { close-window; }
|
||||
|
||||
// Switch to workspaces
|
||||
${primeMod}+grave { focus-workspace "${config.ws.w0}"; }
|
||||
${primeMod}+1 { focus-workspace "${config.ws.w1}"; }
|
||||
${primeMod}+2 { focus-workspace "${config.ws.w2}"; }
|
||||
${primeMod}+3 { focus-workspace "${config.ws.w3}"; }
|
||||
${primeMod}+4 { focus-workspace "${config.ws.w4}"; }
|
||||
${primeMod}+5 { focus-workspace "${config.ws.w5}"; }
|
||||
${primeMod}+6 { focus-workspace "${config.ws.w6}"; }
|
||||
${primeMod}+7 { focus-workspace "${config.ws.w7}"; }
|
||||
${primeMod}+8 { focus-workspace "${config.ws.w8}"; }
|
||||
${primeMod}+9 { focus-workspace "${config.ws.w9}"; }
|
||||
|
||||
// Switch to alternate workspaces
|
||||
${secMod}+F1 { focus-workspace "${config.ws.w1a}"; }
|
||||
${secMod}+F2 { focus-workspace "${config.ws.w2a}"; }
|
||||
${secMod}+F3 { focus-workspace "${config.ws.w3a}"; }
|
||||
${secMod}+F4 { focus-workspace "${config.ws.w4a}"; }
|
||||
${secMod}+F5 { focus-workspace "${config.ws.w5a}"; }
|
||||
${secMod}+F6 { focus-workspace "${config.ws.w6a}"; }
|
||||
${secMod}+F7 { focus-workspace "${config.ws.w7a}"; }
|
||||
${secMod}+F8 { focus-workspace "${config.ws.w8a}"; }
|
||||
${secMod}+F9 { focus-workspace "${config.ws.w9a}"; }
|
||||
|
||||
// Move window to and focus workspace
|
||||
${primeMod}+Shift+grave { move-window-to-workspace "${config.ws.w0}"; }
|
||||
${primeMod}+Shift+1 { move-window-to-workspace "${config.ws.w1}"; }
|
||||
${primeMod}+Shift+2 { move-window-to-workspace "${config.ws.w2}"; }
|
||||
${primeMod}+Shift+3 { move-window-to-workspace "${config.ws.w3}"; }
|
||||
${primeMod}+Shift+4 { move-window-to-workspace "${config.ws.w4}"; }
|
||||
${primeMod}+Shift+5 { move-window-to-workspace "${config.ws.w5}"; }
|
||||
${primeMod}+Shift+6 { move-window-to-workspace "${config.ws.w6}"; }
|
||||
${primeMod}+Shift+7 { move-window-to-workspace "${config.ws.w7}"; }
|
||||
${primeMod}+Shift+8 { move-window-to-workspace "${config.ws.w8}"; }
|
||||
${primeMod}+Shift+9 { move-window-to-workspace "${config.ws.w9}"; }
|
||||
|
||||
// Move window to and focus workspace
|
||||
${secMod}+Shift+F1 { move-window-to-workspace "${config.ws.w1a}"; }
|
||||
${secMod}+Shift+F2 { move-window-to-workspace "${config.ws.w2a}"; }
|
||||
${secMod}+Shift+F3 { move-window-to-workspace "${config.ws.w3a}"; }
|
||||
${secMod}+Shift+F4 { move-window-to-workspace "${config.ws.w4a}"; }
|
||||
${secMod}+Shift+F5 { move-window-to-workspace "${config.ws.w5a}"; }
|
||||
${secMod}+Shift+F6 { move-window-to-workspace "${config.ws.w6a}"; }
|
||||
${secMod}+Shift+F7 { move-window-to-workspace "${config.ws.w7a}"; }
|
||||
${secMod}+Shift+F8 { move-window-to-workspace "${config.ws.w8a}"; }
|
||||
${secMod}+Shift+F9 { move-window-to-workspace "${config.ws.w9a}"; }
|
||||
|
||||
// Change focused window
|
||||
${primeMod}+h { focus-column-or-monitor-left; }
|
||||
${primeMod}+j { focus-window-down; }
|
||||
${primeMod}+k { focus-window-up; }
|
||||
${primeMod}+l { focus-column-or-monitor-right; }
|
||||
|
||||
// Move focused window
|
||||
${primeMod}+Shift+h { move-column-left-or-to-monitor-left; }
|
||||
${primeMod}+Shift+j { move-window-down; }
|
||||
${primeMod}+Shift+k { move-window-up; }
|
||||
${primeMod}+Shift+l { move-column-right-or-to-monitor-right; }
|
||||
|
||||
// Resize window
|
||||
${primeMod}+${secMod}+h { set-column-width "-${resizeAmount}%"; }
|
||||
${primeMod}+${secMod}+j { set-window-height "-${resizeAmount}%"; }
|
||||
${primeMod}+${secMod}+k { set-window-height "+${resizeAmount}%"; }
|
||||
${primeMod}+${secMod}+l { set-column-width "+${resizeAmount}%"; }
|
||||
|
||||
// There are also commands that consume or expel a single window to the side.
|
||||
${primeMod}+Ctrl+h { consume-or-expel-window-left; }
|
||||
${primeMod}+Ctrl+l { consume-or-expel-window-right; }
|
||||
|
||||
// Toggle fullscreen
|
||||
${primeMod}+f { maximize-column; }
|
||||
${primeMod}+Shift+f { fullscreen-window; }
|
||||
|
||||
// Niri specific
|
||||
${primeMod}+Shift+r { reset-window-height; }
|
||||
${primeMod}+Shift+c { center-column; }
|
||||
}
|
||||
'';
|
||||
}
|
20
modules/home/wms/niri/inputs/default.nix
Normal file
20
modules/home/wms/niri/inputs/default.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
config.home.niri.settings.inputs = pkgs.writeText "inputs" ''
|
||||
input {
|
||||
mouse {
|
||||
accel-profile "flat"
|
||||
accel-speed -0.9
|
||||
}
|
||||
touchpad {
|
||||
accel-profile "flat"
|
||||
scroll-method "two-finger"
|
||||
}
|
||||
trackpoint {
|
||||
off
|
||||
}
|
||||
warp-mouse-to-focus
|
||||
focus-follows-mouse
|
||||
}
|
||||
'';
|
||||
}
|
88
modules/home/wms/niri/outputs/default.nix
Normal file
88
modules/home/wms/niri/outputs/default.nix
Normal file
|
@ -0,0 +1,88 @@
|
|||
{ config, pkgs, ... }:
|
||||
{
|
||||
config.home.niri.settings.outputs = pkgs.writeText "outputs" ''
|
||||
// Workspace 1
|
||||
workspace "${config.ws.w0}" {
|
||||
open-on-output "${config.displays.d1}"
|
||||
}
|
||||
workspace "${config.ws.w1}" {
|
||||
open-on-output "${config.displays.d1}"
|
||||
}
|
||||
workspace "${config.ws.w2}" {
|
||||
open-on-output "${config.displays.d1}"
|
||||
}
|
||||
workspace "${config.ws.w3}" {
|
||||
open-on-output "${config.displays.d1}"
|
||||
}
|
||||
workspace "${config.ws.w1a}" {
|
||||
open-on-output "${config.displays.d1}"
|
||||
}
|
||||
workspace "${config.ws.w2a}" {
|
||||
open-on-output "${config.displays.d1}"
|
||||
}
|
||||
workspace "${config.ws.w3a}" {
|
||||
open-on-output "${config.displays.d1}"
|
||||
}
|
||||
|
||||
// Workspace 2
|
||||
workspace "${config.ws.w4}" {
|
||||
open-on-output "${config.displays.d2}"
|
||||
}
|
||||
workspace "${config.ws.w5}" {
|
||||
open-on-output "${config.displays.d2}"
|
||||
}
|
||||
workspace "${config.ws.w6}" {
|
||||
open-on-output "${config.displays.d2}"
|
||||
}
|
||||
workspace "${config.ws.w4a}" {
|
||||
open-on-output "${config.displays.d2}"
|
||||
}
|
||||
workspace "${config.ws.w5a}" {
|
||||
open-on-output "${config.displays.d2}"
|
||||
}
|
||||
|
||||
// Workspace 3
|
||||
workspace "${config.ws.w7}" {
|
||||
open-on-output "${config.displays.d3}"
|
||||
}
|
||||
workspace "${config.ws.w8}" {
|
||||
open-on-output "${config.displays.d3}"
|
||||
}
|
||||
workspace "${config.ws.w9}" {
|
||||
open-on-output "${config.displays.d3}"
|
||||
}
|
||||
workspace "${config.ws.w7a}" {
|
||||
open-on-output "${config.displays.d3}"
|
||||
}
|
||||
workspace "${config.ws.w8a}" {
|
||||
open-on-output "${config.displays.d3}"
|
||||
}
|
||||
|
||||
// Workspace 4
|
||||
workspace "${config.ws.w6a}" {
|
||||
open-on-output "${config.displays.d4}"
|
||||
}
|
||||
workspace "${config.ws.w9a}" {
|
||||
open-on-output "${config.displays.d4}"
|
||||
}
|
||||
|
||||
// Monitors
|
||||
output "${config.displays.d1}" {
|
||||
mode "1920x1080@143.980"
|
||||
position x=3840 y=405
|
||||
}
|
||||
output "${config.displays.d2}" {
|
||||
mode "1920x1080@60"
|
||||
position x=1920 y=405
|
||||
}
|
||||
output "${config.displays.d3}" {
|
||||
mode "1680x1050@59.883"
|
||||
transform "90"
|
||||
position x=5760 y=0
|
||||
}
|
||||
output "${config.displays.d4}" {
|
||||
mode "1920x1080@60"
|
||||
position x=0 y=405
|
||||
}
|
||||
'';
|
||||
}
|
42
modules/home/wms/niri/rules/default.nix
Normal file
42
modules/home/wms/niri/rules/default.nix
Normal file
|
@ -0,0 +1,42 @@
|
|||
{ pkgs, config, ... }:
|
||||
{
|
||||
config.home.niri.settings.rules = pkgs.writeText "rules" ''
|
||||
// Browsers
|
||||
window-rule {
|
||||
match app-id="MainBrowser"
|
||||
open-on-workspace "${config.ws.w1}"
|
||||
}
|
||||
window-rule {
|
||||
match app-id="AltBrowser"
|
||||
open-on-workspace "${config.ws.w1a}"
|
||||
}
|
||||
|
||||
// Communication
|
||||
window-rule {
|
||||
match app-id="MiscBrowser"
|
||||
match app-id="vesktop"
|
||||
block-out-from "screencast"
|
||||
open-on-workspace "${config.ws.w7}"
|
||||
}
|
||||
window-rule {
|
||||
match app-id="org.gnome.Fractal"
|
||||
match app-id="org.telegram.desktop"
|
||||
open-on-workspace "${config.ws.w8}"
|
||||
}
|
||||
window-rule {
|
||||
match app-id="thunderbird"
|
||||
open-maximized true
|
||||
open-on-workspace "${config.ws.w9}"
|
||||
}
|
||||
|
||||
// Etc
|
||||
window-rule {
|
||||
match app-id="looking-glass-client"
|
||||
open-on-workspace "${config.ws.w2a}"
|
||||
}
|
||||
window-rule {
|
||||
match app-id="com.obsproject.Studio"
|
||||
open-on-workspace "${config.ws.w4a}"
|
||||
}
|
||||
'';
|
||||
}
|
14
modules/home/wms/niri/settings/default.nix
Normal file
14
modules/home/wms/niri/settings/default.nix
Normal file
|
@ -0,0 +1,14 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
config.home.niri.settings.settings = pkgs.writeText "settings" ''
|
||||
screenshot-path "~/Pictures/Screenshots/Screenshot from %Y-%m-%d %H-%M-%S.png"
|
||||
|
||||
hotkey-overlay {
|
||||
skip-at-startup
|
||||
}
|
||||
|
||||
environment {
|
||||
DISPLAY ":0"
|
||||
}
|
||||
'';
|
||||
}
|
22
modules/home/wms/niri/theme/default.nix
Normal file
22
modules/home/wms/niri/theme/default.nix
Normal file
|
@ -0,0 +1,22 @@
|
|||
{ pkgs, config, ... }:
|
||||
{
|
||||
config.home.niri.settings.theme = pkgs.writeText "theme" ''
|
||||
prefer-no-csd
|
||||
|
||||
layout {
|
||||
gaps 7
|
||||
center-focused-column "never"
|
||||
default-column-width { proportion 0.5; }
|
||||
|
||||
focus-ring {
|
||||
off
|
||||
}
|
||||
|
||||
border {
|
||||
width 3
|
||||
active-color "#${config.look.colors.prime}"
|
||||
inactive-color "#${config.look.colors.split}"
|
||||
}
|
||||
}
|
||||
'';
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue