2026-09-05 19:45:18 +03:00
|
|
|
{ pkgs, lib, ... }:
|
|
|
|
|
let
|
|
|
|
|
hyprLua = import ../../../modules/user/hyprland/lua.nix { inherit lib; };
|
2025-11-27 15:33:23 +03:00
|
|
|
|
2026-09-05 19:45:18 +03:00
|
|
|
monitor-switcher = pkgs.writers.writeBashBin "monitor_switcher" /*bash*/ ''
|
|
|
|
|
MODE=$1
|
2025-11-27 15:33:23 +03:00
|
|
|
|
2026-09-05 19:45:18 +03:00
|
|
|
case $MODE in
|
|
|
|
|
"tv")
|
|
|
|
|
hyprctl eval 'hl.monitor({ output = "DP-3", mode = "1920x1080@60", position = "3840x0", scale = 1 })'
|
|
|
|
|
hyprctl eval 'hl.monitor({ output = "HDMI-A-1", mode = "3840x2160@60", position = "0x0", scale = 1 })'
|
|
|
|
|
notify-send "TV mode"
|
|
|
|
|
;;
|
2025-11-27 15:33:23 +03:00
|
|
|
|
2026-09-05 19:45:18 +03:00
|
|
|
"mirror")
|
|
|
|
|
hyprctl eval 'hl.monitor({ output = "HDMI-A-1", mode = "3840x2160@60", position = "0x0", scale = 1 })'
|
|
|
|
|
hyprctl eval 'hl.monitor({ output = "DP-3", mode = "preferred", position = "auto", scale = 1, mirror = "HDMI-A-1" })'
|
|
|
|
|
notify-send "TV-only mode"
|
|
|
|
|
;;
|
2025-11-27 15:33:23 +03:00
|
|
|
|
2026-09-05 19:45:18 +03:00
|
|
|
"display"|*)
|
|
|
|
|
hyprctl eval 'hl.monitor({ output = "HDMI-A-1", disabled = true })'
|
|
|
|
|
hyprctl eval 'hl.monitor({ output = "DP-3", mode = "3440x1440@165", position = "0x0", scale = 1 })'
|
|
|
|
|
notify-send "Display mode"
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
'';
|
|
|
|
|
in {
|
|
|
|
|
wayland.windowManager.hyprland.settings = {
|
|
|
|
|
monitor = [
|
|
|
|
|
{
|
|
|
|
|
output = "DP-3";
|
|
|
|
|
mode = "3440x1440@165";
|
|
|
|
|
position = "auto-right";
|
|
|
|
|
scale = 1;
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
output = "HDMI-A-1";
|
|
|
|
|
disabled = true;
|
|
|
|
|
}
|
|
|
|
|
];
|
2025-11-27 15:33:23 +03:00
|
|
|
|
2026-09-05 19:45:18 +03:00
|
|
|
bind = [
|
|
|
|
|
(hyprLua.bind "XF86Calculator" (hyprLua.exec "ghostty --title=pulsemixer -e pulsemixer"))
|
|
|
|
|
(hyprLua.bind "SUPER + F1" (hyprLua.exec "${lib.getExe monitor-switcher} tv"))
|
|
|
|
|
(hyprLua.bind "SUPER + F2" (hyprLua.exec "${lib.getExe monitor-switcher} mirror"))
|
|
|
|
|
(hyprLua.bind "SUPER + F3" (hyprLua.exec "${lib.getExe monitor-switcher}"))
|
|
|
|
|
];
|
2025-11-27 15:33:23 +03:00
|
|
|
};
|
2026-09-05 19:45:18 +03:00
|
|
|
}
|