Use Hyprland instead of sway #1

Merged
Bluemedia merged 15 commits from hyprland into master 2024-06-01 01:39:10 +02:00
38 changed files with 703 additions and 406 deletions

View file

@ -1,3 +0,0 @@
isNotebook: true
isDesktop: false
isVm: false

45
host_vars/kronos Normal file
View file

@ -0,0 +1,45 @@
monitors:
- desc: "LG Electronics LG ULTRAGEAR 311NTZN8J917"
output: "DP-1"
resolution: "2560x1440@120"
position: "1440x1440"
background:
file: "bg1.png"
mode: "fill"
- desc: "LG Electronics LG ULTRAGEAR 311NTVS8J911"
output: "DP-2"
resolution: "2560x1440@120"
position: "1440x0"
background:
file: "bg0.png"
mode: "fill"
- desc: "Acer Technologies KG271U TATEE0048524"
output: "HDMI-A-4"
resolution: "2560x1440@120"
position: "0x320"
transform: 3
background:
file: "bgv0.png"
mode: "fill"
workspaces:
- id: 1
monitor: "LG Electronics LG ULTRAGEAR 311NTZN8J917"
default: true
- id: 2
monitor: "LG Electronics LG ULTRAGEAR 311NTVS8J911"
default: true
- id: 3
monitor: "Acer Technologies KG271U TATEE0048524"
default: true
layoutopt_orientation: "top"
on_created_empty: "flatpak run com.discordapp.Discord & keepassxc"
- id: 9
monitor: "LG Electronics LG ULTRAGEAR 311NTVS8J911"
autostart:
- command: "spotify --enable-features=UseOzonePlatform --ozone-platform=wayland"
workspace: 9
silent: true

26
host_vars/zeus Normal file
View file

@ -0,0 +1,26 @@
mobile_platform: true
monitors:
- desc: "BOE 0x07C9"
output: "eDP-1"
resolution: "1920x1080@60"
background:
file: "bg0.png"
mode: "fill"
workspaces:
- id: 1
monitor: "BOE 0x07C9"
default: true
- id: 8
monitor: "BOE 0x07C9"
- id: 9
monitor: "BOE 0x07C9"
autostart:
- command: "keepassxc"
workspace: 8
silent: true
- command: "spotify --enable-features=UseOzonePlatform --ozone-platform=wayland"
workspace: 9
silent: true

4
inventory/devices.yml Normal file
View file

@ -0,0 +1,4 @@
ungrouped:
hosts:
kronos:
zeus:

View file

@ -1,8 +1,12 @@
- hosts: localhost
roles:
- common
- desktop-environment # Sway, App Launcher etc.
- essential-tools # Thunar File Manager, Firefox, KeePassXC, Nextcloud Desktop
#- media-tools # Spotify, VLC
#- dev-tools # Visual Studio Code, Node.js
#- vm-tools # QEMU / KVM, libvirt, virt-manager
- desktop-environment # Hyprland, App Launcher etc.
#- firefox
#- nextcloud
#- keepassxc
#- spotify
#- vlc
#- vs-code
#- qemu-kvm
#- discord

View file

@ -2,9 +2,9 @@
UBUNTU_CODENAME=jammy
sudo apt update
sudo apt install wget gpg
sudo apt install -y wget gpg
wget -O- "https://keyserver.ubuntu.com/pks/lookup?fingerprint=on&op=get&search=0x6125E2A8C77F2818FB7BD15B93C4A3FD7BB9C367" | sudo gpg --dearmour -o /usr/share/keyrings/ansible-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/ansible-archive-keyring.gpg] http://ppa.launchpad.net/ansible/ansible/ubuntu $UBUNTU_CODENAME main" | sudo tee /etc/apt/sources.list.d/ansible.list
sudo apt update
sudo apt install ansible
sudo apt install -y ansible

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 MiB

View file

@ -1,2 +0,0 @@
XDG_CURRENT_DESKTOP="sway"
XDG_SESSION_TYPE="wayland"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 140 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 745 KiB

View file

@ -1,2 +0,0 @@
dependencies:
- role: common

View file

@ -0,0 +1,61 @@
- name: Create group for sudoers config
become: yes
group:
name: admins
state: present
- name: Add user to group for sudoers config
become: yes
user:
append: true
name: "{{ ansible_user_id }}"
groups:
- admins
- name: Create sudoers config
become: yes
community.general.sudoers:
name: desktop-environment
group: admins
nopassword: true
commands:
- "/usr/bin/systemctl poweroff"
- "/usr/bin/systemctl reboot"
- "/usr/bin/systemctl suspend"
- name: Copy static config files
copy:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
loop:
- src: "{{ role_path }}/files/.config"
dest: "{{ ansible_env.HOME }}/"
- name: Ensure presence of required directories
file:
path: "{{ item }}"
recurse: yes
state: directory
loop:
- "{{ ansible_env.HOME }}/.config/hypr"
- "{{ ansible_env.HOME }}/.config/waybar"
- "{{ ansible_env.HOME }}/.local/bin"
- name: Render config files
ansible.builtin.template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
loop:
- src: "bash_profile.j2"
dest: "{{ ansible_env.HOME }}/.bash_profile"
- src: ".config/hypr/hyprland.conf.j2"
dest: "{{ ansible_env.HOME }}/.config/hypr/hyprland.conf"
- src: ".config/waybar/config.j2"
dest: "{{ ansible_env.HOME }}/.config/waybar/config"
- src: ".local/bin/hyprhelpr.j2"
dest: "{{ ansible_env.HOME }}/.local/bin/hyprhelpr"
- name: Make "~/.local/bin/hyprhelpr" executable
ansible.builtin.file:
dest: "{{ ansible_env.HOME }}/.local/bin/hyprhelpr"
mode: "ug+x"

View file

@ -0,0 +1,22 @@
- name: Install flatpak
become: yes
apt:
state: latest
install_recommends: false
name:
- flatpak
- name: Add flathub remote to flatpak
community.general.flatpak_remote:
name: flathub
state: present
flatpakrepo_url: https://dl.flathub.org/repo/flathub.flatpakrepo
method: user
- name: Install flatpaks
community.general.flatpak:
name: "{{ item }}"
state: present
method: user
loop:
- org.wezfurlong.wezterm

View file

@ -0,0 +1,158 @@
- name: Install build dependencies (1/2)
become: yes
apt:
state: build-dep
name:
- wlroots
- name: Install build dependencies (2/2)
become: yes
apt:
state: latest
install_recommends: false
name:
# General
- build-essential
- cmake
- meson
# hyprland-scanner
- libpugixml-dev
# hyprcursor
- libzip-dev
- librsvg2-dev
- libxcb-util-dev
# Hyprland
- libpango1.0-dev
- libtomlplusplus-dev
- uuid-dev
# xdg-desktop-portal-hyprland
#- qtbase5-dev
- qt6-base-dev
- libspa-0.2-dev
- libpipewire-0.3-dev
- name: Create source folders
become: yes
file:
path: "/usr/local/src/{{ item }}"
state: directory
owner: "{{ ansible_user_id }}"
group: "{{ ansible_user_id }}"
loop:
- "hyprwayland-scanner"
- "Hyprland"
- "hyprlang"
- "hyprcursor"
- "xdg-desktop-portal-hyprland"
- name: Checkout hyprwayland-scanner repo
ansible.builtin.git:
repo: 'https://github.com/hyprwm/hyprwayland-scanner.git'
dest: /usr/local/src/hyprwayland-scanner
version: v0.3.4
force: true
recursive: true
- name: Checkout Hyprland repo
ansible.builtin.git:
repo: 'https://github.com/hyprwm/Hyprland.git'
dest: /usr/local/src/Hyprland
version: v0.40.0
force: true
recursive: true
- name: Checkout hyprlang repo
ansible.builtin.git:
repo: 'https://github.com/hyprwm/hyprlang.git'
dest: /usr/local/src/hyprlang
version: v0.5.1
force: true
recursive: true
- name: Checkout hyprcursor repo
ansible.builtin.git:
repo: 'https://github.com/hyprwm/hyprcursor.git'
dest: /usr/local/src/hyprcursor
version: v0.1.8
force: true
recursive: true
- name: Checkout xdg-desktop-portal-hyprland repo
ansible.builtin.git:
repo: 'https://github.com/hyprwm/xdg-desktop-portal-hyprland.git'
dest: /usr/local/src/xdg-desktop-portal-hyprland
version: master
force: true
recursive: true
- name: Build hyprwayland-scanner
ansible.builtin.command:
cmd: "{{ item }}"
chdir: /usr/local/src/hyprwayland-scanner
loop:
- "cmake -DCMAKE_INSTALL_PREFIX=/usr -B build"
- "cmake --build build"
- name: Install hyprwayland-scanner
become: yes
ansible.builtin.command:
cmd: "cmake --install build"
chdir: /usr/local/src/hyprwayland-scanner
- name: Build hyprlang
ansible.builtin.command:
cmd: "{{ item }}"
chdir: /usr/local/src/hyprlang
loop:
- "cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr -S . -B build"
- "cmake --build build --config Release --target hyprlang"
- name: Install hyprlang
become: yes
ansible.builtin.command:
cmd: "cmake --install build"
chdir: /usr/local/src/hyprlang
- name: Build hyprcursor
ansible.builtin.command:
cmd: "{{ item }}"
chdir: /usr/local/src/hyprcursor
loop:
- "cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr -S . -B ./build"
- "cmake --build build --config Release --target all"
- name: Install hyprcursor
become: yes
ansible.builtin.command:
cmd: "cmake --install build"
chdir: /usr/local/src/hyprcursor
- name: Build Hyprland
community.general.make:
chdir: /usr/local/src/Hyprland
target: all
- name: Install Hyprland
become: true
community.general.make:
chdir: /usr/local/src/Hyprland
target: install
- name: Build xdg-desktop-portal-hyprland
ansible.builtin.command:
cmd: "{{ item }}"
chdir: /usr/local/src/xdg-desktop-portal-hyprland
loop:
- "cmake -DCMAKE_INSTALL_LIBEXECDIR=/usr/lib -DCMAKE_INSTALL_PREFIX=/usr -B build"
- "cmake --build build"
- name: Install xdg-desktop-portal-hyprland
become: yes
ansible.builtin.command:
cmd: "cmake --install build"
chdir: /usr/local/src/xdg-desktop-portal-hyprland
- name: Reload systemd
ansible.builtin.systemd_service:
daemon_reload: true
scope: user

View file

@ -1,93 +1,11 @@
- name: Install packages for desktop environment
become: yes
apt:
state: latest
install_recommends: false
name:
- sway
- xwayland
- swaylock
- waybar
- xdg-desktop-portal-wlr
- slurp
- xfce4-appfinder
- rtkit
- pipewire
- pipewire-pulse
- wireplumber
- alsa-utils
- brightnessctl
- flatpak
- adwaita-icon-theme
- fonts-firacode
- fonts-font-awesome
- fonts-noto-color-emoji
- name: Include installation of Hyprland
import_tasks: hyprland.yml
- name: Add flathub remote to flatpak
community.general.flatpak_remote:
name: flathub
state: present
flatpakrepo_url: https://dl.flathub.org/repo/flathub.flatpakrepo
method: user
- name: Include installation of utilities
import_tasks: utils.yml
- name: Install flatpaks
community.general.flatpak:
name: "{{ item }}"
state: present
method: user
loop:
- org.wezfurlong.wezterm
- name: Include flatpak setup
import_tasks: flatpak.yml
- name: Create group for sudoers config
become: yes
group:
name: admins
state: present
- name: Add user to group for sudoers config
become: yes
user:
append: true
name: "{{ ansible_user_id }}"
groups:
- admins
- name: Create sudoers config
become: yes
community.general.sudoers:
name: desktop-environment
group: admins
nopassword: true
commands:
- "/usr/bin/systemctl poweroff"
- "/usr/bin/systemctl reboot"
- "/usr/bin/systemctl suspend"
- name: Copy static config files
copy:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
loop:
- src: "{{ role_path }}/files/.config"
dest: "{{ ansible_env.HOME }}/"
- name: Ensure presence of required directories
file:
path: "{{ item }}"
recurse: yes
state: directory
loop:
- "{{ ansible_env.HOME }}/.config/sway"
- "{{ ansible_env.HOME }}/.config/waybar"
- name: Render config files
ansible.builtin.template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
loop:
- src: "bash_profile.j2"
dest: "{{ ansible_env.HOME }}/.bash_profile"
- src: "sway-config.j2"
dest: "{{ ansible_env.HOME }}/.config/sway/config"
- src: "waybar-config.j2"
dest: "{{ ansible_env.HOME }}/.config/waybar/config"
- name: Include configuration steps
import_tasks: config.yml

View file

@ -0,0 +1,27 @@
- name: Install utilities
become: yes
apt:
state: latest
install_recommends: false
name:
- swaylock
- swaybg
- swayidle
- waybar
- wofi
- xdg-desktop-portal-wlr
- xdg-desktop-portal-gtk
- xfce4-appfinder
- rtkit
- pipewire
- pipewire-pulse
- wireplumber
- qpwgraph
- alsa-utils
- brightnessctl
- gnome-keyring
- adwaita-icon-theme
- fonts-firacode
- fonts-font-awesome
- fonts-noto-color-emoji
- thunar

View file

@ -0,0 +1,183 @@
# Monitor configuration (see https://wiki.hyprland.org/Configuring/Monitors/)
{% for monitor in hostvars[ansible_hostname]['monitors'] %}
monitor=desc:{{ monitor['desc'] }}, {{ monitor['resolution'] }}, {{ monitor['position'] | default('auto') }}, 1
{% endfor %}
# Programs to use
$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 # 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 = 2
touchpad {
natural_scroll = 1
}
sensitivity = 0 # -1.0 - 1.0, 0 means no modification.
}
general {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
gaps_in = 5
gaps_out = 10
border_size = 2
col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg
col.inactive_border = rgba(595959aa)
layout = master
# Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on
allow_tearing = false
}
decoration {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
rounding = 10
blur {
enabled = true
size = 3
passes = 1
vibrancy = 0.1696
}
drop_shadow = true
shadow_range = 4
shadow_render_power = 3
col.shadow = rgba(1a1a1aee)
}
# Default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more
animations {
enabled = true
bezier = myBezier, 0.05, 0.9, 0.1, 1.05
animation = windows, 1, 7, myBezier
animation = windowsOut, 1, 7, default, popin 80%
animation = border, 1, 10, default
animation = borderangle, 1, 8, default
animation = fade, 1, 7, default
animation = workspaces, 1, 6, default
}
master {
# See https://wiki.hyprland.org/Configuring/Master-Layout/ for more
new_is_master = true
orientation = right
}
gestures {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
workspace_swipe = false
}
misc {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
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 = 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'] | lower }}{% 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 & ~/.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'] }} {%- if (autostart['silent'] | default('false')) | bool %} silent{% endif %}] {% endif %}{{ autostart['command'] }}
{% endfor %}
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
$mainMod = SUPER
# 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, ~/.local/bin/hyprhelpr lock
bind = $mainMod, P, exec, ~/.local/bin/hyprhelpr powermenu
# Move focus with mainMod + arrow keys
bind = $mainMod, left, movefocus, l
bind = $mainMod, right, movefocus, r
bind = $mainMod, up, movefocus, u
bind = $mainMod, down, movefocus, d
# Move window with mainMod + SHIFT + arrow keys
bind = $mainMod SHIFT, left, movewindow, l
bind = $mainMod SHIFT, right, movewindow, r
bind = $mainMod SHIFT, up, movewindow, u
bind = $mainMod SHIFT, down, movewindow, d
# Switch workspaces with mainMod + [0-9]
bind = $mainMod, 1, workspace, 1
bind = $mainMod, 2, workspace, 2
bind = $mainMod, 3, workspace, 3
bind = $mainMod, 4, workspace, 4
bind = $mainMod, 5, workspace, 5
bind = $mainMod, 6, workspace, 6
bind = $mainMod, 7, workspace, 7
bind = $mainMod, 8, workspace, 8
bind = $mainMod, 9, workspace, 9
bind = $mainMod, 0, workspace, 10
# Move active window to a workspace with mainMod + SHIFT + [0-9]
bind = $mainMod SHIFT, 1, movetoworkspace, 1
bind = $mainMod SHIFT, 2, movetoworkspace, 2
bind = $mainMod SHIFT, 3, movetoworkspace, 3
bind = $mainMod SHIFT, 4, movetoworkspace, 4
bind = $mainMod SHIFT, 5, movetoworkspace, 5
bind = $mainMod SHIFT, 6, movetoworkspace, 6
bind = $mainMod SHIFT, 7, movetoworkspace, 7
bind = $mainMod SHIFT, 8, movetoworkspace, 8
bind = $mainMod SHIFT, 9, movetoworkspace, 9
bind = $mainMod SHIFT, 0, movetoworkspace, 10
# Move/resize windows with mainMod + LMB/RMB and dragging
bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod, mouse:273, resizewindow
{% if hostvars[ansible_hostname]['mobile_platform'] | bool %}
# Backlight control
bind = , XF86MonBrightnessUp, exec, brightnessctl -d intel_backlight set +5%
bind = , XF86MonBrightnessDown, exec, brightnessctl -d intel_backlight set 5%-
# Volume control
bind = , XF86AudioRaiseVolume, exec, amixer -c 0 -q set Master 2dB+ unmute
bind = , XF86AudioLowerVolume, exec, amixer -c 0 -q set Master 2db- unmute
bind = , XF86AudioMute, exec, amixer -q set Master toggle
# Touchpad control
bind = , XF86TouchpadOn, exec, synclient Touchpadoff=0
bind = , XF86TouchpadOff, exec, synclient Touchpadoff=1
{% endif %}

View file

@ -1,10 +1,8 @@
{
"modules-left": ["sway/workspaces", "sway/mode"],
"modules-left": ["hyprland/workspaces"],
"modules-center": ["clock"],
"modules-right": ["cpu", "memory", "network", "pulseaudio", {% if isNotebook | bool %}"battery", {% endif %}"custom/power"],
"sway/workspaces": {
"disable-scroll": true
},
"modules-right": ["cpu", "memory", "network", "pulseaudio", {% if (hostvars[ansible_hostname]['mobile_platform'] | default('false')) | bool %}"battery", {% endif %}"custom/power"],
"hyprland/workspaces": {},
"clock": {
"format": " {:%H:%M %d.%m.}",
"timezone": "Europe/Berlin"
@ -29,16 +27,12 @@
"format-icons": ["", "", ""],
"reverse-scrolling": true,
"on-click": "swaymsg exec amixer -q set Master toggle"
{% if (hostvars[ansible_hostname]['mobile_platform'] | default('false')) | bool %}
},
{% if isNotebook | bool %}
"battery": {
"format": "{icon} {capacity}%",
"format-charging": " {capacity}%",
"format-icons": ["", "", "", "", ""]
},
{% endif %}
"custom/power":{
"format":"  ",
"on-click":"swaynag -t warning -m 'Power Menu Options' -b 'Logout' 'swaymsg exit' -b 'Lock' 'swaymsg exec swaylock -f' -b 'Suspend' 'swaymsg exec sudo systemctl suspend && swaylock -f' -b 'Reboot' 'swaymsg exec sudo systemctl reboot' -b 'Shutdown' 'swaymsg exec sudo systemctl poweroff'"
}
}

View file

@ -0,0 +1,96 @@
#!/bin/bash
set -eu
background() {
swaybg \
{% for monitor in hostvars[ansible_hostname]['monitors'] %}
-o "{{ monitor['desc'] }}" -i ~/.config/background/{{ monitor['background']['file'] }} -m {{ monitor['background']['mode'] }} {%- if not loop.last %} \{% endif %}
{% endfor %}
}
idle() {
swayidle -w \
timeout 180 '~/.local/bin/hyprhelpr lock' \
timeout 240 'hyprctl dispatch dpms off' \
resume 'hyprctl dispatch dpms on'
}
lock() {
if pgrep -x "swaylock" >/dev/null
then
echo "A instance of swaylock is already running."
exit 1
else
swaylock -f -e -s fill --indicator-radius 150 \
{% for monitor in hostvars[ansible_hostname]['monitors'] %}
-i {{ monitor['output'] }}:~/.config/background/lock-{{ monitor['background']['file'] }} {%- if not loop.last %} \{% endif %}
{% endfor %}
fi
}
shutdown() {
sudo systemctl poweroff
}
reboot() {
sudo systemctl reboot
}
powermenu() {
PM_ACTION=$(printf "Shutdown\nReboot\nLock\nLogoff" | wofi --show=dmenu -i --width 200 --height 150)
if [ -n "$PM_ACTION" ]; then
case $PM_ACTION in
Shutdown)
shutdown
;;
Reboot)
reboot
;;
Lock)
lock
;;
Logoff)
hyprctl dispatch exit
;;
esac
fi
}
ACTION=$1
case $ACTION in
background)
background
;;
idle)
idle
;;
lock)
lock
;;
shutdown)
shutdown
;;
reboot)
reboot
;;
powermenu)
powermenu
;;
help | -h | --help)
echo "Usage: hyprhelpr <action> [parameters]"
echo "Available actions:"
echo " background Start swaybg with the configured backgrounds."
echo " idle Start swayidle with the configured actions."
echo " lock Lock the current session using swaylock."
echo " shutdown Shut down the system."
echo " reboot Reboot the system."
echo " powermenu Show wofi in dmenu mode with different power options"
echo " help Show this help text."
;;
*)
echo "Invalid action \"$ACTION\"."' Use "hyprhelpr help" to get help.'
exit 1
esac

View file

@ -13,8 +13,10 @@ fi
# Fix gpg for git commit signing
export GPG_TTY=$(tty)
# Autostart sway at login
{% if isVm | bool %}
export WLR_NO_HARDWARE_CURSORS=1
# Autostart Hyprland at login
if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then
{% if (hostvars[ansible_hostname]['virtual_machine'] | default('false')) | bool %}
export WLR_NO_HARDWARE_CURSORS=1
{% endif %}
if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then exec sway; fi
exec Hyprland
fi

View file

@ -1,248 +0,0 @@
input "type:keyboard" {
xkb_layout de
xkb_variant nodeadkeys
repeat_delay 200
repeat_rate 40
}
input "type:touchpad" {
tap enabled
natural_scroll enabled
}
set $mod Mod4
default_border pixel 2
default_floating_border pixel 2
hide_edge_borders both
bindsym $mod+u border none
bindsym $mod+y border pixel 1
bindsym $mod+n border normal
font xft:Fira Code 11
floating_modifier $mod
bindsym $mod+Return exec flatpak run org.wezfurlong.wezterm
# Window kill command
bindsym $mod+Shift+q kill
# start program launcher
bindsym $mod+d exec --no-startup-id xfce4-appfinder --disable-server
for_window [title="Application Finder"] floating enable
for_window [title="Application Finder"] resize set 500 500
# change focus
bindsym $mod+j focus left
bindsym $mod+k focus down
bindsym $mod+l focus up
bindsym $mod+semicolon focus right
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
# move focused window
bindsym $mod+Shift+j move left
bindsym $mod+Shift+k move down
bindsym $mod+Shift+l move up
bindsym $mod+Shift+semicolon move right
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
# workspace back and forth (with/without active container)
workspace_auto_back_and_forth yes
bindsym $mod+b workspace back_and_forth
bindsym $mod+Shift+b move container to workspace back_and_forth; workspace back_and_forth
# split orientation
bindsym $mod+h split h;exec notify-send 'tile horizontally'
bindsym $mod+v split v;exec notify-send 'tile vertically'
bindsym $mod+q split toggle
# toggle fullscreen mode for the focused container
bindsym $mod+f fullscreen toggle
# change container layout (stacked, tabbed, toggle split)
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
# toggle tiling / floating
bindsym $mod+Shift+space floating toggle
# change focus between tiling / floating windows
bindsym $mod+space focus mode_toggle
# toggle sticky
bindsym $mod+Shift+s sticky toggle
# focus the parent container
bindsym $mod+a focus parent
# move the currently focused window to the scratchpad
bindsym $mod+Shift+minus move scratchpad
# Show the next scratchpad window or hide the focused scratchpad window.
# If there are multiple scratchpad windows, this command cycles through them.
bindsym $mod+minus scratchpad show
# navigate workspaces next / previous
bindsym $mod+Ctrl+Right workspace next
bindsym $mod+Ctrl+Left workspace prev
# workspaces
set $ws1 1
set $ws2 2
set $ws3 3
set $ws4 4
set $ws5 5
set $ws6 6
set $ws7 7
set $ws8 8
# switch to workspace
bindsym $mod+1 workspace $ws1
bindsym $mod+2 workspace $ws2
bindsym $mod+3 workspace $ws3
bindsym $mod+4 workspace $ws4
bindsym $mod+5 workspace $ws5
bindsym $mod+6 workspace $ws6
bindsym $mod+7 workspace $ws7
bindsym $mod+8 workspace $ws8
# Move focused container to workspace
bindsym $mod+Ctrl+1 move container to workspace $ws1
bindsym $mod+Ctrl+2 move container to workspace $ws2
bindsym $mod+Ctrl+3 move container to workspace $ws3
bindsym $mod+Ctrl+4 move container to workspace $ws4
bindsym $mod+Ctrl+5 move container to workspace $ws5
bindsym $mod+Ctrl+6 move container to workspace $ws6
bindsym $mod+Ctrl+7 move container to workspace $ws7
bindsym $mod+Ctrl+8 move container to workspace $ws8
# Move to workspace with focused container
bindsym $mod+Shift+1 move container to workspace $ws1; workspace $ws1
bindsym $mod+Shift+2 move container to workspace $ws2; workspace $ws2
bindsym $mod+Shift+3 move container to workspace $ws3; workspace $ws3
bindsym $mod+Shift+4 move container to workspace $ws4; workspace $ws4
bindsym $mod+Shift+5 move container to workspace $ws5; workspace $ws5
bindsym $mod+Shift+6 move container to workspace $ws6; workspace $ws6
bindsym $mod+Shift+7 move container to workspace $ws7; workspace $ws7
bindsym $mod+Shift+8 move container to workspace $ws8; workspace $ws8
# Open specific applications in floating mode
for_window [window_role="About"] floating enable
for_window [title="alsamixer"] floating enable border pixel 1
for_window [title="File Transfer*"] floating enable
for_window [class="eog"] floating enable
for_window [class="Galculator"] floating enable border pixel 1
for_window [class="GParted"] floating enable border normal
for_window [class="(?i)gnome-calculator"] floating enable
for_window [class="Pavucontrol"] floating enable
for_window [class="qt5ct"] floating enable sticky enable border normal
for_window [class="Qtconfig-qt4"] floating enable sticky enable border normal
for_window [title="QEMU"] floating enable
for_window [class="Thus"] floating enable border normal
for_window [class="Timeset-gui"] floating enable border normal
# switch to workspace with urgent window automatically
for_window [urgent=latest] focus
# reload the configuration file
bindsym $mod+Shift+c reload
# restart sway inplace (preserves layout/session)
bindsym $mod+Shift+r restart
# exit sway
bindsym $mod+Shift+e exec "swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'"
# Set shut down, restart and locking features
set $mode_system (l)ock, (e)xit, (r)eboot, (Shift+s)hutdown
bindsym $mod+0 mode "$mode_system"
mode "$mode_system" {
bindsym l exec --no-startup-id swaylock -f -s fill -i ~/.config/sway/lockscreen.jpg, mode "default"
bindsym e exec --no-startup-id swaymsg exit, mode "default"
bindsym r exec --no-startup-id sudo systemctl reboot, mode "default"
bindsym Shift+s exec --no-startup-id sudo systemctl poweroff, mode "default"
# exit system mode: "Enter" or "Escape"
bindsym Return mode "default"
bindsym Escape mode "default"
}
# Resize window (you can also use the mouse for that)
bindsym $mod+r mode "resize"
mode "resize" {
# These bindings trigger as soon as you enter the resize mode
# Pressing left will shrink the windows width.
# Pressing right will grow the windows width.
# Pressing up will shrink the windows height.
# Pressing down will grow the windows height.
bindsym j resize shrink width 5 px or 5 ppt
bindsym k resize grow height 5 px or 5 ppt
bindsym l resize shrink height 5 px or 5 ppt
bindsym semicolon resize grow width 5 px or 5 ppt
# same bindings, but for the arrow keys
bindsym Left resize shrink width 10 px or 10 ppt
bindsym Down resize grow height 10 px or 10 ppt
bindsym Up resize shrink height 10 px or 10 ppt
bindsym Right resize grow width 10 px or 10 ppt
# exit resize mode: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
# Set background
output * bg ~/.config/sway/background.png fill
# Use waybar
exec systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK
exec hash dbus-update-activation-environment 2>/dev/null && \
dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK
exec waybar
# Autostart applications
{% if nextcloud is defined and nextcloud | bool %}
exec --no-startup-id nextcloud --background
{% endif %}
# Theme colors
client.focused #c6c6c6 #1f1f1f #c6c6c6 #8abeb7 #8abeb7
client.focused_inactive #c6c6c6 #1f1f1f #c6c6c6 #8abeb7 #8abeb7
client.unfocused #c6c6c6 #1f1f1f #c6c6c6 #8abeb7 #8abeb7
client.urgent #c6c6c6 #1f1f1f #c6c6c6 #8abeb7 #8abeb7
client.placeholder #c6c6c6 #1f1f1f #c6c6c6 #8abeb7 #8abeb7
client.background #1f1f1f
{% if isNotebook | bool %}
# backlight control
bindsym XF86MonBrightnessUp exec --no-startup-id brightnessctl -d intel_backlight set +5%
bindsym XF86MonBrightnessDown exec --no-startup-id brightnessctl -d intel_backlight set 5%-
# set volume control
bindsym XF86AudioRaiseVolume exec --no-startup-id amixer -c 0 -q set Master 2dB+ unmute
bindsym XF86AudioLowerVolume exec --no-startup-id amixer -c 0 -q set Master 2db- unmute
bindsym XF86AudioMute exec --no-startup-id amixer -q set Master toggle
# touchpad on and off controller on laptops with Fn keys
bindsym XF86TouchpadOn exec --no-startup-id synclient Touchpadoff=0
bindsym XF86TouchpadOff exec --no-startup-id synclient Touchpadoff=1
{% endif %}
focus_follows_mouse no
# User defined keys
#bindsym Print exec flameshot gui # TODO
#bindsym Shift+Print exec flameshot gui #TODO

View file

@ -0,0 +1,5 @@
- name: Install Discord
community.general.flatpak:
name: "com.discordapp.Discord"
state: present
method: user

View file

@ -1,7 +0,0 @@
Package: *
Pin: release a=testing
Pin-Priority: 900
Package: *
Pin: release a=unstable
Pin-Priority: 10

View file

@ -1,4 +0,0 @@
dependencies:
- role: desktop-environment
vars:
nextcloud: true

View file

@ -1,24 +0,0 @@
- name: Add debian unstable repo
become: yes
apt_repository:
repo: deb http://deb.debian.org/debian unstable main non-free-firmware non-free contrib
state: present
filename: debian-unstable
- name: Create apt preferences file for unstable repo
become: yes
copy:
src: "{{ role_path }}/files/99pin-unstable"
dest: "/etc/apt/preferences.d/"
- name: Install essential tools
become: yes
apt:
state: latest
install_recommends: false
update_cache: true
name:
- thunar
- firefox
- keepassxc
- nextcloud-desktop

View file

@ -0,0 +1,20 @@
- name: Add Mozilla repository
become: yes
deb822_repository:
name: mozilla
types: deb
uris: https://packages.mozilla.org/apt
suites: mozilla
components: main
signed_by: https://packages.mozilla.org/apt/repo-signing-key.gpg
state: present
enabled: yes
- name: Install packages
become: yes
apt:
state: latest
update_cache: true
install_recommends: false
name:
- firefox

View file

@ -0,0 +1,7 @@
- name: Install packages
become: yes
apt:
state: latest
install_recommends: false
name:
- keepassxc-full

View file

@ -0,0 +1,7 @@
- name: Install packages
become: yes
apt:
state: latest
install_recommends: false
name:
- nextcloud-desktop

View file

@ -1,4 +1,4 @@
- name: Install packages for qemu-kvm
- name: Install packages
become: yes
apt:
state: latest
@ -6,6 +6,7 @@
name:
- qemu-kvm
- qemu-system
- qemu-utils
- libvirt-daemon
- libvirt-daemon-system
- ovmf

View file

@ -4,7 +4,7 @@ Name=Spotify
GenericName=Music Player
Icon=spotify-client
TryExec=spotify
Exec=spotify --uri=%U
Exec=spotify --enable-features=UseOzonePlatform --ozone-platform=wayland --uri=%U
Terminal=false
MimeType=x-scheme-handler/spotify;
Categories=Audio;Music;Player;AudioVideo;

View file

@ -6,7 +6,7 @@
uris: http://repository.spotify.com
suites: stable
components: non-free
signed_by: https://download.spotify.com/debian/pubkey_7A3A762FAFD4A51F.gpg
signed_by: https://download.spotify.com/debian/pubkey_6224F9941A8AA6D1.gpg
state: present
enabled: yes
@ -17,8 +17,6 @@
update_cache: true
install_recommends: false
name:
- vlc
- vlc-plugin-pipewire
- spotify-client
- name: Ensure that directory for desktop entries exists

9
roles/vlc/tasks/main.yml Normal file
View file

@ -0,0 +1,9 @@
- name: Install packages
become: yes
apt:
state: latest
update_cache: true
install_recommends: false
name:
- vlc
- vlc-plugin-pipewire