custom layout and different niri binds
This commit is contained in:
parent
253d0eb7cc
commit
244fba19a1
5 changed files with 130 additions and 40 deletions
|
@ -1,10 +1,11 @@
|
||||||
{ pkgs, config, ... }: {
|
{ lib, config, ... }: {
|
||||||
imports = [
|
imports = [
|
||||||
./containers
|
./containers
|
||||||
./fonts
|
./fonts
|
||||||
./games
|
./games
|
||||||
./home
|
./home
|
||||||
./impermanence
|
./impermanence
|
||||||
|
./layout
|
||||||
./networking
|
./networking
|
||||||
./niri
|
./niri
|
||||||
./nix
|
./nix
|
||||||
|
|
56
modules/layout/custom.xkb
Normal file
56
modules/layout/custom.xkb
Normal file
|
@ -0,0 +1,56 @@
|
||||||
|
default partial alphanumeric_keys modifier_keys keypad_keys
|
||||||
|
xkb_symbols "custom" {
|
||||||
|
include "us(basic)"
|
||||||
|
name[Group1] = "US (custom)";
|
||||||
|
|
||||||
|
key <TLDE> {[ grave, asciitilde ]};
|
||||||
|
key <AE01> {[ 1, exclam ]};
|
||||||
|
key <AE02> {[ 2, at ]};
|
||||||
|
key <AE03> {[ 3, numbersign ]};
|
||||||
|
key <AE04> {[ 4, dollar ]};
|
||||||
|
key <AE05> {[ 5, percent]};
|
||||||
|
key <AE06> {[ 6, asciicircum ]};
|
||||||
|
key <AE07> {[ 7, ampersand ]};
|
||||||
|
key <AE08> {[ 8, asterisk ]};
|
||||||
|
key <AE09> {[ 9, parenleft ]};
|
||||||
|
key <AE10> {[ 0, parenright ]};
|
||||||
|
key <AE11> {[ minus, underscore ]};
|
||||||
|
key <AE12> {[ equal, plus ]};
|
||||||
|
|
||||||
|
key <AD01> {[ semicolon, colon ]};
|
||||||
|
key <AD02> {[ comma, less ]};
|
||||||
|
key <AD03> {[ period, greater ]};
|
||||||
|
key <AD04> {[ p, P ]};
|
||||||
|
key <AD05> {[ z, Z ]};
|
||||||
|
key <AD06> {[ f, F ]};
|
||||||
|
key <AD07> {[ g, G ]};
|
||||||
|
key <AD08> {[ c, C ]};
|
||||||
|
key <AD09> {[ r, R ]};
|
||||||
|
key <AD10> {[ l, L ]};
|
||||||
|
key <AD11> {[ bracketleft, braceleft ]};
|
||||||
|
key <AD12> {[ bracketright, braceright ]};
|
||||||
|
key <BKSL> {[ backslash, bar ]};
|
||||||
|
|
||||||
|
key <AC01> {[ a, A ]};
|
||||||
|
key <AC02> {[ o, O ]};
|
||||||
|
key <AC03> {[ e, E ]};
|
||||||
|
key <AC04> {[ u, U ]};
|
||||||
|
key <AC05> {[ i, I ]};
|
||||||
|
key <AC06> {[ d, D ]};
|
||||||
|
key <AC07> {[ h, H ]};
|
||||||
|
key <AC08> {[ t, T ]};
|
||||||
|
key <AC09> {[ n, N ]};
|
||||||
|
key <AC10> {[ s, S ]};
|
||||||
|
key <AC11> {[ apostrophe, quotedbl ]};
|
||||||
|
|
||||||
|
key <AB01> {[ slash, question ]};
|
||||||
|
key <AB02> {[ q, Q ]};
|
||||||
|
key <AB03> {[ j, J ]};
|
||||||
|
key <AB04> {[ k, K ]};
|
||||||
|
key <AB05> {[ x, X ]};
|
||||||
|
key <AB06> {[ b, B ]};
|
||||||
|
key <AB07> {[ m, M ]};
|
||||||
|
key <AB08> {[ w, W ]};
|
||||||
|
key <AB09> {[ v, V ]};
|
||||||
|
key <AB10> {[ y, Y ]};
|
||||||
|
};
|
14
modules/layout/default.nix
Normal file
14
modules/layout/default.nix
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
{ ... }: {
|
||||||
|
services.xserver.xkb = {
|
||||||
|
layout = "us,custom";
|
||||||
|
options = "compose:ralt";
|
||||||
|
|
||||||
|
extraLayouts."custom" = {
|
||||||
|
description = "custom dvorak-like layout.";
|
||||||
|
languages = [ "en" ];
|
||||||
|
symbolsFile = ./custom.xkb;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
console.keyMap = "us";
|
||||||
|
}
|
|
@ -1,8 +1,10 @@
|
||||||
{ config, ... }: {
|
{ config, ... }: let
|
||||||
|
inherit (config.keys) up down left right;
|
||||||
|
in {
|
||||||
input = {
|
input = {
|
||||||
keyboard = {
|
keyboard = {
|
||||||
xkb = {
|
xkb = {
|
||||||
layout = "us";
|
layout = "us,custom";
|
||||||
options = "compose:ralt";
|
options = "compose:ralt";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -83,9 +85,10 @@
|
||||||
];
|
];
|
||||||
|
|
||||||
binds = {
|
binds = {
|
||||||
"Mod+T".action.spawn = "alacritty";
|
# Shortcuts
|
||||||
|
"Mod+A".action.spawn = "alacritty";
|
||||||
"Mod+B".action.spawn = "firefox";
|
"Mod+B".action.spawn = "firefox";
|
||||||
"Mod+S".action.spawn = ["fuzzel" "-I" "-T" "alacritty" "-p" ""];
|
"Mod+U".action.spawn = ["fuzzel" "-I" "-T" "alacritty" "-p" ""];
|
||||||
|
|
||||||
"XF86AudioRaiseVolume".action.spawn = ["wpctl" "set-volume" "-l" "1" "@DEFAULT_AUDIO_SINK@" "5%+"];
|
"XF86AudioRaiseVolume".action.spawn = ["wpctl" "set-volume" "-l" "1" "@DEFAULT_AUDIO_SINK@" "5%+"];
|
||||||
"XF86AudioLowerVolume".action.spawn = ["wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "5%-"];
|
"XF86AudioLowerVolume".action.spawn = ["wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "5%-"];
|
||||||
|
@ -95,60 +98,76 @@
|
||||||
"XF86MonBrightnessUp".action.spawn = ["brightnessctl" "s" "5%+"];
|
"XF86MonBrightnessUp".action.spawn = ["brightnessctl" "s" "5%+"];
|
||||||
|
|
||||||
"Mod+Backspace".action.close-window = [];
|
"Mod+Backspace".action.close-window = [];
|
||||||
|
"Mod+K".action.center-column = [];
|
||||||
|
|
||||||
"Mod+Left".action.focus-column-left = [];
|
# Move focus
|
||||||
"Mod+Right".action.focus-column-right = [];
|
|
||||||
"Mod+Up".action.focus-window-up = [];
|
"Mod+Up".action.focus-window-up = [];
|
||||||
"Mod+Down".action.focus-window-down = [];
|
"Mod+Down".action.focus-window-down = [];
|
||||||
"Mod+Comma".action.focus-column-left = [];
|
"Mod+Left".action.focus-column-left = [];
|
||||||
"Mod+Period".action.focus-column-right = [];
|
"Mod+Right".action.focus-column-right = [];
|
||||||
"Mod+E".action.focus-window-up = [];
|
|
||||||
"Mod+O".action.focus-window-down = [];
|
|
||||||
|
|
||||||
"Mod+Shift+Left".action.move-column-left = [];
|
"Mod+${up}".action.focus-window-up = [];
|
||||||
"Mod+Shift+Right".action.move-column-right = [];
|
"Mod+${down}".action.focus-window-down = [];
|
||||||
|
"Mod+${left}".action.focus-column-left = [];
|
||||||
|
"Mod+${right}".action.focus-column-right = [];
|
||||||
|
|
||||||
|
# Move column/window
|
||||||
"Mod+Shift+Up".action.move-window-up = [];
|
"Mod+Shift+Up".action.move-window-up = [];
|
||||||
"Mod+Shift+Down".action.move-window-down = [];
|
"Mod+Shift+Down".action.move-window-down = [];
|
||||||
"Mod+Shift+Comma".action.move-column-left = [];
|
"Mod+Shift+Left".action.move-column-left = [];
|
||||||
"Mod+Shift+Period".action.move-column-right = [];
|
"Mod+Shift+Right".action.move-column-right = [];
|
||||||
"Mod+Shift+E".action.move-window-up = [];
|
|
||||||
"Mod+Shift+O".action.move-window-down = [];
|
|
||||||
|
|
||||||
"Mod+Ctrl+Left".action.focus-monitor-left = [];
|
"Mod+Shift+${up}".action.move-window-up = [];
|
||||||
"Mod+Ctrl+Right".action.focus-monitor-right = [];
|
"Mod+Shift+${down}".action.move-window-down = [];
|
||||||
|
"Mod+Shift+${left}".action.move-column-left = [];
|
||||||
|
"Mod+Shift+${right}".action.move-column-right = [];
|
||||||
|
|
||||||
|
# Move monitor focus
|
||||||
"Mod+Ctrl+Up".action.focus-monitor-up = [];
|
"Mod+Ctrl+Up".action.focus-monitor-up = [];
|
||||||
"Mod+Ctrl+Down".action.focus-monitor-down = [];
|
"Mod+Ctrl+Down".action.focus-monitor-down = [];
|
||||||
"Mod+Ctrl+Comma".action.focus-monitor-left = [];
|
"Mod+Ctrl+Left".action.focus-monitor-left = [];
|
||||||
"Mod+Ctrl+Period".action.focus-monitor-right = [];
|
"Mod+Ctrl+Right".action.focus-monitor-right = [];
|
||||||
"Mod+Ctrl+E".action.focus-monitor-up = [];
|
|
||||||
"Mod+Ctrl+O".action.focus-monitor-down = [];
|
|
||||||
|
|
||||||
"Mod+Shift+Ctrl+Left".action.move-column-to-monitor-left = [];
|
"Mod+Ctrl+${up}".action.focus-monitor-up = [];
|
||||||
"Mod+Shift+Ctrl+Right".action.move-column-to-monitor-right = [];
|
"Mod+Ctrl+${down}".action.focus-monitor-down = [];
|
||||||
|
"Mod+Ctrl+${left}".action.focus-monitor-left = [];
|
||||||
|
"Mod+Ctrl+${right}".action.focus-monitor-right = [];
|
||||||
|
|
||||||
|
# Move columns between monitors
|
||||||
"Mod+Shift+Ctrl+Up".action.move-column-to-monitor-up = [];
|
"Mod+Shift+Ctrl+Up".action.move-column-to-monitor-up = [];
|
||||||
"Mod+Shift+Ctrl+Down".action.move-column-to-monitor-down = [];
|
"Mod+Shift+Ctrl+Down".action.move-column-to-monitor-down = [];
|
||||||
"Mod+Shift+Ctrl+Comma".action.move-column-to-monitor-left = [];
|
"Mod+Shift+Ctrl+Left".action.move-column-to-monitor-left = [];
|
||||||
"Mod+Shift+Ctrl+Period".action.move-column-to-monitor-right = [];
|
"Mod+Shift+Ctrl+Right".action.move-column-to-monitor-right = [];
|
||||||
"Mod+Shift+Ctrl+E".action.move-column-to-monitor-up = [];
|
|
||||||
"Mod+Shift+Ctrl+O".action.move-column-to-monitor-down = [];
|
|
||||||
|
|
||||||
"Mod+P".action.consume-window-into-column = [];
|
"Mod+Shift+Ctrl+${up}".action.move-column-to-monitor-up = [];
|
||||||
"Mod+Shift+P".action.expel-window-from-column = [];
|
"Mod+Shift+Ctrl+${down}".action.move-column-to-monitor-down = [];
|
||||||
|
"Mod+Shift+Ctrl+${left}".action.move-column-to-monitor-left = [];
|
||||||
|
"Mod+Shift+Ctrl+${right}".action.move-column-to-monitor-right = [];
|
||||||
|
|
||||||
|
# Stack windows
|
||||||
|
"Mod+BracketLeft".action.consume-window-into-column = [];
|
||||||
|
"Mod+BracketRight".action.expel-window-from-column = [];
|
||||||
|
|
||||||
|
# Resize windows
|
||||||
"Mod+Z".action.switch-preset-column-width = [];
|
"Mod+Z".action.switch-preset-column-width = [];
|
||||||
"Mod+F".action.maximize-column = [];
|
"Mod+F".action.maximize-column = [];
|
||||||
"Mod+Shift+F".action.fullscreen-window = [];
|
"Mod+Shift+F".action.fullscreen-window = [];
|
||||||
"Mod+K".action.center-column = [];
|
|
||||||
|
|
||||||
"Mod+Plus".action.set-column-width = "+10%";
|
"Mod+Plus".action.set-column-width = "+10%";
|
||||||
"Mod+Minus".action.set-column-width = "-10%";
|
"Mod+Minus".action.set-column-width = "-10%";
|
||||||
"Mod+Shift+Plus".action.set-window-height = "+10%";
|
"Mod+Shift+Plus".action.set-window-height = "+10%";
|
||||||
"Mod+Shift+Minus".action.set-window-height = "-10%";
|
"Mod+Shift+Minus".action.set-window-height = "-10%";
|
||||||
|
|
||||||
"Mod+Shift+S".action.screenshot = [];
|
# Change Layout
|
||||||
"Mod+Shift+Ctrl+S".action.screenshot-window = [];
|
"Mod+Comma".action.switch-layout = "prev";
|
||||||
|
"Mod+Period".action.switch-layout = "next";
|
||||||
|
|
||||||
|
# Screenshot
|
||||||
|
"Mod+Shift+P".action.screenshot = [];
|
||||||
|
"Mod+Shift+Ctrl+P".action.screenshot-window = [];
|
||||||
"Print".action.screenshot-screen = [];
|
"Print".action.screenshot-screen = [];
|
||||||
|
|
||||||
|
# Exit
|
||||||
"Mod+Shift+L".action.spawn = "swaylock";
|
"Mod+Shift+L".action.spawn = "swaylock";
|
||||||
"Mod+Shift+Q".action.quit = [];
|
"Mod+Shift+Q".action.quit = [];
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
{ lib, config, pkgs, ... }: lib.mkIf config.full {
|
{ lib, config, ... }: lib.mkIf config.full {
|
||||||
home-manager.user.${config.username} = {
|
home-manager.users.${config.username} = {
|
||||||
home.packages = [
|
home.packages = [
|
||||||
];
|
];
|
||||||
|
|
||||||
programs.sioyek = {
|
programs.sioyek = {
|
||||||
enable = true;
|
enable = true;
|
||||||
bindings = {
|
bindings = {
|
||||||
"move_up" = "k";
|
"move_up" = config.keys.up;
|
||||||
"move_down" = "k";
|
"move_down" = config.keys.down;
|
||||||
"move_left" = "k";
|
"move_left" = config.keys.left;
|
||||||
"move_right" = "k";
|
"move_right" = config.keys.right;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue