fix(hyprland): floating window outside of screen
This commit is contained in:
parent
6076c95792
commit
aef7c50ec7
|
@ -1,20 +1,8 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
nixosConfig,
|
||||
...
|
||||
}:
|
||||
{ pkgs, lib, nixosConfig, ... }:
|
||||
let
|
||||
inherit (lib)
|
||||
mkMerge
|
||||
optionals
|
||||
elem
|
||||
mkIf
|
||||
flip
|
||||
concatMap
|
||||
;
|
||||
inherit (lib) mkMerge optionals elem mkIf flip concatMap;
|
||||
#from https://github.com/hyprwm/Hyprland/issues/3835
|
||||
float_script = pkgs.writeShellScript "hyprland-bitwarden-resize" ''
|
||||
float_script = pkgs.writeShellScript "hyprland-bitwarden-float" ''
|
||||
handle() {
|
||||
case $1 in
|
||||
windowtitle*)
|
||||
|
@ -37,7 +25,7 @@ let
|
|||
|
||||
hyprctl dispatch togglefloating address:0x$window_id
|
||||
hyprctl dispatch resizewindowpixel exact "512 768",address:0x$window_id
|
||||
hyprctl dispatch movewindowpixel exact "3800 -400",address:0x$window_id
|
||||
hyprctl dispatch movewindowpixel exact "$HYPRLAND_FLOAT_LOCATION",address:0x$window_id
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
@ -46,8 +34,7 @@ let
|
|||
# Listen to the Hyprland socket for events and process each line with the handle function
|
||||
${pkgs.socat}/bin/socat -U - UNIX-CONNECT:$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock | while read -r line; do handle "$line"; done
|
||||
'';
|
||||
in
|
||||
{
|
||||
in {
|
||||
wayland.windowManager.hyprland = {
|
||||
enable = true;
|
||||
settings = mkMerge [
|
||||
|
@ -70,9 +57,7 @@ in
|
|||
scroll_factor = 0.7;
|
||||
};
|
||||
};
|
||||
gestures = {
|
||||
workspace_swipe = true;
|
||||
};
|
||||
gestures = { workspace_swipe = true; };
|
||||
|
||||
general = {
|
||||
gaps_in = 0;
|
||||
|
@ -83,8 +68,7 @@ in
|
|||
focus_preferred_method = 1;
|
||||
workspace_center_on = 1;
|
||||
};
|
||||
bind =
|
||||
let
|
||||
bind = let
|
||||
monitor_binds = {
|
||||
"1" = "j";
|
||||
"2" = "d";
|
||||
|
@ -96,8 +80,7 @@ in
|
|||
"8" = "F3";
|
||||
"9" = "F4";
|
||||
};
|
||||
in
|
||||
[
|
||||
in [
|
||||
"SUPER,q,killactive,"
|
||||
"SUPER,return,fullscreen,"
|
||||
"SUPER,f,togglefloating"
|
||||
|
@ -146,16 +129,14 @@ in
|
|||
"CTRL,F9,exec,systemctl --user start swww-update-wallpaper"
|
||||
|
||||
"SUPER + SHIFT,q,exit"
|
||||
]
|
||||
++ flip concatMap (map toString (lib.lists.range 1 9)) (x: [
|
||||
] ++ flip concatMap (map toString (lib.lists.range 1 9)) (x: [
|
||||
"SUPER,${monitor_binds."${x}"},workspace,${x}"
|
||||
"SUPER + SHIFT,${monitor_binds."${x}"},movetoworkspacesilent,${x}"
|
||||
]);
|
||||
|
||||
cursor.no_warps = true;
|
||||
debug.disable_logs = false;
|
||||
env =
|
||||
[
|
||||
env = [
|
||||
"NIXOS_OZONE_WL,1"
|
||||
"MOZ_ENABLE_WAYLAND,1"
|
||||
"_JAVA_AWT_WM_NONREPARENTING,1"
|
||||
|
@ -164,8 +145,8 @@ in
|
|||
"GDK_BACKEND,wayland"
|
||||
"WLR_DRM_NO_ATOMIC,1" # retest on newest nvidia driver
|
||||
"XDG_SESSION_TYPE,wayland"
|
||||
]
|
||||
++ optionals (elem "nvidia" nixosConfig.services.xserver.videoDrivers) [
|
||||
] ++ optionals
|
||||
(elem "nvidia" nixosConfig.services.xserver.videoDrivers) [
|
||||
# See https://wiki.hyprland.org/Nvidia/
|
||||
"LIBVA_DRIVER_NAME,nvidia"
|
||||
"GBM_BACKEND,nvidia-drm"
|
||||
|
@ -242,6 +223,7 @@ in
|
|||
"8, monitor:HDMI-A-1, default: true"
|
||||
"9, monitor:HDMI-A-1"
|
||||
];
|
||||
env = [ "HYPRLAND_FLOAT_LOCATION,3800 -400" ];
|
||||
})
|
||||
(mkIf (nixosConfig.node.name == "patricknix") {
|
||||
monitor = [
|
||||
|
@ -261,6 +243,7 @@ in
|
|||
"8, monitor:eDP-1"
|
||||
"9, monitor:eDP-1"
|
||||
];
|
||||
env = [ "HYPRLAND_FLOAT_LOCATION,1400 200" ];
|
||||
})
|
||||
];
|
||||
extraConfig = ''
|
||||
|
|
|
@ -24,12 +24,12 @@ let
|
|||
</games>
|
||||
</minion>
|
||||
'';
|
||||
in
|
||||
{
|
||||
home.packages = [ pkgs.minion ];
|
||||
in {
|
||||
#home.packages = [ pkgs.minion ];
|
||||
# yet another program that uses the config file as a live state file
|
||||
# Why?
|
||||
home.activation.installMinionConfig = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||
home.activation.installMinionConfig =
|
||||
lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||
run mkdir -p .minion
|
||||
run cp -f ${cfgFile} .minion/minion.xml
|
||||
run chmod 640 .minion/minion.xml
|
||||
|
|
Loading…
Reference in a new issue