From d5cbb677e1e5ce81a301de1263d55c9a35f09157 Mon Sep 17 00:00:00 2001 From: Tigor Hutasuhut Date: Wed, 14 Aug 2024 23:13:14 +0700 Subject: [PATCH] lazygit: add lazygit to the list of programs that should be floating and centered --- home/modules/hyprland/hyprland.nix | 16 ++++++++++------ home/programs/foot.nix | 14 ++++++++++++++ 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/home/modules/hyprland/hyprland.nix b/home/modules/hyprland/hyprland.nix index 8caa1c5..835af2e 100644 --- a/home/modules/hyprland/hyprland.nix +++ b/home/modules/hyprland/hyprland.nix @@ -40,6 +40,11 @@ in layout = "dwindle"; }; + master = { + mfact = 0.75; + new_status = "inherit"; + }; + dwindle = { pseudotile = true; preserve_split = true; @@ -84,12 +89,7 @@ in # https://wiki.hyprland.org/Configuring/Binds bind = [ # Programs - ( - if config.profile.home.programs.zellij.enable then - ''$mod, RETURN, exec, foot'' - else - ''$mod, RETURN, exec, wezterm'' - ) + ''$mod, RETURN, exec, foot'' "$mod, E, exec, thunar" "$mod, B, exec, microsoft-edge" "$mod, D, exec, rofi -show drun -replace -i" @@ -220,6 +220,10 @@ in config.profile.whatsapp.window_rule ''opaque,title:(.*)(- YouTube)(.*)$'' ''opaque,class:^(mpv)$'' + ''float,class:^(lazygit)$'' + ''center,class:^(lazygit)$'' + ''size 90% 90%,class:^(lazygit)$'' + ''stayfocused,class:^(lazygit)$'' ]; }; extraConfig = /*hyprlang*/ '' diff --git a/home/programs/foot.nix b/home/programs/foot.nix index 6e1af49..0f45d4d 100644 --- a/home/programs/foot.nix +++ b/home/programs/foot.nix @@ -20,5 +20,19 @@ in }; }; }; + + programs.zsh.initExtra = /*bash*/ '' + function osc7-pwd() { + emulate -L zsh # also sets localoptions for us + setopt extendedglob + local LC_ALL=C + printf '\e]7;file://%s%s\e\' $HOST ''${PWD//(#m)([^@-Za-z&-;_~])/%''${(l:2::0:)$(([##16]#MATCH))}} + } + + function chpwd-osc7-pwd() { + (( ZSH_SUBSHELL )) || osc7-pwd + } + add-zsh-hook -Uz chpwd chpwd-osc7-pwd + ''; }; }