diff --git a/dotfiles/hypr/hyprland.conf b/dotfiles/hypr/hyprland.conf index 3edd8af..80316a1 100644 --- a/dotfiles/hypr/hyprland.conf +++ b/dotfiles/hypr/hyprland.conf @@ -22,8 +22,9 @@ ################ # See https://wiki.hypr.land/Configuring/Monitors/ -monitor=,preferred,auto,1 - +#monitor=,preferred,auto,1 +monitor=eDP-1,preferred,auto,1 +monitor=DP-3,preferred,auto,1 ################### ### MY PROGRAMS ### @@ -44,10 +45,13 @@ $menu = wofi # Autostart necessary processes (like notifications daemons, status bars, etc.) # Or execute your favorite apps at launch like this: -exec-once = sh -c 'if command -v awww-daemon >/dev/null 2>&1; then awww-daemon; elif command -v swww-daemon >/dev/null 2>&1; then swww-daemon; else hyprpaper; fi' +exec-once = sh -c 'if command -v awww-daemon >/dev/null 2>&1; then awww-daemon && awww img /home/pascal/Bilder/Wallpaper/forest.jpg; elif command -v swww-daemon >/dev/null 2>&1; then swww-daemon; else hyprpaper; fi' exec-once = waybar exec-once = swaync exec-once = env WIDGET_PANEL_START_HIDDEN=1 ~/.config/hypr/Scripts/widget-panel.sh +exec-once = ~/.config/hypr/scripts/lid-dock-handler.sh +exec-once = /usr/lib/hyprpolkitagent + ############################# ### ENVIRONMENT VARIABLES ### @@ -63,7 +67,7 @@ env = QT_STYLE_OVERRIDE,Fusion # https://wiki.hypr.land/Configuring/Variables/#general general { gaps_in = 6 - gaps_out = 25 + gaps_out = 15 border_size = 2 @@ -121,8 +125,8 @@ animations { animation = fade, 1, 5, soft animation = windows, 1, 6, smoothOut - animation = windowsIn, 1, 6, smoothOut, popin 85% - animation = windowsOut, 1, 5, smoothIn, popin 85% + animation = windowsIn, 1, 6, smoothOut, popin 60% + animation = windowsOut, 1, 5, smoothIn animation = layers, 1, 5, smoothOut animation = layersIn, 1, 5, smoothOut, fade @@ -142,7 +146,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 } @@ -203,7 +207,8 @@ bind = $mainMod, Q, killactive, bind = $mainMod, M, exec, ~/.config/hypr/Scripts/main-menu.sh bind = $mainMod, E, exec, $fileManager bind = $mainMod, N, exec, swaync-client -t -bind = $mainMod, V, togglefloating, +bind = $mainMod, F, togglefloating, +bind = $mainMod, V, exec, ~/.config/hypr/Scripts/clipboard-manager.sh bind = $mainMod, R, exec, $menu bind = $mainMod, W, exec, ~/.config/hypr/Scripts/widget-panel.sh bind = $mainMod SHIFT, W, exec, ~/.config/hypr/Scripts/ags-switcher.sh wallpaper @@ -274,6 +279,9 @@ bindl = , XF86AudioPause, exec, playerctl play-pause bindl = , XF86AudioPlay, exec, playerctl play-pause bindl = , XF86AudioPrev, exec, playerctl previous +# AI Command Center +source = ~/.config/hypr/ai-command-center.conf + ############################## ### WINDOWS AND WORKSPACES ### ############################## diff --git a/dotfiles/hypr/scripts/lid-dock-handler.sh b/dotfiles/hypr/scripts/lid-dock-handler.sh new file mode 100755 index 0000000..d5d2dce --- /dev/null +++ b/dotfiles/hypr/scripts/lid-dock-handler.sh @@ -0,0 +1,74 @@ +#!/bin/bash + +LID_STATE_FILE="/proc/acpi/button/lid/LID/state" +DOCK_MONITOR="DP-3" +LAPTOP_MONITOR="eDP-1" + +find_hypr_socket() { + local runtime_dir + runtime_dir="${XDG_RUNTIME_DIR:-/run/user/$(id -u)}" + for d in "$runtime_dir"/hypr/*/; do + if [[ -S "${d}.socket.sock" ]]; then + echo "$(basename "$d")" + return 0 + fi + done + return 1 +} + +ensure_hyprctl() { + if ! command -v hyprctl &>/dev/null; then + return 1 + fi + if [[ -z "$HYPRLAND_INSTANCE_SIGNATURE" ]]; then + local sig + sig=$(find_hypr_socket) + if [[ -n "$sig" ]]; then + export HYPRLAND_INSTANCE_SIGNATURE="$sig" + export HYPRLAND_INSTANCE_SIGNATURE="$sig" + else + return 1 + fi + fi + return 0 +} + +hyprctl_wait() { + while ! ensure_hyprctl; do + sleep 1 + done +} + +is_docked() { + hyprctl monitors 2>/dev/null | grep -q "^Monitor $DOCK_MONITOR" +} + +move_workspaces_to_dock() { + local workspaces + workspaces=$(hyprctl workspaces 2>/dev/null | grep -B1 "monitor: $LAPTOP_MONITOR" | grep "^workspace ID" | awk '{print $3}') + for ws in $workspaces; do + hyprctl dispatch moveworkspacetomonitor "$ws" "$DOCK_MONITOR" >/dev/null 2>&1 + done +} + +hyprctl_wait + +prev_state="" +while true; do + if [[ -f "$LID_STATE_FILE" ]]; then + state=$(awk '{print $2}' < "$LID_STATE_FILE") + else + state="unknown" + fi + + if [[ "$state" != "$prev_state" ]]; then + if [[ "$state" == "closed" ]] && is_docked; then + move_workspaces_to_dock + hyprctl keyword monitor "$LAPTOP_MONITOR,disable" >/dev/null 2>&1 + elif [[ "$state" == "open" ]]; then + hyprctl keyword monitor "$LAPTOP_MONITOR,preferred,auto,1" >/dev/null 2>&1 + fi + prev_state="$state" + fi + sleep 1 +done diff --git a/modules/core/dotfiles.sh b/modules/core/dotfiles.sh index 6102d11..882aab7 100755 --- a/modules/core/dotfiles.sh +++ b/modules/core/dotfiles.sh @@ -72,6 +72,7 @@ print(' '.join(items)) chmod +x "$HOME/.config/hypr/Scripts/"*.sh 2>/dev/null || true chmod +x "$HOME/.config/hypr/Scripts/"*.py 2>/dev/null || true + chmod +x "$HOME/.config/hypr/scripts/"*.sh 2>/dev/null || true chmod +x "$HOME/.config/waybar/scripts/"*.sh 2>/dev/null || true replace_home_paths "$HOME/.config/hypr" "/home/pascal" diff --git a/modules/core/packages.sh b/modules/core/packages.sh index b8c6cee..2e9d764 100755 --- a/modules/core/packages.sh +++ b/modules/core/packages.sh @@ -133,7 +133,8 @@ get_group_packages() { sddm \ brightnessctl playerctl \ grim slurp swappy hyprshot \ - wl-clipboard libnotify sshpass + wl-clipboard libnotify sshpass \ + hyprpolkitagent aylurs-gtk-shell ;; gpu)