Move laptop-specific config out of defaults
This commit is contained in:
parent
38f69c47e3
commit
74bbc85aeb
2 changed files with 28 additions and 17 deletions
|
|
@ -1,8 +1,34 @@
|
||||||
{ lib, ... }:
|
{ lib, pkgs, ... }:
|
||||||
|
let
|
||||||
|
|
||||||
|
internal_display_settings = "eDP-1,preferred,auto,1.6";
|
||||||
|
clamshell_script = pkgs.writeShellScriptBin "clamshell" ''
|
||||||
|
if ${pkgs.hyprland}/bin/hyprctl monitors | ${pkgs.ripgrep}/bin/rg -q '\sDP-'; then
|
||||||
|
echo "Detected external monitor..."
|
||||||
|
if [[ "$1" == "open" ]]; then
|
||||||
|
${pkgs.hyprland}/bin/hyprctl keyword monitor ${internal_display_settings}
|
||||||
|
else
|
||||||
|
${pkgs.hyprland}/bin/hyprctl keyword monitor "eDP-1,disable"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
in
|
||||||
{
|
{
|
||||||
aa.isHeadless = false;
|
aa.isHeadless = false;
|
||||||
aa.windowManagers.sway.clamshell.enable = true;
|
aa.windowManagers.sway.clamshell.enable = true;
|
||||||
aa.programs.opencode.enable = true;
|
aa.programs.opencode.enable = true;
|
||||||
aa.windowManagers.hyprland.enable = true;
|
aa.windowManagers.hyprland = {
|
||||||
|
enable = true;
|
||||||
|
monitor = [
|
||||||
|
"eDP-1,preferred,auto,1.6"
|
||||||
|
"desc:Dell Inc. DELL U4025QW BH2F734,3440x1440,auto,1"
|
||||||
|
",preferred,auto,1"
|
||||||
|
];
|
||||||
|
};
|
||||||
aa.windowManagers.sway.enable = lib.mkForce false;
|
aa.windowManagers.sway.enable = lib.mkForce false;
|
||||||
|
|
||||||
|
wayland.windowManager.hyprland.settings.bindl = [
|
||||||
|
", switch:off:Lid Switch, exec, ${clamshell_script}/bin/clamshell open"
|
||||||
|
", switch:on:Lid Switch, exec, ${clamshell_script}/bin/clamshell close"
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,18 +24,6 @@ let
|
||||||
emoji_picker = "${pkgs.bemoji}/bin/bemoji -t";
|
emoji_picker = "${pkgs.bemoji}/bin/bemoji -t";
|
||||||
terminal = "${pkgs.kitty}/bin/kitty";
|
terminal = "${pkgs.kitty}/bin/kitty";
|
||||||
|
|
||||||
internal_display_settings = "eDP-1,preferred,auto,1.6";
|
|
||||||
clamshell_script = pkgs.writeShellScriptBin "clamshell" ''
|
|
||||||
if ${pkgs.hyprland}/bin/hyprctl monitors | ${pkgs.ripgrep}/bin/rg -q '\sDP-'; then
|
|
||||||
echo "Detected external monitor..."
|
|
||||||
if [[ "$1" == "open" ]]; then
|
|
||||||
${pkgs.hyprland}/bin/hyprctl keyword monitor ${internal_display_settings}
|
|
||||||
else
|
|
||||||
${pkgs.hyprland}/bin/hyprctl keyword monitor "eDP-1,disable"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
'';
|
|
||||||
|
|
||||||
generate_grim_command = target: ''
|
generate_grim_command = target: ''
|
||||||
exec mkdir -p ~/screenshots \
|
exec mkdir -p ~/screenshots \
|
||||||
&& ${pkgs.grim}/bin/grim -g "$(${pkgs.slurp}/bin/slurp)" \
|
&& ${pkgs.grim}/bin/grim -g "$(${pkgs.slurp}/bin/slurp)" \
|
||||||
|
|
@ -58,7 +46,6 @@ in
|
||||||
monitor = mkOption {
|
monitor = mkOption {
|
||||||
type = types.listOf types.str;
|
type = types.listOf types.str;
|
||||||
default = [
|
default = [
|
||||||
"eDP-1,preferred,auto,1.6"
|
|
||||||
",preferred,auto,1"
|
",preferred,auto,1"
|
||||||
];
|
];
|
||||||
description = ''
|
description = ''
|
||||||
|
|
@ -253,8 +240,6 @@ in
|
||||||
", XF86AudioPlay, exec, ${pkgs.playerctl}/bin/playerctl play-pause"
|
", XF86AudioPlay, exec, ${pkgs.playerctl}/bin/playerctl play-pause"
|
||||||
", XF86MonBrightnessDown, exec, ${pkgs.light}/bin/light -U 5"
|
", XF86MonBrightnessDown, exec, ${pkgs.light}/bin/light -U 5"
|
||||||
", XF86MonBrightnessUp, exec, ${pkgs.light}/bin/light -A 5"
|
", XF86MonBrightnessUp, exec, ${pkgs.light}/bin/light -A 5"
|
||||||
", switch:off:Lid Switch, exec, ${clamshell_script}/bin/clamshell open"
|
|
||||||
", switch:on:Lid Switch, exec, ${clamshell_script}/bin/clamshell close"
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue