feat: formalize in-flight hyprland/dotfiles/role changes

Claude-Session: https://claude.ai/code/session_01PaGefHKzMcjAhoHpNKUe27
This commit is contained in:
Tuan-Dat Tran
2026-07-28 08:51:15 +02:00
parent 753bdfd403
commit 3f4a550f87
13 changed files with 311 additions and 20 deletions

View File

@@ -1,11 +1,4 @@
# #######################################################################################
# AUTOGENERATED HYPRLAND CONFIG.
# EDIT THIS CONFIG ACCORDING TO THE WIKI INSTRUCTIONS.
# #######################################################################################
autogenerated = 0 # remove this line to remove the warning
# This is an example Hyprland config file. # This is an example Hyprland config file.
# Refer to the wiki for more information. # Refer to the wiki for more information.
# https://wiki.hypr.land/Configuring/ # https://wiki.hypr.land/Configuring/
@@ -23,7 +16,7 @@ autogenerated = 0 # remove this line to remove the warning
################ ################
# See https://wiki.hypr.land/Configuring/Monitors/ # See https://wiki.hypr.land/Configuring/Monitors/
monitor=,preferred,auto,auto monitor=,preferred,auto,1
################### ###################
@@ -188,7 +181,7 @@ animations {
# See https://wiki.hypr.land/Configuring/Dwindle-Layout/ for more # See https://wiki.hypr.land/Configuring/Dwindle-Layout/ for more
dwindle { dwindle {
pseudotile = true # Master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below # pseudotile = true # Master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
preserve_split = true # You probably want this preserve_split = true # You probably want this
} }
@@ -210,18 +203,18 @@ misc {
# https://wiki.hypr.land/Configuring/Variables/#input # https://wiki.hypr.land/Configuring/Variables/#input
input { input {
kb_layout = us kb_layout = eu
kb_variant = kb_variant =
kb_model = kb_model =
kb_options = caps:ctrl_modifier kb_options = caps:ctrl_modifier
kb_rules = kb_rules =
follow_mouse = 1 follow_mouse = 0
sensitivity = 0 # -1.0 - 1.0, 0 means no modification. sensitivity = 0 # -1.0 - 1.0, 0 means no modification.
touchpad { touchpad {
natural_scroll = false natural_scroll = true
} }
} }
@@ -246,6 +239,7 @@ $mainMod = SUPER # Sets "Windows" key as main modifier
# Example binds, see https://wiki.hypr.land/Configuring/Binds/ for more # Example binds, see https://wiki.hypr.land/Configuring/Binds/ for more
bind = $mainMod, Return, exec, $terminal bind = $mainMod, Return, exec, $terminal
bind = $mainMod SHIFT, Q, killactive, bind = $mainMod SHIFT, Q, killactive,
bind = $mainMod SHIFT, Space, exec, hyprlock
# bind = $mainMod, M, exec, command -v hyprshutdown >/dev/null 2>&1 && hyprshutdown || hyprctl dispatch exit # bind = $mainMod, M, exec, command -v hyprshutdown >/dev/null 2>&1 && hyprshutdown || hyprctl dispatch exit
bind = $mainMod, E, exec, $fileManager bind = $mainMod, E, exec, $fileManager
bind = $mainMod, B, exec, $browser bind = $mainMod, B, exec, $browser

View File

@@ -0,0 +1,82 @@
# hyprlock.conf
# for more configuration options, refer https://wiki.hyprland.org/Hypr-Ecosystem/hyprlock
$font = Monospace
general {
hide_cursor = false
}
animations {
enabled = true
bezier = linear, 1, 1, 0, 0
animation = fadeIn, 1, 5, linear
animation = fadeOut, 1, 5, linear
animation = inputFieldDots, 1, 2, linear
}
background {
monitor =
path = screenshot
blur_passes = 3
}
input-field {
monitor =
size = 20%, 5%
outline_thickness = 3
inner_color = rgba(0, 0, 0, 0.0)
outer_color = rgba(33ccffee) rgba(00ff99ee) 45deg
check_color = rgba(00ff99ee) rgba(ff6633ee) 120deg
fail_color = rgba(ff6633ee) rgba(ff0066ee) 40deg
font_color = rgb(143, 143, 143)
fade_on_empty = false
rounding = 15
font_family = $font
placeholder_text = Input password...
fail_text = $PAMFAIL
dots_spacing = 0.3
position = 0, -20
halign = center
valign = center
}
# TIME
label {
monitor =
text = $TIME
font_size = 90
font_family = $font
position = -30, 0
halign = right
valign = top
}
# DATE
label {
monitor =
text = cmd[update:60000] date +"%A, %d %B %Y"
font_size = 25
font_family = $font
position = -30, -150
halign = right
valign = top
}
label {
monitor =
text = $LAYOUT[en,ru]
font_size = 24
onclick = hyprctl switchxkblayout all next
position = 250, -20
halign = center
valign = center
}

View File

@@ -0,0 +1,51 @@
#!/bin/bash
PHILIPS="Philips Consumer Electronics Company PHL 325B1L UK02311010066"
INTERNAL="eDP-1"
PENDING_FILE="/tmp/hypr-monitor-pending-pid"
LOG="/tmp/hypr-monitors.log"
log() { echo "[$(date '+%H:%M:%S')] $*" >> "$LOG"; }
handle_monitor_event() {
local monitors
monitors=$(hyprctl monitors)
log "handle_monitor_event called"
log "Active monitors: $(echo "$monitors" | grep '^Monitor')"
if echo "$monitors" | grep -q "$PHILIPS"; then
log "Home setup detected — enabling externals"
hyprctl keyword monitor "DP-6, 2560x1440@60, 0x0, 1" && log "DP-6 ok" || log "DP-6 FAILED"
hyprctl keyword monitor "DP-7, 1920x1080@120, 2560x0, 1" && log "DP-7 ok" || log "DP-7 FAILED"
sleep 1
hyprctl keyword monitor "$INTERNAL, disable" && log "eDP-1 disabled" || log "eDP-1 disable FAILED"
else
log "No external monitor — enabling internal"
hyprctl keyword monitor "$INTERNAL, preferred, 0x0, 1" && log "eDP-1 enabled" || log "eDP-1 enable FAILED"
hyprctl dispatch dpms on "$INTERNAL" && log "eDP-1 DPMS on" || log "eDP-1 DPMS FAILED"
sleep 0.5
for i in $(seq 1 10); do
hyprctl dispatch moveworkspacetomonitor "$i" "$INTERNAL" 2>/dev/null
done
log "Workspaces moved to eDP-1"
fi
}
schedule_handle() {
local pending
pending=$(cat "$PENDING_FILE" 2>/dev/null)
[ -n "$pending" ] && kill "$pending" 2>/dev/null
(sleep 1.5 && handle_monitor_event) &
echo $! > "$PENDING_FILE"
}
log "Script started"
handle_monitor_event
socat -U - UNIX-CONNECT:$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock | while read -r line; do
if [[ $line == "monitoradded"* ]] || [[ $line == "monitorremoved"* ]]; then
schedule_handle
fi
done

View File

@@ -0,0 +1,36 @@
output "Philips Consumer Electronics Company PHL 325B1L UK02311010066" {
mode 2560x1440@60
position 0,0
scale 1
alias $HOME_LEFT
}
output "ASUSTek COMPUTER INC VG248 L4LMQS119147" {
mode 1920x1080@120
position 2560,0
scale 1
alias $HOME_RIGHT
}
output eDP-1 {
mode 1920x1200@60
scale 1
alias $INTERNAL
}
# Profile for when you are at your desk
profile home {
output $HOME_LEFT enable
output $HOME_RIGHT enable
output $INTERNAL disable
}
# Profile for when you are on the go
profile outside {
output $INTERNAL enable
exec sleep 1 && hyprctl dispatch dpms on eDP-1
}
profile fallback {
}

View File

@@ -0,0 +1,34 @@
# Get editor completions based on the config schema
"$schema" = 'https://starship.rs/config-schema.json'
# Inserts a blank line between shell prompts
add_newline = true
# Replace the '' symbol in the prompt with '➜'
[character] # The name of the module we are configuring is 'character'
success_symbol = '[➜](bold green)' # The 'success_symbol' segment is being set to '➜' with the color 'bold green'
# Disable the package module, hiding it from the prompt completely
[package]
disabled = true
[kubernetes]
disabled = false
format = 'on [⛵ ($user on )($cluster in )$context \($namespace\)](dimmed green) '
contexts = [
{ context_pattern = "dev.local.cluster.k8s", style = "green", symbol = "💔 " },
]
[docker_context]
format = 'via [🐋 $context](blue bold)'
[azure]
disabled = false
format = "on [$symbol($username)]($style) "
symbol = '󰠅 '
style = 'blue bold'
[battery]
full_symbol = '🔋 '
charging_symbol = '⚡️ '
discharging_symbol = '💀 '

View File

@@ -1,6 +1,8 @@
# tasks file for ai # tasks file for ai
- name: Install AI development tools - name: Install AI development tools
become: true
pacman: pacman:
name: name:
- opencode - opencode
- ollama
state: present state: present

View File

@@ -2,5 +2,5 @@
archsetup_user: "{{ ansible_user_id }}" archsetup_user: "{{ ansible_user_id }}"
archsetup_repo: "{{ lookup('env', 'ARCHSETUP_REPO', default='https://github.com/YOUR_USERNAME/archsetup') }}" archsetup_repo: "{{ lookup('env', 'ARCHSETUP_REPO', default='https://github.com/YOUR_USERNAME/archsetup') }}"
archsetup_user_home: "{{ lookup('env', 'HOME') }}" archsetup_user_home: "{{ lookup('env', 'HOME') }}"
archsetup_dir: "{{ archsetup_user_home }}/archsetup" archsetup_dir: "{{ playbook_dir }}"
aur_helper: paru aur_helper: paru

View File

@@ -28,7 +28,7 @@
- unzip - unzip
- zip - zip
- less - less
- man - man-db
- texinfo - texinfo
- which - which
- zsh - zsh
@@ -42,7 +42,14 @@
- tokei - tokei
- git-delta - git-delta
- yazi - yazi
- ueberzugpp
- tealdeer - tealdeer
- ledger
- btop
- htop
- bind
- socat
- iperf3
state: present state: present
- name: Install Rust toolchain and Python uv - name: Install Rust toolchain and Python uv
@@ -193,3 +200,18 @@
alias lt="eza --tree --level=2 --icons" alias lt="eza --tree --level=2 --icons"
alias df="df -h" alias df="df -h"
alias wttr="curl wttr.in/Essen" alias wttr="curl wttr.in/Essen"
- name: Deploy zshrc yazi zellij wrapper
blockinfile:
path: "{{ archsetup_user_home }}/.zshrc"
marker: "# {mark} ANSIBLE MANAGED - YAZI ZELLIJ"
block: |
# Zellij only supports (buggy) Sixel image preview; force yazi to think
# it's running in Kitty so it falls back to Uberzug++ instead
yazi() {
if [[ -n "$ZELLIJ" ]]; then
TERM=xterm-kitty command yazi "$@"
else
command yazi "$@"
fi
}

View File

@@ -4,6 +4,8 @@
pacman: pacman:
name: name:
- docker - docker
- docker-compose
- docker-buildx
- kubectl - kubectl
- terraform - terraform
- ansible - ansible
@@ -13,6 +15,16 @@
- kubectx - kubectx
state: present state: present
- name: Install DevOps AUR tools
kewlfft.aur.aur:
name: "{{ item }}"
use: "{{ aur_helper | default('paru') }}"
state: present
loop:
- kubeseal
- tea
- winbox
- name: Deploy DevOps aliases - name: Deploy DevOps aliases
blockinfile: blockinfile:
path: "{{ archsetup_user_home }}/.zshrc" path: "{{ archsetup_user_home }}/.zshrc"

View File

@@ -2,3 +2,5 @@
dotfiles_stow_packages: dotfiles_stow_packages:
- hypr - hypr
- zellij - zellij
- starship
- kanshi

View File

@@ -13,6 +13,8 @@
loop: loop:
- hypr - hypr
- zellij - zellij
- starship.toml
- kanshi
- name: Create symlinks with stow - name: Create symlinks with stow
command: stow --target={{ archsetup_user_home }} {{ dotfiles_stow_packages | join(' ') }} command: stow --target={{ archsetup_user_home }} {{ dotfiles_stow_packages | join(' ') }}

View File

@@ -3,6 +3,7 @@
become: true become: true
pacman: pacman:
name: name:
- hyprland
- waybar - waybar
- wofi - wofi
- kitty - kitty
@@ -14,10 +15,20 @@
- brightnessctl - brightnessctl
- playerctl - playerctl
- grim - grim
- slurp
- wl-clipboard - wl-clipboard
- xdg-desktop-portal-hyprland - xdg-desktop-portal-hyprland
- zellij - zellij
- veracrypt - veracrypt
- kanshi
- dolphin
- xdg-utils
- qt5-wayland
- qt6-wayland
- polkit-kde-agent
- power-profiles-daemon
- sddm
- uwsm
state: present state: present
- name: Install basic Linux tools - name: Install basic Linux tools
@@ -31,19 +42,32 @@
- dust - dust
- ffmpeg - ffmpeg
- sxiv - sxiv
- pandoc - pandoc-cli
- p7zip - 7zip
- entr - entr
- less
- man
- texinfo
- which
- iw - iw
- network-manager-applet - network-manager-applet
- networkmanager
- iwd
- wireless_tools
- wpa_supplicant
- udiskie - udiskie
- ntfs-3g - ntfs-3g
state: present state: present
- name: Install audio stack
become: true
pacman:
name:
- pipewire
- pipewire-alsa
- pipewire-jack
- pipewire-pulse
- wireplumber
- gst-plugin-pipewire
- libpulse
state: present
- name: Install Bluetooth support - name: Install Bluetooth support
become: true become: true
pacman: pacman:
@@ -59,9 +83,21 @@
name: name:
- cups - cups
- cups-pdf - cups-pdf
- cups-pk-helper
- system-config-printer - system-config-printer
- simple-scan
- tesseract-data-eng
state: present state: present
- name: Install Brother printer AUR packages
kewlfft.aur.aur:
name: "{{ item }}"
use: "{{ aur_helper | default('paru') }}"
state: present
loop:
- brscan4
- brother-mfc-l2710dw
- name: Enable services - name: Enable services
become: true become: true
systemd: systemd:
@@ -72,6 +108,9 @@
- cups - cups
- docker - docker
- udisks2 - udisks2
- NetworkManager
- power-profiles-daemon
- sddm
- name: Add user to docker group - name: Add user to docker group
become: true become: true

View File

@@ -10,4 +10,19 @@
- mpv - mpv
- firefox - firefox
- qutebrowser - qutebrowser
- yt-dlp
- signal-desktop
- keepassxc
- lutris
- steam
state: present state: present
- name: Install multimedia AUR packages
kewlfft.aur.aur:
name: "{{ item }}"
use: "{{ aur_helper | default('paru') }}"
state: present
loop:
- brave-bin
- rustdesk-bin
- proton-vpn-cli