mirror of
https://github.com/donovanglover/nix-config.git
synced 2024-11-22 00:03:55 +01:00
hyprland: Add script to toggle internal laptop display
The auto-left ensures that the external monitor is always on the right.
This commit is contained in:
parent
44a2f7e995
commit
837b37d834
@ -16,6 +16,7 @@ let
|
||||
randomBackgroundScript = "hypr/random-bg.fish";
|
||||
swapBackgroundScript = "hypr/swap-bg.fish";
|
||||
setBackgroundScript = "hypr/set-bg.fish";
|
||||
monitorScript = "hypr/monitor-script.fish";
|
||||
in
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
@ -280,6 +281,7 @@ in
|
||||
", XF86AudioMicMute, exec, ~/.config/${muteScript} Microphone @DEFAULT_AUDIO_SOURCE@"
|
||||
", XF86MonBrightnessDown, exec, brightnessctl set 5%- && ${vars.notifySend} \"Decreased brightness to\" \"$(brightnessctl get)\""
|
||||
", XF86MonBrightnessUp, exec, brightnessctl set +5% && ${vars.notifySend} \"Increased brightness to\" \"$(brightnessctl get)\""
|
||||
", XF86Display, exec, ~/.config/${monitorScript}"
|
||||
", XF86WLAN, exec, sleep 0.2 && ${vars.notifySend} \"WiFi\" \"$(nmcli radio wifi)\""
|
||||
];
|
||||
};
|
||||
@ -398,6 +400,19 @@ in
|
||||
'';
|
||||
};
|
||||
|
||||
xdg.configFile.${monitorScript} = {
|
||||
executable = true;
|
||||
text = /* fish */ ''
|
||||
#!/usr/bin/env fish
|
||||
|
||||
if test -n "$(hyprctl monitors -j | jq -r '.[] | select(.name | contains("eDP-1"))')"
|
||||
hyprctl keyword monitor eDP-1,disable
|
||||
else
|
||||
hyprctl keyword monitor eDP-1,preferred,auto-left,1
|
||||
end
|
||||
'';
|
||||
};
|
||||
|
||||
programs.hyprlock = {
|
||||
enable = true;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user