Add hyprland

This commit is contained in:
Morten Olsen
2024-10-09 14:30:41 +02:00
parent f62c1d7d25
commit f8c6ffee46
22 changed files with 515 additions and 1 deletions

View File

@@ -0,0 +1,2 @@
install_with_root: true
desktop_dunst_pkgs: []

View File

@@ -0,0 +1,3 @@
---
dependencies:
- role: base_info

View File

@@ -0,0 +1,44 @@
---
- name: "Load vars"
ansible.builtin.include_vars: "{{ item }}"
tags:
- install
with_first_found:
- files:
- "{{ ansible_distribution }}-{{ ansible_distribution_release }}.yml"
- "{{ ansible_distribution }}.yml"
- "{{ ansible_os_family }}.yml"
- default.yml
paths: ../vars
skip: true
- name: "Install dependencies"
tags:
- install
when: desktop_dunst_pkgs
become: "{{ install_with_root }}"
ansible.builtin.package:
name: "{{ desktop_dunst_pkgs }}"
- name: "Ensure dir"
tags:
- config
ansible.builtin.file:
path: "{{ home }}/.config/dunst"
state: directory
mode: "0700"
owner: "{{ username }}"
- name: "Copy templates"
tags:
- config
ansible.builtin.template:
src: "{{ item.src }}"
dest: "{{ home }}/.config/dunst/{{ item.path | regex_replace('\\.j2$', '') }}"
mode: "{{ item.mode }}"
owner: "{{ username }}"
with_community.general.filetree:
- ../templates
loop_control:
label: "{{ item.path }}"
when: item.state == 'file'

View File

@@ -0,0 +1,55 @@
[global]
follow = mouse
indicate_hidden = yes
offset = 10x10
notification_height = 0
separator_height = 2
padding = 8
horizontal_padding = 8
text_icon_padding = 0
frame_width = 2
frame_color = "#f5c2e7"
separator_color = frame
sort = yes
idle_threshold = 120
font = monospace 10
line_height = 0
markup = full
alignment = left
vertical_alignment = center
show_age_threshold = 60
word_wrap = yes
stack_duplicates = true
hide_duplicate_count = false
show_indicators = yes
min_icon_size = 0
max_icon_size = 64
icon_path = /usr/share/icons/Papirus-Dark/16x16/status/:/usr/share/icons/Papirus-Dark/16x16/devices/:/usr/share/icons/Papirus-Dark/16x16/actions/:/usr/share/icons/Papirus-Dark/16x16/animations/:/usr/share/icons/Papirus-Dark/16x16/apps/:/usr/share/icons/Papirus-Dark/16x16/categories/:/usr/share/icons/Papirus-Dark/16x16/emblems/:/usr/share/icons/Papirus-Dark/16x16/emotes/:/usr/share/icons/Papirus-Dark/16x16/devices/mimetypes:/usr/share/icons/Papirus-Dark/16x16/panel/:/usr/share/icons/Papirus-Dark/16x16/places/
dmenu = /usr/bin/wofi -p dunst:
browser = /usr/bin/firefox --new-tab
title = Dunst
class = Dunst
corner_radius = 10
timeout = 5
[urgency_low]
background = "#1E1E2E"
foreground = "#CDD6F4"
[urgency_normal]
background = "#1E1E2E"
foreground = "#CDD6F4"
[urgency_critical]
background = "#1E1E2E"
foreground = "#CDD6F4"
frame_color = "#FAB387"

View File

@@ -0,0 +1,3 @@
---
desktop_hyprland_pkgs:
- dunst

View File

@@ -0,0 +1,2 @@
install_with_root: true
desktop_hyperland_pkgs: []

View File

@@ -0,0 +1,5 @@
---
dependencies:
- role: base_info
- role: desktop_dunst
- role: desktop_kitty

View File

@@ -0,0 +1,44 @@
---
- name: "Load vars"
ansible.builtin.include_vars: "{{ item }}"
tags:
- install
with_first_found:
- files:
- "{{ ansible_distribution }}-{{ ansible_distribution_release }}.yml"
- "{{ ansible_distribution }}.yml"
- "{{ ansible_os_family }}.yml"
- default.yml
paths: ../vars
skip: true
- name: "Install dependencies"
tags:
- install
when: desktop_hyprland_pkgs
become: "{{ install_with_root }}"
ansible.builtin.package:
name: "{{ desktop_hyprland_pkgs }}"
- name: "Ensure dir"
tags:
- config
ansible.builtin.file:
path: "{{ home }}/.config/hypr"
state: directory
mode: "0700"
owner: "{{ username }}"
- name: "Copy templates"
tags:
- config
ansible.builtin.template:
src: "{{ item.src }}"
dest: "{{ home }}/.config/hypr/{{ item.path | regex_replace('\\.j2$', '') }}"
mode: "{{ item.mode }}"
owner: "{{ username }}"
with_community.general.filetree:
- ../templates
loop_control:
label: "{{ item.path }}"
when: item.state == 'file'

View File

@@ -0,0 +1,21 @@
env = XDG_CURRENT_DESKTOP,Hyprland
env = XDG_SESSION_TYPE,wayland
env = XDG_SESSION_DESKTOP,Hyprland
env = GDK_BACKEND,wayland
env = QT_QPA_PLATFORM,wayland
env = QT_QPA_PLATFORMTHEME,qt5ct #env = QT_STYLE_OVERRIDE,kvantum
env = QT_WAYLAND_DISABLE_WINDOWDECORATION,1
env = QT_AUTO_SCREEN_SCALE_FACTOR,1
env = QT_WAYLAND_DISABLE_WINDOWDECORATION,1
env = SDL_VIDEODRIVER,wayland
env = _JAVA_AWT_WM_NONREPARENTING,1
env = WLR_NO_HARDWARE_CURSORS,1
env = MOZ_DISABLE_RDD_SANDBOX,1
env = MOZ_ENABLE_WAYLAND,1
env = OZONE_PLATFORM,wayland
# env = wallpaper_path,$HOME/.wallpapers #set wallpaper path

View File

@@ -0,0 +1,14 @@
general {
lock_cmd = pidof hyprlock || hyprlock
before_sleep_cmd = hyprlock & disown && systemctl suspend
}
listener {
timeout = 300
on-timeout = hyprlock
}
listener {
timeout = 600
on-timeout = systemctl suspend
}

View File

@@ -0,0 +1,88 @@
source = ~/.config/hypr/env.conf
source = ~/.config/hypr/inputs.conf
source = ~/.config/hypr/keybind.conf
source = ~/.config/hypr/startup.conf
general {
gaps_in = 5
gaps_out = 5
border_size = 2
col.active_border = rgba(e5b9c6ff) rgba(c293a3ff) 45deg
col.inactive_border = 0xff382D2E
no_border_on_floating = false # enable border on float window
layout = dwindle
no_cursor_warps = true
# cursor_inactive_timeout = 0
# no_focus_fallback = false
# resize_on_border = false
}
misc {
disable_hyprland_logo = true
disable_splash_rendering = true
mouse_move_enables_dpms = true
vfr = true
vrr = 0
animate_manual_resizes = true
mouse_move_focuses_monitor = true
enable_swallow = true
swallow_regex = ^(wezterm)$
}
decoration {
rounding = 0
# multisample_edges = true
active_opacity = 1.0
inactive_opacity = 1.0
blur {
enabled = true
size = 6
passes = 3
new_optimizations = true
xray = true
ignore_opacity = true
}
drop_shadow = false
shadow_ignore_window = true
shadow_offset = 1 2
shadow_range = 10
shadow_render_power = 5
col.shadow = 0x66404040
#blurls = gtk-layer-shell
blurls = waybar
blurls = lockscreen
}
animations {
enabled = true
bezier = wind, 0.05, 0.9, 0.1, 1.05
bezier = winIn, 0.1, 1.1, 0.1, 1.1
bezier = winOut, 0.3, -0.3, 0, 1
bezier = liner, 1, 1, 1, 1
animation = windows, 1, 6, wind, slide
animation = windowsIn, 1, 6, winIn, slide
animation = windowsOut, 1, 5, winOut, slide
animation = windowsMove, 1, 5, wind, slide
animation = border, 1, 1, liner
animation = borderangle, 1, 30, liner, loop
animation = fade, 1, 10, default
animation = workspaces, 1, 5, wind
}
dwindle {
no_gaps_when_only = false
pseudotile = true # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
preserve_split = true # you probably want this
}
master {
# See https://wiki.hyprland.org/Configuring/Master-Layout/ for more
new_is_master = true
}

View File

@@ -0,0 +1,58 @@
general {
hide_cursor = true
}
background {
monitor =
path = ~/.wallpaper.jpg
blur_passes = 2
contrast = 1
brightness = 0.5
vibrancy = 0.2
vibrancy_darkness = 0.2
}
input-field {
monitor =
size = 250, 60
outline_thickness = 2
dots_size = 0.2 # Scale of input-field height, 0.2 - 0.8
dots_spacing = 0.35 # Scale of dots' absolute size, 0.0 - 1.0
dots_center = true
outer_color = rgba(0, 0, 0, 0)
inner_color = rgba(0, 0, 0, 0.2)
font_color = $foreground
fade_on_empty = false
rounding = -1
check_color = rgb(204, 136, 34)
placeholder_text = <i><span foreground="##cdd6f4">Input Password...</span></i>
hide_input = false
position = 0, -200
halign = center
valign = center
}
# DATE
label {
monitor =
text = cmd[update:1000] echo "$(date +"%A, %B %d")"
color = rgba(242, 243, 244, 0.75)
font_size = 22
font_family = JetBrains Mono
position = 0, 300
halign = center
valign = center
}
# TIME
label {
monitor =
text = cmd[update:1000] echo "$(date +"%-I:%M")"
color = rgba(242, 243, 244, 0.75)
font_size = 95
font_family = JetBrains Mono Extrabold
position = 0, 200
halign = center
valign = center
}

View File

@@ -0,0 +1,5 @@
input {
kb_layout = dk
kb_options = caps:swapescape
natural_scroll = true
}

View File

@@ -0,0 +1,89 @@
$term = kitty
$browser = firefox
bind = SUPER, Return, exec, $term
bind = SUPER SHIFT, Return, exec, $browser
bind = SUPER, E, exec, $files
bind = SUPER, D, exec, killall rofi || rofi -show drun -theme ~/.config/rofi/config.rasi
bind = SUPER, period, exec, killall rofi || rofi -show emoji -emoji-format "{emoji}" -modi emoji -theme ~/.config/rofi/global/emoji
bind = SUPER SHIFT, B, exec, killall -SIGUSR2 waybar # Reload waybar
bind = SUPER, B, exec, killall -SIGUSR1 waybar # Hide waybar
bind = SUPER, Q, killactive,
bind = SUPER SHIFT, Q, exit,
bind = SUPER, F, fullscreen,
bind = SUPER, Space, togglefloating,
bind = SUPER, P, pseudo, # dwindle
bind = SUPER, S, togglesplit, # dwindle
# Change Workspace Mode
bind = SUPER SHIFT, Space, workspaceopt, allfloat
bind = SUPER SHIFT, Space, exec, $notifycmd 'Toggled All Float Mode'
bind = SUPER SHIFT, P, workspaceopt, allpseudo
bind = SUPER SHIFT, P, exec, $notifycmd 'Toggled All Pseudo Mode'
bind = SUPER, Tab, cyclenext,
bind = SUPER, Tab, bringactivetotop,
bind = SUPER, h, movefocus, l
bind = SUPER, l, movefocus, r
bind = SUPER, k, movefocus, u
bind = SUPER, j, movefocus, d
bind = SUPER SHIFT, left, movewindow, l
bind = SUPER SHIFT, right, movewindow, r
bind = SUPER SHIFT, up, movewindow, u
bind = SUPER SHIFT, down, movewindow, d
bind = SUPER CTRL, left, resizeactive, -20 0
bind = SUPER CTRL, right, resizeactive, 20 0
bind = SUPER CTRL, up, resizeactive, 0 -20
bind = SUPER CTRL, down, resizeactive, 0 20
bind = SUPER, g, togglegroup
bind = SUPER, tab, changegroupactive
bind = SUPER, G, exec, $notifycmd 'Toggled Group Mode'
bind = SUPER, a, togglespecialworkspace
bind = SUPERSHIFT, a, movetoworkspace, special
bind = SUPER, a, exec, $notifycmd 'Toggled Special Workspace'
bind = SUPER, c, exec, hyprctl dispatch centerwindow
bind = SUPER, 1, workspace, 1
bind = SUPER, 2, workspace, 2
bind = SUPER, 3, workspace, 3
bind = SUPER, 4, workspace, 4
bind = SUPER, 5, workspace, 5
bind = SUPER, 6, workspace, 6
bind = SUPER, 7, workspace, 7
bind = SUPER, 8, workspace, 8
bind = SUPER, 9, workspace, 9
bind = SUPER, 0, workspace, 10
bind = SUPER ALT, up, workspace, e+1
bind = SUPER ALT, down, workspace, e-1
bind = SUPER SHIFT, 1, movetoworkspace, 1
bind = SUPER SHIFT, 2, movetoworkspace, 2
bind = SUPER SHIFT, 3, movetoworkspace, 3
bind = SUPER SHIFT, 4, movetoworkspace, 4
bind = SUPER SHIFT, 5, movetoworkspace, 5
bind = SUPER SHIFT, 6, movetoworkspace, 6
bind = SUPER SHIFT, 7, movetoworkspace, 7
bind = SUPER SHIFT, 8, movetoworkspace, 8
bind = SUPER SHIFT, 9, movetoworkspace, 9
bind = SUPER SHIFT, 0, movetoworkspace, 10
bindm = SUPER, mouse:272, movewindow
bindm = SUPER, mouse:273, resizewindow
bind = SUPER, mouse_down, workspace, e+1
bind = ,XF86AudioPlay, exec, playerctl play-pause
bind = ,XF86AudioStop, exec, playerctl stop
bind = ,XF86AudioPrev, exec, playerctl previous
bind = ,XF86AudioNext, exec, playerctl next
bind = SUPER, mouse_up, workspace, e-1
binde = ,XF86MonBrightnessDown, exec, brightnessctl set 10%-
binde = ,XF86MonBrightnessUp, exec, brightnessctl set 10%+
bind = SUPER, L, exec, systemctl suspend

View File

@@ -0,0 +1,17 @@
# exec-once = ~/.config/hypr/scripts/resetxdgportal.sh # reset XDPH for screenshare
exec-once = dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP # for XDPH
exec-once = systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP # for XDPH
exec-once = systemctl --user start hyprland-session.target
exec-once = /usr/lib/polkit-kde-authentication-agent-1 # authentication dialogue for GUI apps
exec-once = hypridle
exec-once = dunst -config ~/.config/dunst/dunstrc
exec-once = swaybg -i ~/.wallpaper.jpg -m fill
exec-once = 1password --silent
# exec-once = echo latam > /tmp/kb_layout
# exec-once = wlsunset -t 5200 -S 9:00 -s 19:30 # NightLight from 7.30pm to 9am
# exec-once = systemctl --user restart pipewire # Restart pipewire to avoid bugs
# exec-once = waybar # launch the system panel
# exec-once = dunst # start notification demon
# exec-once = wl-paste --type text --watch cliphist store # clipboard store text data
# exec-once = wl-paste --type image --watch cliphist store # clipboard store image data
# exec-once = swww init || swww img `find $wallpaper_path -type f | shuf -n 1` # Set wallpaper

View File

@@ -0,0 +1,5 @@
---
desktop_hyprland_pkgs:
- hyprland
- hyprlock
- swaybg

View File

@@ -0,0 +1,2 @@
install_with_root: true
desktop_kitty_pkgs: []

View File

@@ -0,0 +1,3 @@
---
dependencies:
- role: base_info

View File

@@ -0,0 +1,44 @@
---
- name: "Load vars"
ansible.builtin.include_vars: "{{ item }}"
tags:
- install
with_first_found:
- files:
- "{{ ansible_distribution }}-{{ ansible_distribution_release }}.yml"
- "{{ ansible_distribution }}.yml"
- "{{ ansible_os_family }}.yml"
- default.yml
paths: ../vars
skip: true
- name: "Install dependencies"
tags:
- install
when: desktop_kitty_pks
become: "{{ install_with_root }}"
ansible.builtin.package:
name: "{{ desktop_kitty_pkgs }}"
- name: "Ensure dir"
tags:
- config
ansible.builtin.file:
path: "{{ home }}/.config/dunst"
state: directory
mode: "0700"
owner: "{{ username }}"
- name: "Copy templates"
tags:
- config
ansible.builtin.template:
src: "{{ item.src }}"
dest: "{{ home }}/.config/kitty/{{ item.path | regex_replace('\\.j2$', '') }}"
mode: "{{ item.mode }}"
owner: "{{ username }}"
with_community.general.filetree:
- ../templates
loop_control:
label: "{{ item.path }}"
when: item.state == 'file'

View File

@@ -0,0 +1,7 @@
linux_display_server auto
background_opacity 0.7
background_blur 1
dynamic_background_opacity yes
wayland_titlebar_color #242424

View File

@@ -0,0 +1,3 @@
---
desktop_kitty_pkgs:
- kitty

View File

@@ -2,4 +2,4 @@
- name: Setup host
hosts: localhost
roles:
- software/atuin
- desktop_hyprland