Allow user to provide a different configuration per host

This commit is contained in:
Oliver Traber 2024-05-27 20:57:26 +02:00
parent 82d5350ded
commit d8113f6228
Signed by: Bluemedia
GPG key ID: C0674B105057136C
10 changed files with 238 additions and 30 deletions

View file

@ -1,23 +1,26 @@
# Monitor configuration (see https://wiki.hyprland.org/Configuring/Monitors/)
monitor=,preferred,auto,auto
{% for monitor in hostvars[ansible_hostname]['monitors'] -%}
monitor=desc:{{ monitor['desc'] }}, {{ monitor['resolution'] }}, {{ monitor['position'] }}, 1
{% endfor %}
# Programs to use
$terminal = flatpak run org.wezfurlong.wezterm
$terminal = flatpak run --nosocket=wayland org.wezfurlong.wezterm
$menu = xfce4-appfinder --disable-server
# Default env vars
env = XCURSOR_SIZE,24
env = QT_QPA_PLATFORMTHEME,qt5ct
env = QT_QPA_PLATFORMTHEME,qt5ct # change to qt6ct if you have that
# For all categories, see https://wiki.hyprland.org/Configuring/Variables/
input {
kb_layout = de
kb_variant = nodeadkeys
numlock_by_default = 1
follow_mouse = 1
follow_mouse = 2
touchpad {
natural_scroll = enabled
natural_scroll = 1
}
sensitivity = 0 # -1.0 - 1.0, 0 means no modification.
@ -34,6 +37,7 @@ general {
layout = master
# Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on
allow_tearing = false
}
@ -86,36 +90,41 @@ misc {
force_default_wallpaper = 0 # Set to 0 or 1 to disable the anime mascot wallpapers
}
# Example windowrule v2
# windowrulev2 = float,class:^(kitty)$,title:^(kitty)$
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
windowrulev2 = nomaximizerequest, class:.*
windowrulev2 = suppressevent maximize, class:.*
windowrulev2 = idleinhibit fullscreen, class:.*
windowrulev2 = float,title:^(Application Finder)$
windowrulev2 = size 500 500,title:^(Application Finder)$
# Workspace rules
{% for workspace in hostvars[ansible_hostname]['workspaces'] -%}
workspace = {{ workspace['id'] }}{% if 'monitor' in workspace %}, monitor:desc:{{ workspace['monitor'] }}{% endif %}{% if 'default' in workspace %}, default:{{ workspace['default'] }}{% endif %}{% if 'layoutopt_orientation' in workspace %}, layoutopt:orientation:{{ workspace['layoutopt_orientation'] }}{% endif %}{% if 'on_created_empty' in workspace %}, on-created-empty:{{ workspace['on_created_empty'] }}{% endif %}
{% endfor %}
# Execute apps at launch
exec-once = systemctl --user import-environment DISPLAY WAYLAND_DISPLAY && hash dbus-update-activation-environment 2>/dev/null && dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK
exec-once = waybar
exec-once = swaybg -i ~/.config/background/background.png -m fill
{% if 'spotify' in role_names %}
exec-once = [workspace 9 silent] spotify --enable-features=UseOzonePlatform --ozone-platform=wayland
{% endif %}
exec-once = waybar & ~/.local/bin/hyprhelpr background & ~/.local/bin/hyprhelpr idle
{% if 'nextcloud' in role_names %}
exec-once = nextcloud --background
{% endif %}
{% for autostart in hostvars[ansible_hostname]['autostart'] -%}
exec-once = {% if 'workspace' in autostart %}[workspace {{ autostart['workspace'] }}] {% endif %}{{ autostart['command'] }}
{% endfor %}
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
$mainMod = SUPER
# Keybinds, see https://wiki.hyprland.org/Configuring/Binds/ for more
# Key binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
bind = $mainMod, Return, exec, $terminal
bind = $mainMod, D, exec, $menu
bind = $mainMod SHIFT, Q, killactive,
bind = $mainMod SHIFT, E, exit,
bind = $mainMod, F, fullscreen, 0
bind = $mainMod, V, togglefloating,
bind = $mainMod, L, exec, pa-loopback
#bind = $mainMod, P, pseudo, # dwindle
#bind = $mainMod, J, togglesplit, # dwindle
bind = $mainMod, L, exec, ~/.local/bin/hyprhelpr lock
bind = $mainMod, P, exec, ~/.local/bin/hyprhelpr powermenu
# Move focus with mainMod + arrow keys
bind = $mainMod, left, movefocus, l