diff --git a/dotfiles/hypr/.config/hypr/hyprland.conf b/dotfiles/hypr/.config/hypr/hyprland.conf index 2732be8..48d72f1 100644 --- a/dotfiles/hypr/.config/hypr/hyprland.conf +++ b/dotfiles/hypr/.config/hypr/hyprland.conf @@ -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. # Refer to the wiki for more information. # 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/ -monitor=,preferred,auto,auto +monitor=,preferred,auto,1 ################### @@ -188,7 +181,7 @@ animations { # See https://wiki.hypr.land/Configuring/Dwindle-Layout/ for more 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 } @@ -210,18 +203,18 @@ misc { # https://wiki.hypr.land/Configuring/Variables/#input input { - kb_layout = us + kb_layout = eu kb_variant = kb_model = kb_options = caps:ctrl_modifier kb_rules = - follow_mouse = 1 + follow_mouse = 0 sensitivity = 0 # -1.0 - 1.0, 0 means no modification. 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 bind = $mainMod, Return, exec, $terminal 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, E, exec, $fileManager bind = $mainMod, B, exec, $browser diff --git a/dotfiles/hypr/.config/hypr/hyprlock.conf b/dotfiles/hypr/.config/hypr/hyprlock.conf new file mode 100644 index 0000000..428f456 --- /dev/null +++ b/dotfiles/hypr/.config/hypr/hyprlock.conf @@ -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 +} diff --git a/dotfiles/hypr/.config/hypr/monitors.sh b/dotfiles/hypr/.config/hypr/monitors.sh new file mode 100755 index 0000000..d2f9ffb --- /dev/null +++ b/dotfiles/hypr/.config/hypr/monitors.sh @@ -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 diff --git a/dotfiles/kanshi/.config/kanshi/config b/dotfiles/kanshi/.config/kanshi/config new file mode 100644 index 0000000..72c2d0c --- /dev/null +++ b/dotfiles/kanshi/.config/kanshi/config @@ -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 { + +} diff --git a/dotfiles/starship/.config/starship.toml b/dotfiles/starship/.config/starship.toml new file mode 100644 index 0000000..17fa14d --- /dev/null +++ b/dotfiles/starship/.config/starship.toml @@ -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 = '💀 ' diff --git a/roles/ai/tasks/main.yaml b/roles/ai/tasks/main.yaml index 8e1e8cc..6408e77 100644 --- a/roles/ai/tasks/main.yaml +++ b/roles/ai/tasks/main.yaml @@ -1,6 +1,8 @@ # tasks file for ai - name: Install AI development tools + become: true pacman: name: - opencode + - ollama state: present diff --git a/roles/common/defaults/main.yml b/roles/common/defaults/main.yml index 3002b75..8628c55 100644 --- a/roles/common/defaults/main.yml +++ b/roles/common/defaults/main.yml @@ -2,5 +2,5 @@ archsetup_user: "{{ ansible_user_id }}" archsetup_repo: "{{ lookup('env', 'ARCHSETUP_REPO', default='https://github.com/YOUR_USERNAME/archsetup') }}" archsetup_user_home: "{{ lookup('env', 'HOME') }}" -archsetup_dir: "{{ archsetup_user_home }}/archsetup" +archsetup_dir: "{{ playbook_dir }}" aur_helper: paru diff --git a/roles/common/tasks/main.yml b/roles/common/tasks/main.yml index 9282faa..bca310b 100644 --- a/roles/common/tasks/main.yml +++ b/roles/common/tasks/main.yml @@ -28,7 +28,7 @@ - unzip - zip - less - - man + - man-db - texinfo - which - zsh @@ -42,7 +42,14 @@ - tokei - git-delta - yazi + - ueberzugpp - tealdeer + - ledger + - btop + - htop + - bind + - socat + - iperf3 state: present - name: Install Rust toolchain and Python uv @@ -193,3 +200,18 @@ alias lt="eza --tree --level=2 --icons" alias df="df -h" 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 + } diff --git a/roles/devops/tasks/main.yml b/roles/devops/tasks/main.yml index be0c6fb..b66338f 100644 --- a/roles/devops/tasks/main.yml +++ b/roles/devops/tasks/main.yml @@ -4,6 +4,8 @@ pacman: name: - docker + - docker-compose + - docker-buildx - kubectl - terraform - ansible @@ -13,6 +15,16 @@ - kubectx 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 blockinfile: path: "{{ archsetup_user_home }}/.zshrc" diff --git a/roles/dotfiles/defaults/main.yml b/roles/dotfiles/defaults/main.yml index 2b324d5..fd9ae47 100644 --- a/roles/dotfiles/defaults/main.yml +++ b/roles/dotfiles/defaults/main.yml @@ -2,3 +2,5 @@ dotfiles_stow_packages: - hypr - zellij + - starship + - kanshi diff --git a/roles/dotfiles/tasks/main.yml b/roles/dotfiles/tasks/main.yml index 440a2a3..658bef9 100644 --- a/roles/dotfiles/tasks/main.yml +++ b/roles/dotfiles/tasks/main.yml @@ -13,6 +13,8 @@ loop: - hypr - zellij + - starship.toml + - kanshi - name: Create symlinks with stow command: stow --target={{ archsetup_user_home }} {{ dotfiles_stow_packages | join(' ') }} diff --git a/roles/hyprland/tasks/main.yml b/roles/hyprland/tasks/main.yml index efd2126..a15598d 100644 --- a/roles/hyprland/tasks/main.yml +++ b/roles/hyprland/tasks/main.yml @@ -3,6 +3,7 @@ become: true pacman: name: + - hyprland - waybar - wofi - kitty @@ -14,10 +15,20 @@ - brightnessctl - playerctl - grim + - slurp - wl-clipboard - xdg-desktop-portal-hyprland - zellij - veracrypt + - kanshi + - dolphin + - xdg-utils + - qt5-wayland + - qt6-wayland + - polkit-kde-agent + - power-profiles-daemon + - sddm + - uwsm state: present - name: Install basic Linux tools @@ -31,19 +42,32 @@ - dust - ffmpeg - sxiv - - pandoc - - p7zip + - pandoc-cli + - 7zip - entr - - less - - man - - texinfo - - which - iw - network-manager-applet + - networkmanager + - iwd + - wireless_tools + - wpa_supplicant - udiskie - ntfs-3g 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 become: true pacman: @@ -59,9 +83,21 @@ name: - cups - cups-pdf + - cups-pk-helper - system-config-printer + - simple-scan + - tesseract-data-eng 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 become: true systemd: @@ -72,6 +108,9 @@ - cups - docker - udisks2 + - NetworkManager + - power-profiles-daemon + - sddm - name: Add user to docker group become: true diff --git a/roles/multimedia/tasks/main.yml b/roles/multimedia/tasks/main.yml index 8bb4fde..6249597 100644 --- a/roles/multimedia/tasks/main.yml +++ b/roles/multimedia/tasks/main.yml @@ -10,4 +10,19 @@ - mpv - firefox - qutebrowser + - yt-dlp + - signal-desktop + - keepassxc + - lutris + - steam 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