hyprland: separate settings for user and host

This commit is contained in:
2025-11-27 15:33:23 +03:00
parent 7356fbe8f6
commit d934e358c0
8 changed files with 151 additions and 95 deletions
+27
View File
@@ -0,0 +1,27 @@
{ pkgs, lib, ... }: {
wayland.windowManager.hyprland = let
wallpaper = pkgs.fetchurl {
name = "miku_wallpaper.jpg";
url = "https://c.codrs.ru/pub/miku_wallpaper.jpeg?raw";
hash = "sha256-inK4X5KzQk5FHwDw2DYy43nm7XtXlC6I0S1PkYUv+3w=";
};
in {
settings = {
monitor = [
"DP-3 , 1920x1080@165, 0x0 , 1"
"HDMI-A-1, preferred , -1080x0, 1, transform, 1"
];
workspace = [
"1, monitor:DP-3, default:true"
"10, monitor:HDMI-A-1, default:true"
];
exec-once = [
"hyprctl dispatch workspace 1"
"${lib.getExe pkgs.swww} img -o HDMI-A-1 ${wallpaper}"
"${lib.getExe pkgs.linux-wallpaperengine} ~/.local/share/wpe/wallpaper --assets-dir ~/.local/share/wpe/assets --screen-root DP-3 --noautomute"
];
};
};
}
+44
View File
@@ -0,0 +1,44 @@
{ pkgs, lib, ...}: {
wayland.windowManager.hyprland = let
monitor-switcher = pkgs.writers.writeBashBin "monitor_switcher" /*bash*/ ''
MODE=$1
case $MODE in
"tv")
hyprctl keyword monitor "DP-3, 1920x1080@60, 3840x0, 1"
hyprctl keyword monitor "HDMI-A-1, 3840x2160@60, 0x0, 1"
notify-send "TV mode"
;;
"mirror")
hyprctl keyword monitor "HDMI-A-1, 3840x2160@60, 0x0, 1"
hyprctl keyword monitor "DP-3, preferred, auto, 1, mirror, HDMI-A-1"
notify-send "TV-only mode"
;;
"display"|*)
hyprctl keyword monitor "HDMI-A-1, disable"
hyprctl keyword monitor "DP-3, 3440x1440@165, 0x0, 1"
notify-send "Display mode"
;;
esac
'';
in {
settings = {
monitor = [
"DP-3, 3440x1440@165, auto-right, 1"
# "HDMI-A-1, 3840x2160@60, auto-left, 2"
"HDMI-A-1, disabled"
];
bind = [
'', XF86Calculator, exec, ghostty --title=pulsemixer -e pulsemixer''
''$mainMod, F1, exec, ${lib.getExe monitor-switcher} tv''
''$mainMod, F2, exec, ${lib.getExe monitor-switcher} mirror''
''$mainMod, F3, exec, ${lib.getExe monitor-switcher}''
];
};
};
}
+9
View File
@@ -0,0 +1,9 @@
{
wayland.windowManager.hyprland = {
settings = {
monitor = [
"eDP-1, 1920x1080@60, 0x0, 1"
];
};
};
}