From 9eb052ff02fd4d1ea55af86e5ea2b88d0d264371 Mon Sep 17 00:00:00 2001 From: tux Date: Tue, 16 Sep 2025 22:36:03 +0530 Subject: [PATCH] feat: add shell aliases for monitor --- modules/home/desktop/hyprland/default.nix | 2 +- modules/nixos/desktop/hyprland/default.nix | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/modules/home/desktop/hyprland/default.nix b/modules/home/desktop/hyprland/default.nix index a0c850a..0a6c9f8 100644 --- a/modules/home/desktop/hyprland/default.nix +++ b/modules/home/desktop/hyprland/default.nix @@ -31,7 +31,7 @@ in { #-- Output # See https://wiki.hyprland.org/Configuring/Monitors - monitor = "eDP-1,2560x1440@90,auto,1"; + monitor = "eDP-1,2560x1440@90,0x0,1"; #-- Input: Keyboard, Mouse, Touchpad input = { diff --git a/modules/nixos/desktop/hyprland/default.nix b/modules/nixos/desktop/hyprland/default.nix index 44c449f..d083868 100644 --- a/modules/nixos/desktop/hyprland/default.nix +++ b/modules/nixos/desktop/hyprland/default.nix @@ -4,4 +4,17 @@ package = pkgs.hyprland-git.hyprland; portalPackage = pkgs.hyprland-git.xdg-desktop-portal-hyprland; }; + + environment.systemPackages = [ + (pkgs.writeShellScriptBin "mirror-display" '' + hyprctl keyword monitor "HDMI-A-1,preferred,0x0,1,mirror,eDP-1" \ + && astal -q \ + && ${pkgs.tpanel}/bin/tpanel & + '') + (pkgs.writeShellScriptBin "extend-display" '' + hyprctl keyword monitor "HDMI-A-1,preferred,0x-1440,1" \ + && astal -q \ + && ${pkgs.tpanel}/bin/tpanel & + '') + ]; }