diff options
Diffstat (limited to 'roles/hyprland')
| -rw-r--r-- | roles/hyprland/defaults/main.yml | 1 | ||||
| -rw-r--r-- | roles/hyprland/meta/argument_specs.yml | 9 | ||||
| -rw-r--r-- | roles/hyprland/tasks/main.yml | 16 | ||||
| -rw-r--r-- | roles/hyprland/templates/hypr/autostart.conf.j2 | 1 | ||||
| -rw-r--r-- | roles/hyprland/templates/hypr/kanshi.conf.j2 | 7 | ||||
| -rw-r--r-- | roles/hyprland/templates/hypr/monitors.conf.j2 | 17 | ||||
| -rw-r--r-- | roles/hyprland/templates/uwsm/env.j2 | 1 |
7 files changed, 35 insertions, 17 deletions
diff --git a/roles/hyprland/defaults/main.yml b/roles/hyprland/defaults/main.yml index b385f701..3781ee44 100644 --- a/roles/hyprland/defaults/main.yml +++ b/roles/hyprland/defaults/main.yml @@ -1,2 +1,3 @@ --- hyprland_nvidia: false +hyprland_gdk_scale: 1 diff --git a/roles/hyprland/meta/argument_specs.yml b/roles/hyprland/meta/argument_specs.yml index 917b9ff9..d5da1e36 100644 --- a/roles/hyprland/meta/argument_specs.yml +++ b/roles/hyprland/meta/argument_specs.yml @@ -6,3 +6,12 @@ argument_specs: type: "bool" default: false description: "Enable NVIDIA-specific environment variables for Wayland" + hyprland_gdk_scale: + type: "int" + default: 1 + description: "GDK_SCALE value exported via uwsm env; use 2 for HiDPI/4K displays with fractional scaling" + hyprland_kanshi_profiles: + type: "str" + description: >- + Raw kanshi profile config deployed to ~/.config/kanshi/config; + falls back to a generic single-monitor profile when unset diff --git a/roles/hyprland/tasks/main.yml b/roles/hyprland/tasks/main.yml index 7a25e7c2..d14b556c 100644 --- a/roles/hyprland/tasks/main.yml +++ b/roles/hyprland/tasks/main.yml @@ -11,6 +11,7 @@ - "hyprshot" - "satty" - "hyprland" + - "kanshi" state: "present" - name: "Ensure hyprland AUR packages are installed" @@ -50,7 +51,9 @@ - "/etc/hypr/scripts" - "/etc/xdg/uwsm" - "/etc/xdg/xdg-desktop-portal" + - "/etc/xdg/kanshi" - "{{ ansible_facts['env']['HOME'] }}/.config/hypr" + - "{{ ansible_facts['env']['HOME'] }}/.config/kanshi" - name: "Configure system defaults" become: true @@ -77,6 +80,8 @@ dest: "/etc/hypr/hypridle.conf" - src: "hypr/hyprland.conf.j2" dest: "/etc/hypr/hyprland.conf" + - src: "hypr/kanshi.conf.j2" + dest: "/etc/xdg/kanshi/config" - src: "uwsm/env.j2" dest: "/etc/xdg/uwsm/env" - src: "uwsm/env-hyprland.j2" @@ -108,6 +113,17 @@ # System defaults source = /etc/hypr/hypridle.conf + - name: "Configure user kanshi configuration" + ansible.builtin.blockinfile: + path: "{{ ansible_facts['env']['HOME'] }}/.config/kanshi/config" + state: "present" + prepend_newline: true + append_newline: true + marker: "# ==== {mark} ANSIBLE KANSHI CONFIG" + block: | + # System defaults + include /etc/xdg/kanshi/config + - name: "Copy hyprland scripts" become: true ansible.builtin.copy: diff --git a/roles/hyprland/templates/hypr/autostart.conf.j2 b/roles/hyprland/templates/hypr/autostart.conf.j2 index ec06c627..852e86ec 100644 --- a/roles/hyprland/templates/hypr/autostart.conf.j2 +++ b/roles/hyprland/templates/hypr/autostart.conf.j2 @@ -6,3 +6,4 @@ exec-once = uwsm-app -- waybar exec-once = uwsm-app -- swaybg -i ~/.config/hyprtheme/current/wallpaper -m fill exec-once = uwsm-app -- clipse -listen exec-once = uwsm app -- hyprsunset +exec-once = uwsm-app -- kanshi diff --git a/roles/hyprland/templates/hypr/kanshi.conf.j2 b/roles/hyprland/templates/hypr/kanshi.conf.j2 new file mode 100644 index 00000000..18161771 --- /dev/null +++ b/roles/hyprland/templates/hypr/kanshi.conf.j2 @@ -0,0 +1,7 @@ +{% if hyprland_kanshi_profiles is defined %} +{{ hyprland_kanshi_profiles }} +{% else %} +profile default { + output * mode preferred position 0,0 scale 1 +} +{% endif %} diff --git a/roles/hyprland/templates/hypr/monitors.conf.j2 b/roles/hyprland/templates/hypr/monitors.conf.j2 index 266cb0af..bfd5da29 100644 --- a/roles/hyprland/templates/hypr/monitors.conf.j2 +++ b/roles/hyprland/templates/hypr/monitors.conf.j2 @@ -1,20 +1,3 @@ # vim: set filetype=hyprlang.ansible : -# Configure Hyprland Monitors -# See https://wiki.hypr.land/Configuring/Monitors/ - -{% if hyprland_monitors is defined %} -{{ hyprland_monitors }} -{% else %} -# Optimized for retina-class 2x displays, like 13" 2.8K, 27" 5K, 32" 6K. -# env = GDK_SCALE,2 -# monitor=,preferred,auto,auto - -# Good compromise for 27" or 32" 4K monitors (but fractional!) -# env = GDK_SCALE,1.75 -# monitor=,preferred,auto,1.6 - -# Straight 1x setup for low-resolution displays like 1080p or 1440p -env = GDK_SCALE,1 monitor=,preferred,auto,1 -{% endif %} diff --git a/roles/hyprland/templates/uwsm/env.j2 b/roles/hyprland/templates/uwsm/env.j2 index 9a360ce6..f0a03b64 100644 --- a/roles/hyprland/templates/uwsm/env.j2 +++ b/roles/hyprland/templates/uwsm/env.j2 @@ -4,6 +4,7 @@ # See https://wiki.hypr.land/Configuring/Environment-variables/ export XCURSOR_SIZE=24 +export GDK_SCALE={{ hyprland_gdk_scale }} # Fix steam scaling export STEAM_FORCE_DESKTOPUI_SCALING=1.6 |
