switched to niri.
added basic 3/4 finger gestures. nixos: gen 161 @ nix-pad — 2026-07-30 21:40 26.05.20260724.597283a (Yarara) nixos: gen 162 @ nix-pad — 2026-07-30 21:45 26.05.20260724.597283a (Yarara)
This commit is contained in:
+96
-37
@@ -1,50 +1,109 @@
|
||||
{ config, lib, pkgs, inputs, ... }:
|
||||
|
||||
let
|
||||
launch-lisgd = pkgs.writeShellScriptBin "launch-lisgd" ''
|
||||
# Search for the capacitive touch layer and extract its event number.
|
||||
# UPDATE 'Touchscreen' below to match the unique word you found in step 1.
|
||||
TOUCH_EVENT=$(grep -i -E 'name=".*Finger.*"' -A 5 /proc/bus/input/devices | grep -o 'event[0-9]\+' | head -n 1)
|
||||
|
||||
if [ -n "$TOUCH_EVENT" ]; then
|
||||
# Start lisgd locked exclusively to the finger digitizer
|
||||
${pkgs.lisgd}/bin/lisgd -t 30 -m 150 -r 45 -d "/dev/input/$TOUCH_EVENT" \
|
||||
-g "3,LR,*,*,P,niri msg action focus-column-left && sleep 0.4" \
|
||||
-g "3,RL,*,*,P,niri msg action focus-column-right && sleep 0.4" \
|
||||
-g "3,UD,*,*,P,niri msg action focus-workspace-up && sleep 0.4" \
|
||||
-g "3,DU,*,*,P,niri msg action focus-workspace-down && sleep 0.4" \
|
||||
-g "4,DU,*,*,P,dms ipc spotlight toggle && sleep 0.4"
|
||||
fi
|
||||
'';
|
||||
in
|
||||
|
||||
{
|
||||
imports = [
|
||||
inputs.dms.homeModules.dank-material-shell
|
||||
];
|
||||
|
||||
|
||||
programs.dank-material-shell = {
|
||||
enable = true;
|
||||
systemd.enable = true;
|
||||
};
|
||||
|
||||
#systemd.user.services.niri-flake-polkit.enable = false;
|
||||
|
||||
# 2. Enable & Configure Niri
|
||||
programs.niri = {
|
||||
# Declarative KDL configuration for Niri
|
||||
settings = {
|
||||
# Autostart DMS if you prefer launching it directly from Niri instead of systemd
|
||||
# spawn-at-startup = [ { command = [ "dms" ]; } ];
|
||||
spawn-at-startup = [
|
||||
{ command = [ "dms" "run" ]; }
|
||||
{ command = [ "${launch-lisgd}/bin/launch-lisgd" ]; } # Spawns the daemon
|
||||
];
|
||||
|
||||
# Core keybindings
|
||||
binds = {
|
||||
"Mod+Return".action.spawn = "alacritty"; # Or your preferred terminal
|
||||
"Mod+X".action.close-window = [];
|
||||
"Mod+Shift+E".action.quit = [];
|
||||
|
||||
# Focus / Column movement
|
||||
"Mod+H".action.focus-column-left = [];
|
||||
"Mod+L".action.focus-column-right = [];
|
||||
"Mod+J".action.focus-window-or-workspace-down = [];
|
||||
"Mod+K".action.focus-window-or-workspace-up = [];
|
||||
|
||||
# DMS Launcher integration (if you want a hotkey bound directly)
|
||||
"Mod+Space".action.spawn = [ "dms" "ipc" "call" "launcher" "toggle" ];
|
||||
input = {
|
||||
keyboard.xkb.layout = "us";
|
||||
touchpad = {
|
||||
tap = true;
|
||||
natural-scroll = true;
|
||||
};
|
||||
};
|
||||
|
||||
# Window & Layer Rules (e.g. enable background blur for DMS components)
|
||||
# layer-rules = [
|
||||
# {
|
||||
# geometry-corner-radius = 12;
|
||||
# background-effect = {
|
||||
# blur = true;
|
||||
# };
|
||||
# }
|
||||
# ];
|
||||
layout = {
|
||||
gaps = 8;
|
||||
center-focused-column = "never";
|
||||
default-column-width.proportion = 0.985;
|
||||
border.enable = false;
|
||||
#tab-indicator.corner-radius = 18.0;
|
||||
focus-ring = {
|
||||
|
||||
enable = false;
|
||||
width = 2;
|
||||
};
|
||||
};
|
||||
|
||||
prefer-no-csd = true;
|
||||
window-rules = [
|
||||
{ # All windows
|
||||
geometry-corner-radius = {
|
||||
bottom-left = 25.0;
|
||||
bottom-right = 0.0;
|
||||
top-right = 0.0;
|
||||
top-left = 25.0;
|
||||
};
|
||||
|
||||
|
||||
draw-border-with-background = true;
|
||||
clip-to-geometry = true;
|
||||
}
|
||||
];
|
||||
|
||||
# Vim Keybindings & Built-in Features
|
||||
binds = with config.lib.niri.actions; {
|
||||
# Launchers & Session Control
|
||||
"Mod+Return".action.spawn = [ "alacritty" ];
|
||||
"Mod+Space".action.spawn = [ "dms" "ipc" "spotlight" "toggle" ];
|
||||
"Mod+X".action.close-window = [];
|
||||
"Mod+F".action.fullscreen-window = [];
|
||||
"Mod+Shift+E".action.quit = [];
|
||||
"Mod+Shift+P".action.toggle-overview = [];
|
||||
|
||||
# Vim Focus Movement
|
||||
"Mod+H".action.focus-column-left = [];
|
||||
"Mod+J".action.focus-window-down = [];
|
||||
"Mod+K".action.focus-window-up = [];
|
||||
"Mod+L".action.focus-column-right = [];
|
||||
|
||||
# Workspace Navigation
|
||||
"Mod+N".action.focus-workspace-down = [];
|
||||
"Mod+U".action.focus-workspace-up = [];
|
||||
|
||||
# Vim Window Reordering
|
||||
"Mod+Shift+H".action.move-column-left = [];
|
||||
"Mod+Shift+L".action.move-column-right = [];
|
||||
"Mod+Shift+J".action.move-column-to-workspace-down = [];
|
||||
"Mod+Shift+K".action.move-column-to-workspace-up = [];
|
||||
|
||||
# Volume & Brightness Media Controls
|
||||
"XF86AudioRaiseVolume".action.spawn = [ "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.05+" ];
|
||||
"XF86AudioLowerVolume".action.spawn = [ "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.05-" ];
|
||||
"XF86AudioMute".action.spawn = [ "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle" ];
|
||||
"XF86MonBrightnessUp".action.spawn = [ "dms" "ipc" "call" "brightness" "increment" "5" "" ];
|
||||
"XF86MonBrightnessDown".action.spawn = [ "dms" "ipc" "call" "brightness" "decrement" "5" "" ];
|
||||
|
||||
# Screenshots
|
||||
"Print".action.screenshot = [];
|
||||
"Ctrl+Print".action.screenshot-screen = [];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user