Update hyprland config (gestures and other stuff)
This commit is contained in:
parent
28cc7d2d25
commit
18cc25b3b8
3 changed files with 298 additions and 300 deletions
|
|
@ -1,10 +1,10 @@
|
||||||
{
|
{
|
||||||
pkgs,
|
|
||||||
lib,
|
lib,
|
||||||
config,
|
config,
|
||||||
...
|
...
|
||||||
}: {
|
}:
|
||||||
imports = [./regreet.nix];
|
{
|
||||||
|
imports = [ ./regreet.nix ];
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
programs.hyprland.autoLogin.username = lib.mkOption {
|
programs.hyprland.autoLogin.username = lib.mkOption {
|
||||||
|
|
@ -21,17 +21,8 @@
|
||||||
withUWSM = true;
|
withUWSM = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
xdg.portal = {
|
services.greetd.settings.initial_session =
|
||||||
enable = true;
|
let
|
||||||
wlr.enable = true;
|
|
||||||
xdgOpenUsePortal = true;
|
|
||||||
extraPortals = [
|
|
||||||
pkgs.xdg-desktop-portal-hyprland
|
|
||||||
pkgs.xdg-desktop-portal-gtk
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
services.greetd.settings.initial_session = let
|
|
||||||
username = config.programs.hyprland.autoLogin.username;
|
username = config.programs.hyprland.autoLogin.username;
|
||||||
in
|
in
|
||||||
lib.mkIf (!isNull username) {
|
lib.mkIf (!isNull username) {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
{pkgs, ...}: {
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
wayland.windowManager.hyprland = {
|
wayland.windowManager.hyprland = {
|
||||||
enable = true;
|
enable = true;
|
||||||
xwayland = {
|
xwayland = {
|
||||||
|
|
@ -10,9 +11,11 @@
|
||||||
pkgs.hyprlandPlugins.hyprgrass
|
pkgs.hyprlandPlugins.hyprgrass
|
||||||
];
|
];
|
||||||
|
|
||||||
settings = let
|
settings =
|
||||||
|
let
|
||||||
app_menu = "${pkgs.fuzzel}/bin/fuzzel";
|
app_menu = "${pkgs.fuzzel}/bin/fuzzel";
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
# Autostart
|
# Autostart
|
||||||
exec-once = [
|
exec-once = [
|
||||||
"uwsm app -- nm-applet"
|
"uwsm app -- nm-applet"
|
||||||
|
|
@ -121,8 +124,7 @@
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
bind =
|
bind = [
|
||||||
[
|
|
||||||
# show keybinds list
|
# show keybinds list
|
||||||
"$mainMod, F1, exec, show-keybinds"
|
"$mainMod, F1, exec, show-keybinds"
|
||||||
|
|
||||||
|
|
@ -160,17 +162,19 @@
|
||||||
# binds $mod + [shift +] {1..10} to [move to] workspace {1..10}
|
# binds $mod + [shift +] {1..10} to [move to] workspace {1..10}
|
||||||
builtins.concatLists (
|
builtins.concatLists (
|
||||||
builtins.genList (
|
builtins.genList (
|
||||||
x: let
|
x:
|
||||||
ws = let
|
let
|
||||||
|
ws =
|
||||||
|
let
|
||||||
c = (x + 1) / 10;
|
c = (x + 1) / 10;
|
||||||
in
|
in
|
||||||
builtins.toString (x + 1 - (c * 10));
|
builtins.toString (x + 1 - (c * 10));
|
||||||
in [
|
in
|
||||||
|
[
|
||||||
"$mainMod, ${ws}, workspace, ${toString (x + 1)}"
|
"$mainMod, ${ws}, workspace, ${toString (x + 1)}"
|
||||||
"$mainMod SHIFT, ${ws}, movetoworkspacesilent, ${toString (x + 1)}"
|
"$mainMod SHIFT, ${ws}, movetoworkspacesilent, ${toString (x + 1)}"
|
||||||
]
|
]
|
||||||
)
|
) 10
|
||||||
10
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
++ [
|
++ [
|
||||||
|
|
@ -184,24 +188,40 @@
|
||||||
# Window focus, movement and control
|
# Window focus, movement and control
|
||||||
builtins.concatLists (
|
builtins.concatLists (
|
||||||
let
|
let
|
||||||
keys = ["H" "L" "K" "J"];
|
keys = [
|
||||||
directions = ["l" "r" "u" "d"];
|
"H"
|
||||||
|
"L"
|
||||||
|
"K"
|
||||||
|
"J"
|
||||||
|
];
|
||||||
|
directions = [
|
||||||
|
"l"
|
||||||
|
"r"
|
||||||
|
"u"
|
||||||
|
"d"
|
||||||
|
];
|
||||||
resize = toString 80; # Change this to change how much a window resizes each keypress
|
resize = toString 80; # Change this to change how much a window resizes each keypress
|
||||||
resize_list = ["-${resize} 0" "${resize} 0" "0 -${resize}" "0 ${resize}"];
|
resize_list = [
|
||||||
|
"-${resize} 0"
|
||||||
|
"${resize} 0"
|
||||||
|
"0 -${resize}"
|
||||||
|
"0 ${resize}"
|
||||||
|
];
|
||||||
in
|
in
|
||||||
builtins.genList (
|
builtins.genList (
|
||||||
x: let
|
x:
|
||||||
|
let
|
||||||
k = builtins.elemAt keys x;
|
k = builtins.elemAt keys x;
|
||||||
d = builtins.elemAt directions x;
|
d = builtins.elemAt directions x;
|
||||||
r = builtins.elemAt resize_list x;
|
r = builtins.elemAt resize_list x;
|
||||||
in [
|
in
|
||||||
|
[
|
||||||
"$mainMod, ${k}, movefocus, ${d}"
|
"$mainMod, ${k}, movefocus, ${d}"
|
||||||
"$mainMod SHIFT, ${k}, movewindow, ${d}"
|
"$mainMod SHIFT, ${k}, movewindow, ${d}"
|
||||||
"$mainMod CTRL, ${k}, resizeactive, ${r}"
|
"$mainMod CTRL, ${k}, resizeactive, ${r}"
|
||||||
"$mainMod ALT, ${k}, moveactive, ${r}"
|
"$mainMod ALT, ${k}, moveactive, ${r}"
|
||||||
]
|
]
|
||||||
)
|
) 4
|
||||||
4
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
++ [
|
++ [
|
||||||
|
|
@ -236,6 +256,10 @@
|
||||||
"$mainMod, mouse:273, resizewindow"
|
"$mainMod, mouse:273, resizewindow"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
gesture = [
|
||||||
|
"3, horizontal, workspace"
|
||||||
|
];
|
||||||
|
|
||||||
# windowrule
|
# windowrule
|
||||||
windowrule = [
|
windowrule = [
|
||||||
"float,class:vimiv"
|
"float,class:vimiv"
|
||||||
|
|
@ -293,14 +317,11 @@
|
||||||
force_zero_scaling = true;
|
force_zero_scaling = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
gestures = {
|
|
||||||
workspace_swipe = true;
|
|
||||||
workspace_swipe_direction_lock = false;
|
|
||||||
};
|
|
||||||
ecosystem = {
|
ecosystem = {
|
||||||
no_update_news = true;
|
no_update_news = true;
|
||||||
no_donation_nag = true;
|
no_donation_nag = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin = {
|
plugin = {
|
||||||
touch_gestures = {
|
touch_gestures = {
|
||||||
# The default sensitivity is probably too low on tablet screens,
|
# The default sensitivity is probably too low on tablet screens,
|
||||||
|
|
@ -376,12 +397,6 @@
|
||||||
", longpress:2, movewindow"
|
", longpress:2, movewindow"
|
||||||
", longpress:3, resizewindow"
|
", longpress:3, resizewindow"
|
||||||
];
|
];
|
||||||
|
|
||||||
experimental = {
|
|
||||||
# send proper cancel events to windows instead of hacky touch_up events,
|
|
||||||
# NOT recommended as it crashed a few times, once it's stabilized I'll make it the default
|
|
||||||
send_cancel = 0;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,9 @@
|
||||||
{lib, ...}: let
|
{ lib, ... }:
|
||||||
|
let
|
||||||
variables = {
|
variables = {
|
||||||
NIXOS_OZONE_WL = 1;
|
NIXOS_OZONE_WL = 1;
|
||||||
ELECTRON_OZONE_PLATFORM_HINT = "auto";
|
ELECTRON_OZONE_PLATFORM_HINT = "auto";
|
||||||
__GL_GSYNC_ALLOWED = 0;
|
|
||||||
__GL_VRR_ALLOWED = 0;
|
|
||||||
_JAVA_AWT_WM_NONEREPARENTING = 1;
|
|
||||||
DISABLE_QT5_COMPAT = 0;
|
|
||||||
GDK_BACKEND = "wayland,x11,*";
|
GDK_BACKEND = "wayland,x11,*";
|
||||||
ANKI_WAYLAND = 1;
|
|
||||||
DIRENV_LOG_FORMAT = "";
|
|
||||||
WLR_DRM_NO_ATOMIC = 1;
|
|
||||||
QT_AUTO_SCREEN_SCALE_FACTOR = 1;
|
QT_AUTO_SCREEN_SCALE_FACTOR = 1;
|
||||||
QT_WAYLAND_DISABLE_WINDOWDECORATION = 1;
|
QT_WAYLAND_DISABLE_WINDOWDECORATION = 1;
|
||||||
QT_QPA_PLATFORM = "wayland;xcb";
|
QT_QPA_PLATFORM = "wayland;xcb";
|
||||||
|
|
@ -19,13 +13,11 @@
|
||||||
SDL_VIDEODRIVER = "wayland";
|
SDL_VIDEODRIVER = "wayland";
|
||||||
CLUTTER_BACKEND = "wayland";
|
CLUTTER_BACKEND = "wayland";
|
||||||
};
|
};
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
home.sessionVariables = variables;
|
home.sessionVariables = variables;
|
||||||
|
|
||||||
xdg.configFile."uwsm/env".text = builtins.concatStringsSep "\n" (
|
xdg.configFile."uwsm/env".text = builtins.concatStringsSep "\n" (
|
||||||
lib.attrsets.mapAttrsToList (
|
lib.attrsets.mapAttrsToList (name: value: "export ${name}=\"${builtins.toString value}\"") variables
|
||||||
name: value: "export ${name}=\"${builtins.toString value}\""
|
|
||||||
)
|
|
||||||
variables
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue