update hyprland config on laptop

workspace switch hotkeys
resizing keys
moonlander default layout on laptop
add monitor rotation
remove scaling on laptop display
This commit is contained in:
Tristan 2023-09-06 12:52:46 +01:00
parent 033ce8dc23
commit fddf319df9
6 changed files with 87 additions and 37 deletions

View file

@ -5,13 +5,15 @@ let
renderDisplaysForHyprland = displays:
"# === DISPLAY MODULE ===\n"
+ concatStringsSep "\n" (map displayHyprlandSetting displays);
+ concatStringsSep "\n" (map displayHyprlandSetting displays)
+ "\n";
displayHyprlandSetting = display:
"monitor = " + specificDisplay display +
", " + resToString display.resolution +
", " + positionToHyprlandString display.position +
", " + toString display.scaling;
", " + toString display.scaling +
", " + "transform," + toString display.rotation;
swaybgJob = displays:
{
@ -28,7 +30,7 @@ let
};
swaybgCmd = display:
if (display.wallpaper != "") then "-o ${display.name} -i ${display.wallpaper}" else "";
if (display.wallpaper != "") then "-o ${display.name} -i ${display.wallpaper} -m fill" else "";
specificDisplay = display:
if display.description == ""
@ -86,6 +88,10 @@ let
type = types.float;
default = 1.0;
};
rotation = mkOption {
type = types.int;
default = 0;
};
resolution = mkOption {
description = "res";
type = resolutionType;

View file

@ -27,12 +27,13 @@ in
vscode-extensions.asvetliakov.vscode-neovim
];
userSettings = {
"vscode-neovim.neovimExecutablePaths.linux" = "/run/current-system/sw/bin/nvim";
"vscode-neovim.neovimExecutablePaths.linux" = "${pkgs.neovim}/bin/nvim";
"keyboard.dispatch" = "keyCode";
"terminal.integrated.sendKeybindingsToShell" = true;
"aws.telemetry" = false;
"gitlens.telemetry.enabled" = false;
"redhat.telemetry.enabled" = false;
"cSpell.language" = "en,en-GB";
};
};

View file

@ -7,18 +7,26 @@ with lib;
};
};
config = mkIf config.keyboard.dvorak.enable {
config = {
home-manager.users.${user}.imports = [
{
wayland.windowManager.hyprland.extraConfig = ''
# === KEYBOARD MODULE ===
input {
kb_variant = dvorak
kb_variant = ,dvorak
kb_layout = gb,gb
kb_options = caps:escape
numlock_by_default = true
}
# moonlander is programmed in dvorak!
device:zsa-technology-labs-moonlander-mark-i {
kb_variant =
}
'';
}
];
services.xserver.xkbVariant = "dvorak";
services.xserver.xkbVariant = if config.keyboard.dvorak.enable then "dvorak" else "";
};
}

View file

@ -32,6 +32,11 @@ in
# so hard to reach X on a laptop
bind = SUPER_SHIFT, Q, killactive,
# toggle built in keyboard layout
device:at-translated-set-2-keyboard {
kb_options = grp:alt_shift_toggle
}
'';
};
}];

View file

@ -31,7 +31,7 @@ in
systemdIntegration = true;
# https://wiki.hyprland.org/Configuring/Variables/
extraConfig = ''
## global hyprland configuration
# === GLOBAL CONFIG ===
env = GDK_BACKEND,wayland,x11
env = QT_QPA_PLATFORM,wayland;xcb
env = SDL_VIDEODRIVER,wayland
@ -44,10 +44,6 @@ in
env = NIXOS_OZONE_WL,1
input {
kb_layout = gb
kb_options = caps:escape
numlock_by_default = true
touchpad {
natural_scroll = yes
scroll_factor = 0.5
@ -70,36 +66,63 @@ in
bind = SUPER, j, layoutmsg,cyclenext
bind = SUPER, k, layoutmsg,cycleprev
bind = SUPER, space, layoutmsg,swapwithmaster master
bind = SUPER_SHIFT, k, layoutmsg, orientationtop
bind = SUPER_SHIFT, h, layoutmsg, orientationleft
bind = SUPER, F, fullscreen,
bind = SUPER, V, togglefloating,
bind = SUPER_SHIFT, V, togglegroup,
bind = SUPER_SHIFT, space, changegroupactive,n
bind = SUPER_SHIFT, h, changegroupactive,b
bind = SUPER_SHIFT, h, moveintogroup,l
bind = SUPER_SHIFT, l, moveintogroup,r
bind = SUPER_SHIFT, l, changegroupactive,f
bind = SUPER, Y, togglespecialworkspace
bind = SUPER_SHIFT, Y, movetoworkspace, special
bind = SUPER, R, submap, resize
submap = resize
bind = SUPER,1,workspace,1
bind = SUPER,2,workspace,2
bind = SUPER,3,workspace,3
bind = SUPER,4,workspace,4
bind = SUPER,5,workspace,5
bind = SUPER,6,workspace,6
bind = SUPER,7,workspace,7
bind = SUPER,8,workspace,8
bind = SUPER,9,workspace,9
bind = SUPER,0,workspace,10
binde=,right,resizeactive,10 0
binde=,left,resizeactive,-10 0
binde=,up,resizeactive,0 -10
binde=,down,resizeactive,0 10
bind = SUPER_SHIFT,1,movetoworkspace,1
bind = SUPER_SHIFT,2,movetoworkspace,2
bind = SUPER_SHIFT,3,movetoworkspace,3
bind = SUPER_SHIFT,4,movetoworkspace,4
bind = SUPER_SHIFT,5,movetoworkspace,5
bind = SUPER_SHIFT,6,movetoworkspace,6
bind = SUPER_SHIFT,7,movetoworkspace,7
bind = SUPER_SHIFT,8,movetoworkspace,8
bind = SUPER_SHIFT,9,movetoworkspace,9
bind = SUPER_SHIFT,0,movetoworkspace,10
binde=,k,resizeactive,0 -10
binde=,j,resizeactive,0 10
binde=,l,splitratio,0.05
binde=,h,splitratio,-0.05
binde=SHIFT,l,splitratio,0.3
binde=SHIFT,h,splitratio,-0.3
bind = , escape, submap,reset
bind = , enter, submap,reset
bind = SUPER, R, submap,reset
bind = CONTROL, C, submap,reset
submap = reset
workspace = 11, default:true
bind = SUPER,1,workspace,11
bind = SUPER,2,workspace,12
bind = SUPER,3,workspace,13
bind = SUPER,4,workspace,14
bind = SUPER,5,workspace,15
bind = SUPER,6,workspace,16
bind = SUPER,7,workspace,17
bind = SUPER,8,workspace,18
bind = SUPER,9,workspace,19
bind = SUPER,0,workspace,20
bind = SUPER,left,workspace,r-1
bind = SUPER,right,workspace,r+1
bind = SUPER_SHIFT,1,movetoworkspace,11
bind = SUPER_SHIFT,2,movetoworkspace,12
bind = SUPER_SHIFT,3,movetoworkspace,13
bind = SUPER_SHIFT,4,movetoworkspace,14
bind = SUPER_SHIFT,5,movetoworkspace,15
bind = SUPER_SHIFT,6,movetoworkspace,16
bind = SUPER_SHIFT,7,movetoworkspace,17
bind = SUPER_SHIFT,8,movetoworkspace,18
bind = SUPER_SHIFT,9,movetoworkspace,19
bind = SUPER_SHIFT,0,movetoworkspace,20
gestures {
workspace_swipe = yes