148 lines
5.0 KiB
Nix
148 lines
5.0 KiB
Nix
{ 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" \
|
|
-g "1,DU,B,*,pkill -u jashton -RTMIN wvkbd-mobintl && sleep 0.4"
|
|
fi
|
|
'';
|
|
|
|
launch-wvkbd = pkgs.writeShellScriptBin "launch-wvkbd" ''
|
|
THEME_CACHE="$HOME/.cache/DankMaterialShell/dms-colors.json"
|
|
|
|
if [ -f "$THEME_CACHE" ]; then
|
|
BG=$(jq -r '.["colors"]["dark"]["background"]' "$THEME_CACHE" | tr -d '#')
|
|
FG=$(jq -r '.["colors"]["dark"]["surface_container_lowest"]' "$THEME_CACHE" | tr -d '#')
|
|
TXT=$(jq -r '.["colors"]["dark"]["on_background"]' "$THEME_CACHE" | tr -d '#')
|
|
PRIMARY=$(jq -r '.["colors"]["dark"]["surface_container_lowest"]' "$THEME_CACHE" | tr -d '#')
|
|
ON_PRIMARY=$(jq -r '.["colors"]["dark"]["on_background"]' "$THEME_CACHE" | tr -d '#')
|
|
|
|
wvkbd-mobintl --hidden --no-popup --bg "$BG" --press "$BG" --fg "$FG" --text "$TXT" --fg-sp "$PRIMARY" --text-sp "$ON_PRIMARY" -L 300
|
|
else
|
|
wvkbd-mobintl --hidden --no-popup
|
|
fi
|
|
'';
|
|
in
|
|
|
|
{
|
|
xdg.portal = {
|
|
enable = true;
|
|
# Use gtk or kde based on your preferred file picker dialog
|
|
config.niri = {
|
|
"org.freedesktop.impl.portal.FileChooser" = [ "gtk" ]; # or "kde"
|
|
};
|
|
|
|
# Ensure the GTK portal is installed
|
|
extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
|
|
};
|
|
|
|
#programs.niri.enable = true;
|
|
xdg.configFile."niri/config.kdl".text = lib.mkForce ''
|
|
input {
|
|
keyboard {
|
|
xkb {
|
|
layout "us"
|
|
model ""
|
|
rules ""
|
|
variant ""
|
|
}
|
|
repeat-delay 600
|
|
repeat-rate 25
|
|
track-layout "global"
|
|
}
|
|
touchpad {
|
|
tap
|
|
natural-scroll
|
|
}
|
|
}
|
|
screenshot-path "~/media/pics/screenshots/%Y-%m-%d %H-%M-%S.png"
|
|
prefer-no-csd
|
|
layout {
|
|
gaps 8
|
|
struts {
|
|
left 0
|
|
right 0
|
|
top 0
|
|
bottom 0
|
|
}
|
|
focus-ring { off; }
|
|
border { off; }
|
|
default-column-width { proportion 1.000000; }
|
|
center-focused-column "never"
|
|
}
|
|
cursor {
|
|
xcursor-theme "default"
|
|
xcursor-size 24
|
|
}
|
|
hotkey-overlay { skip-at-startup; }
|
|
binds {
|
|
Ctrl+Print { screenshot-screen; }
|
|
Mod+F { fullscreen-window; }
|
|
Mod+H { focus-column-left; }
|
|
Mod+J { focus-window-down; }
|
|
Mod+K { focus-window-up; }
|
|
Mod+L { focus-column-right; }
|
|
Mod+N { focus-workspace-down; }
|
|
Mod+P { spawn "pkill" "-RTMIN" "wvkbd-mobintl"; }
|
|
Mod+Return { spawn "alacritty"; }
|
|
Mod+Shift+E { quit; }
|
|
Mod+Shift+H { move-column-left; }
|
|
Mod+Shift+J { move-column-to-workspace-down; }
|
|
Mod+Shift+K { move-column-to-workspace-up; }
|
|
Mod+Shift+L { move-column-right; }
|
|
Mod+Shift+P { toggle-overview; }
|
|
Mod+Space { spawn "dms" "ipc" "spotlight" "toggle"; }
|
|
Mod+U { focus-workspace-up; }
|
|
Mod+X { close-window; }
|
|
Print { screenshot; }
|
|
XF86AudioLowerVolume { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.05-"; }
|
|
XF86AudioMute { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"; }
|
|
XF86AudioRaiseVolume { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.05+"; }
|
|
XF86MonBrightnessDown { spawn "dms" "ipc" "call" "brightness" "decrement" "5" ""; }
|
|
XF86MonBrightnessUp { spawn "dms" "ipc" "call" "brightness" "increment" "5" ""; }
|
|
}
|
|
spawn-at-startup "dms" "run"
|
|
spawn-at-startup "/nix/store/b1kxyzg5r6644mcmjh8jwsb8rinqzsw8-launch-wvkbd/bin/launch-wvkbd"
|
|
spawn-at-startup "/nix/store/l9k161qcs6ypzzbicjhkn8b203r610j6-launch-lisgd/bin/launch-lisgd"
|
|
window-rule {
|
|
draw-border-with-background true
|
|
geometry-corner-radius 25.000000 25.000000 25.000000 25.000000
|
|
clip-to-geometry true
|
|
}
|
|
|
|
window-rule {
|
|
match app-id="^Alacritty$"
|
|
|
|
background-effect {
|
|
blur true
|
|
}
|
|
}
|
|
|
|
overview {
|
|
backdrop-color "#987CA7"
|
|
}
|
|
|
|
gestures {
|
|
hot-corners {
|
|
off
|
|
}
|
|
}
|
|
|
|
include "/home/jashton/.config/niri/dms/outputs.kdl"
|
|
include "/home/jashton/.config/niri/dms/binds.kdl"
|
|
|
|
spawn-at-startup "steam"
|
|
'';
|
|
}
|