From df0c9ea90516b64fde9179407e895d4094bdd82d Mon Sep 17 00:00:00 2001 From: Fabio Scotto di Santolo Date: Sat, 28 Mar 2026 20:09:50 +0100 Subject: [PATCH] Add Hyprland support for nymph: packages, repo, dotfiles, and emptty session --- .yamllint | 13 ++ ansible/inventory/host_vars/nymph.yml | 18 ++ ansible/roles/packages_void/tasks/main.yml | 39 +++- .../profile_desktop_i3/files/Hyprland.desktop | 8 + .../roles/profile_desktop_i3/tasks/main.yml | 13 ++ dotfiles/nymph/.config/hypr/hyprland.conf | 193 ++++++++++++++++++ dotfiles/nymph/.config/hypr/hyprpaper.conf | 4 + dotfiles/nymph/.config/waybar/config.jsonc | 146 +++++++++++++ dotfiles/nymph/.config/waybar/style.css | 107 ++++++++++ 9 files changed, 535 insertions(+), 6 deletions(-) create mode 100644 .yamllint create mode 100644 ansible/roles/profile_desktop_i3/files/Hyprland.desktop create mode 100644 dotfiles/nymph/.config/hypr/hyprland.conf create mode 100644 dotfiles/nymph/.config/hypr/hyprpaper.conf create mode 100644 dotfiles/nymph/.config/waybar/config.jsonc create mode 100644 dotfiles/nymph/.config/waybar/style.css diff --git a/.yamllint b/.yamllint new file mode 100644 index 0000000..3a706d5 --- /dev/null +++ b/.yamllint @@ -0,0 +1,13 @@ +--- +extends: default + +rules: + line-length: + max: 120 + level: warning + + comments-indentation: disable + document-start: disable + +ignore: | + ansible/roles/**/files/*.desktop diff --git a/ansible/inventory/host_vars/nymph.yml b/ansible/inventory/host_vars/nymph.yml index 3d083df..9c2c6ca 100644 --- a/ansible/inventory/host_vars/nymph.yml +++ b/ansible/inventory/host_vars/nymph.yml @@ -1,6 +1,13 @@ --- hostname: nymph +host_xbps_repositories: + - name: hyprland-void + url: "https://raw.githubusercontent.com/Makrennel/hyprland-void/repository-x86_64-glibc" + +host_emptty_wayland_sessions: + - Hyprland.desktop + host_packages: - nvidia - mesa-dri @@ -9,6 +16,11 @@ host_packages: - intel-video-accel - tlp - tlp-rdw + - hyprland + - hyprpaper + - xdg-desktop-portal-hyprland + - waybar + - wlogout host_enabled_services: - tlp @@ -17,3 +29,9 @@ host_dotfiles: - src: .config/autorandr/ dest: .config/autorandr/ mode: preserve + - src: .config/hypr/ + dest: .config/hypr/ + mode: preserve + - src: .config/waybar/ + dest: .config/waybar/ + mode: preserve diff --git a/ansible/roles/packages_void/tasks/main.yml b/ansible/roles/packages_void/tasks/main.yml index 854ff15..df68525 100644 --- a/ansible/roles/packages_void/tasks/main.yml +++ b/ansible/roles/packages_void/tasks/main.yml @@ -1,22 +1,49 @@ --- +- name: Ensure XBPS extra repositories directory exists + tags: [packages] + ansible.builtin.file: + path: /etc/xbps.d + state: directory + mode: "0755" + when: (host_xbps_repositories | default([])) | length > 0 + +- name: Configure host-specific XBPS repositories + tags: [packages] + ansible.builtin.copy: + dest: "/etc/xbps.d/{{ item.name }}.conf" + content: | + repository={{ item.url }} + owner: root + group: root + mode: "0644" + loop: "{{ host_xbps_repositories | default([]) }}" + loop_control: + label: "{{ item.name }}" + register: host_xbps_repository_configs + when: (host_xbps_repositories | default([])) | length > 0 + - name: Install Void nonfree repository if needed tags: [packages] community.general.xbps: name: void-repo-nonfree state: present - update_cache: true + update_cache: false + register: void_nonfree_repository when: "'void-repo-nonfree' in (host_packages | default([]) + void_packages_base | default([]))" -- name: Refresh XBPS cache after enabling nonfree repository +- name: Refresh XBPS cache after configuring repositories tags: [packages] - ansible.builtin.command: xbps-install -S - changed_when: false - when: "'void-repo-nonfree' in (host_packages | default([]) + void_packages_base | default([]))" + community.general.xbps: + update_cache: true + accept_pubkey: true + when: >- + (host_xbps_repositories | default([])) | length > 0 + or (void_nonfree_repository is defined and void_nonfree_repository is changed) - name: Synchronize and upgrade Void Linux packages tags: [packages] community.general.xbps: - update_cache: true + update_cache: false upgrade: true - name: Install packages on Void Linux diff --git a/ansible/roles/profile_desktop_i3/files/Hyprland.desktop b/ansible/roles/profile_desktop_i3/files/Hyprland.desktop new file mode 100644 index 0000000..f75dca0 --- /dev/null +++ b/ansible/roles/profile_desktop_i3/files/Hyprland.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Name=Hyprland +Comment=Hyprland Wayland compositor +Exec=Hyprland +TryExec=Hyprland +Type=Application +DesktopNames=Hyprland +Keywords=wayland;wm;windowmanager;window;manager;tiling;compositor; diff --git a/ansible/roles/profile_desktop_i3/tasks/main.yml b/ansible/roles/profile_desktop_i3/tasks/main.yml index eaf9a57..279abac 100644 --- a/ansible/roles/profile_desktop_i3/tasks/main.yml +++ b/ansible/roles/profile_desktop_i3/tasks/main.yml @@ -126,6 +126,19 @@ group: root mode: "0644" +- name: Install host-specific Wayland sessions for emptty + tags: [packages, services, emptty, hyprland] + ansible.builtin.copy: + src: "{{ item }}" + dest: "/etc/emptty/wayland-sessions/{{ item }}" + owner: root + group: root + mode: "0644" + loop: "{{ host_emptty_wayland_sessions | default([]) }}" + loop_control: + label: "{{ item }}" + when: (host_emptty_wayland_sessions | default([])) | length > 0 + - name: Configure emptty tags: [packages, services, emptty] ansible.builtin.template: diff --git a/dotfiles/nymph/.config/hypr/hyprland.conf b/dotfiles/nymph/.config/hypr/hyprland.conf new file mode 100644 index 0000000..04924e3 --- /dev/null +++ b/dotfiles/nymph/.config/hypr/hyprland.conf @@ -0,0 +1,193 @@ +############################################# +# HYPRLAND CONFIG +# ThinkPad T480 (Intel + NVIDIA) +# Intel primary GPU + NVIDIA offload +############################################# + +################ +# Variables +################ + +$mod = SUPER + +#$terminal = WINIT_UNIX_BACKEND=x11 ~/.local/bin/nvidia-run alacritty +$terminal = alacritty +$menu = rofi -show drun -config ~/.config/rofi/config.rasi +$powermenu = ~/.local/bin/powermenu + +################ +# Autostart +################ + +exec-once = hyprpaper +exec-once = waybar +exec-once = dunst + +################ +# Environment +################ + +env = AQ_DRM_DEVICES,/dev/dri/card0:/dev/dri/card1 +env = __GLX_VENDOR_LIBRARY_NAME,nvidia +env = GBM_BACKEND,nvidia-drm +env = LIBVA_DRIVER_NAME,iHD +env = WLR_NO_HARDWARE_CURSORS,1 + +################ +# Monitor +################ + +monitor = ,preferred,auto,1 + +################ +# Input +################ + +input { + + kb_layout = us + kb_variant = alt-intl + + follow_mouse = 1 + sensitivity = 0 + + touchpad { + natural_scroll = true + } + +} + +################ +# General +################ + +general { + + layout = master + + gaps_in = 6 + gaps_out = 10 + + border_size = 1 + + col.active_border = rgb(ffffff) + col.inactive_border = rgb(1a1a1a) + + allow_tearing = false +} + +################ +# Master layout +################ + +master { + + new_status = master + mfact = 0.55 + inherit_fullscreen = true + +} + +################ +# Decoration +################ + +decoration { + + rounding = 0 + + blur { + enabled = false + } + +} + +################ +# Animations +################ + +animations { + + enabled = yes + + bezier = easeOut, 0.16, 1, 0.3, 1 + + animation = windows,1,4,easeOut + animation = fade,1,4,easeOut + animation = workspaces,1,4,easeOut +} + +################ +# Misc +################ + +misc { + + disable_hyprland_logo = true + disable_splash_rendering = true + +} + +################ +# Window rules +################ + +windowrulev2 = opacity 0.96 0.96,class:^(Alacritty)$ +windowrulev2 = float,class:^(Rofi)$ + +################ +# Keybinds +################ + +# Terminal +bind = $mod, Return, exec, $terminal + +# Launcher +bind = $mod, D, exec, $menu + +# Powermenu +bind = $mod, Escape, exec, $powermenu + +# Exit Hyprland (default) +bind = $mod SHIFT, E, exit + +# Close window +bind = $mod, Q, killactive + +# Fullscreen +bind = $mod, F, fullscreen, 1 + +# Floating +bind = $mod, Space, togglefloating + +################ +# Focus movement +################ + +bind = $mod, H, movefocus, l +bind = $mod, L, movefocus, r +bind = $mod, K, movefocus, u +bind = $mod, J, movefocus, d + +################ +# Master navigation +################ + +bind = $mod, J, layoutmsg, cyclenext +bind = $mod, K, layoutmsg, cycleprev + +################ +# Workspaces +################ + +bind = $mod, 1, workspace, 1 +bind = $mod, 2, workspace, 2 +bind = $mod, 3, workspace, 3 +bind = $mod, 4, workspace, 4 +bind = $mod, 5, workspace, 5 + +bind = $mod SHIFT, 1, movetoworkspace, 1 +bind = $mod SHIFT, 2, movetoworkspace, 2 +bind = $mod SHIFT, 3, movetoworkspace, 3 +bind = $mod SHIFT, 4, movetoworkspace, 4 +bind = $mod SHIFT, 5, movetoworkspace, 5 diff --git a/dotfiles/nymph/.config/hypr/hyprpaper.conf b/dotfiles/nymph/.config/hypr/hyprpaper.conf new file mode 100644 index 0000000..e213d3a --- /dev/null +++ b/dotfiles/nymph/.config/hypr/hyprpaper.conf @@ -0,0 +1,4 @@ +preload = ~/Pictures/wallpapers/gargantua-black-hyprland.png +wallpaper = ,~/Pictures/wallpapers/gargantua-black-hyprland.png +splash = false +ipc = on diff --git a/dotfiles/nymph/.config/waybar/config.jsonc b/dotfiles/nymph/.config/waybar/config.jsonc new file mode 100644 index 0000000..6da7e1d --- /dev/null +++ b/dotfiles/nymph/.config/waybar/config.jsonc @@ -0,0 +1,146 @@ +{ + "layer": "top", + "position": "top", + "height": 28, + "spacing": 4, + + "modules-left": [ + "hyprland/workspaces" + ], + + "modules-center": [ + "custom/music" + ], + + "modules-right": [ + "temperature", + "memory", + "cpu", + //"pulseaudio", + "backlight", + "network", + "bluetooth", + "battery", + "clock", + "custom/powermenu", + "tray" + ], + + "hyprland/workspaces": { + "disable-scroll": true, + "all-outputs": true, + "format": "{name}", + "on-click": "activate", + "persistent-workspaces": { + "*": [1, 2, 3, 4, 5] + } + }, + + "backlight": { + "device": "intel_backlight", + "on-scroll-up": "light -A 5", + "on-scroll-down": "light -U 5", + "format": "{percent}% {icon}", + "format-icons": ["", "", "", "", "", "", "", "", ""] + }, + + "pulseaudio": { + "scroll-step": 1, + "format": "{volume}% {icon}", + "format-muted": "mute ", + "format-icons": { + "headphone": "", + "phone": "", + "portable": "", + "car": "", + "default": ["", "", ""] + }, + "on-click": "pavucontrol", + "tooltip": false + }, + + "battery": { + "interval": 10, + "states": { + "warning": 20, + "critical": 10 + }, + "format": "{capacity}% {icon}", + "format-charging": "{capacity}% 󰂄", + "format-plugged": "{capacity}% ", + "format-alt": "{time} {icon}", + "format-icons": ["󰁺", "󰁻", "󰁼", "󰁽", "󰁾", "󰁿", "󰂀", "󰂁", "󰂂"] + }, + + "clock": { + "interval": 1, + "timezone": "Europe/Rome", + "format": "{:%H:%M}", + "tooltip-format": "{:%Y %B}\n{calendar}", + "format-alt": "{:%A %d/%m/%Y}" + }, + + "memory": { + "interval": 1, + "format": "{percentage}% ", + "states": { + "warning": 85 + } + }, + + "cpu": { + "interval": 1, + "format": "{usage}% ", + "tooltip": false + }, + + "network": { + "interval": 1, + "tooltip": true, + "format-wifi": "{icon}", + "format-ethernet": "{icon}", + "format-linked": "󰈁", + "format-icons": ["󰤟", "󰤢", "󰤥", "󰤨"], + "format-disconnected": "󰈂", + "tooltip-format": "{ifname}", + "tooltip-format-wifi": "{essid} ({signalStrength}%) ", + "tooltip-format-ethernet": "{ifname} ", + "tooltip-format-disconnected": "Disconnected", + "on-click": "nm-connection-editor" + }, + + "temperature": { + "critical-threshold": 80, + "format": "{temperatureC}°C ", + "tooltip": false + }, + + "custom/powermenu": { + "format": "", + "on-click": "~/.local/bin/powermenu", + "tooltip": false + }, + + "tray": { + "icon-size": 15, + "spacing": 6 + }, + + "bluetooth": { + "format": "", + "format-connected": "{device_alias} ", + "format-connected-battery": "{device_alias} {device_battery_percentage}% ", + "format-off": "󰂲", + "tooltip-format": "{controller_alias}\t{controller_address}\n\n{num_connections} connected", + "tooltip-format-connected": "{controller_alias}\t{controller_address}\n\n{num_connections} connected\n\n{device_enumerate}", + "tooltip-format-enumerate-connected": "{device_alias}\t{device_address}", + "tooltip-format-enumerate-connected-battery": "{device_alias}\t{device_address}\t{device_battery_percentage}%", + "on-click": "blueman-manager" + }, + + "custom/music": { + "format": "{}", + "return-type": "json", + "exec": "waybar-module-music" + } +} diff --git a/dotfiles/nymph/.config/waybar/style.css b/dotfiles/nymph/.config/waybar/style.css new file mode 100644 index 0000000..96baad3 --- /dev/null +++ b/dotfiles/nymph/.config/waybar/style.css @@ -0,0 +1,107 @@ +* { + border: none; + border-radius: 0; + min-height: 0; + padding: 0; + margin: 0; + font-family: "Liberation Mono", "Font Awesome 6 Free", "Font Awesome 6 Brands", monospace; + font-size: 12px; +} + +window#waybar { + background: #000000; + color: #dcdcdc; + border-bottom: 1px solid #101010; +} + +/* blocchi principali */ +#workspaces, +#custom-music, +#temperature, +#memory, +#cpu, +#pulseaudio, +#backlight, +#network, +#bluetooth, +#battery, +#clock, +#custom-powermenu, +#tray { + font-size: 16px; + padding: 0 8px; + margin: 3px 0; +} + +/* workspaces */ +#workspaces { + padding-left: 10px; +} + +#workspaces button { + background: transparent; + color: #6f6f6f; + padding: 0 7px; + margin: 0 2px; + border-bottom: 1px solid transparent; +} + +#workspaces button:hover { + color: #dcdcdc; + background: transparent; +} + +#workspaces button.active { + color: #ffffff; + border-bottom: 1px solid #ffffff; +} + +#workspaces button.urgent { + color: #ffffff; + background: #0f0f0f; +} + +/* centro */ +#custom-music { + color: #bfbfbf; +} + +/* moduli destra */ +#temperature, +#memory, +#cpu, +#pulseaudio, +#backlight, +#network, +#bluetooth, +#battery { + color: #d0d0d0; +} + +/* clock e power leggermente più evidenti */ +#clock, +#custom-powermenu { + color: #ffffff; +} + +#clock { + letter-spacing: 0.5px; + padding: 0 12px; +} + +#custom-powermenu { + padding-left: 12px; + padding-right: 12px; +} + +#tray { + padding-right: 12px; +} + +/* tooltip */ +tooltip { + background: #000000; + border: 1px solid #ffffff; + color: #e6e6e6; + padding: 10px; +}