From f20f7179ef3d35f5b49a0e30586fd0f6133c23af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20B=C3=BCchler?= Date: Fri, 8 Aug 2025 11:54:58 +0200 Subject: [PATCH] chore(hyprland): remove wl-clipboard-history and autostart usage; add network-manager-applet; ensure both JetBrains Mono font variants are installed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit chore(setup): unify device profile detection and symlink logic via PROFILE env var 🤖 Generated with opencode.ai Co-Authored-By: opencode --- .config/hypr/includes/autostart.conf | 1 - modules/02-symlinks.sh | 25 +++++++++++++++++++++---- modules/06-hyprland.sh | 3 +++ setup.sh | 23 ++++++++++++----------- 4 files changed, 36 insertions(+), 16 deletions(-) diff --git a/.config/hypr/includes/autostart.conf b/.config/hypr/includes/autostart.conf index bfa79e0..31badb6 100644 --- a/.config/hypr/includes/autostart.conf +++ b/.config/hypr/includes/autostart.conf @@ -1,7 +1,6 @@ # Autostart applications exec-once = waybar & exec-once = mako & -exec-once = wl-clipboard-history -t & exec-once = wlogout & exec-once = rofi-wayland & # exec-once = hyprpaper & diff --git a/modules/02-symlinks.sh b/modules/02-symlinks.sh index d0d827d..130cd2b 100755 --- a/modules/02-symlinks.sh +++ b/modules/02-symlinks.sh @@ -37,11 +37,28 @@ if [ -d "$CONFIG_DIR" ]; then echo "Linked .config/$baseitem" done - # Device-specific symlinks for Hyprland and Waybar using host-profiles.conf + # Device-specific symlinks for Hyprland and Waybar using $PROFILE from setup.sh + if [ -z "$PROFILE" ]; then + echo "ERROR: PROFILE environment variable not set. Run setup.sh to detect profile." + exit 1 + fi HOSTNAME=$(hostname) - PROFILE="" - if [ -f "$DOTFILES_DIR/host-profiles.conf" ]; then - PROFILE=$(awk -F= -v h="$HOSTNAME" '$1==h{print $2}' "$DOTFILES_DIR/host-profiles.conf") + # Hyprland monitors + if [ -f "$CONFIG_DIR/hypr/includes/monitors-$HOSTNAME.conf" ]; then + ln -sf "$CONFIG_DIR/hypr/includes/monitors-$HOSTNAME.conf" "$CONFIG_DIR/hypr/includes/monitors.conf" + echo "Linked monitors-$HOSTNAME.conf as monitors.conf" + else + echo "Warning: No monitors config for hostname $HOSTNAME" + fi + # Hyprland hypridle + if [ -f "$CONFIG_DIR/hypr/includes/hypridle-$PROFILE.conf" ]; then + ln -sf "$CONFIG_DIR/hypr/includes/hypridle-$PROFILE.conf" "$CONFIG_DIR/hypr/hypridle.conf" + echo "Linked hypridle-$PROFILE.conf as hypridle.conf" + fi + # Waybar config + if [ -f "$CONFIG_DIR/waybar/config-$PROFILE" ]; then + ln -sf "$CONFIG_DIR/waybar/config-$PROFILE" "$CONFIG_DIR/waybar/config" + echo "Linked config-$PROFILE as waybar config" fi if [ -z "$PROFILE" ]; then echo "ERROR: No profile mapping found for hostname '$HOSTNAME' in $DOTFILES_DIR/host-profiles.conf" diff --git a/modules/06-hyprland.sh b/modules/06-hyprland.sh index 899961f..81d2df4 100755 --- a/modules/06-hyprland.sh +++ b/modules/06-hyprland.sh @@ -11,11 +11,14 @@ HYPR_PACKAGES=( mako wl-clipboard wlogout + network-manager-applet brightnessctl alacritty + ttf-jetbrains-mono-nerd ttf-jetbrains-mono ttf-nerd-fonts-symbols noto-fonts + noto-fonts-emoji ) paru -S --needed --noconfirm "${HYPR_PACKAGES[@]}" diff --git a/setup.sh b/setup.sh index 995a8d6..99977d6 100755 --- a/setup.sh +++ b/setup.sh @@ -6,18 +6,19 @@ set -e # Dotfiles setup script for Arch Linux using paru set -e -# Device profile detection -if [ -z "$DOTFILES_DEVICE" ]; then - echo "Select device profile:" - select profile in "laptop" "desktop"; do - DOTFILES_DEVICE="$profile" - export DOTFILES_DEVICE - echo "Using device profile: $DOTFILES_DEVICE" - break - done -else - echo "Using device profile from environment: $DOTFILES_DEVICE" +# Device profile detection (unified via host-profiles.conf) +HOSTNAME=$(hostname) +PROFILE="" +DOTFILES_DIR="$(cd "$(dirname "$0")" && pwd)" +if [ -f "$DOTFILES_DIR/host-profiles.conf" ]; then + PROFILE=$(awk -F= -v h="$HOSTNAME" '$1==h{print $2}' "$DOTFILES_DIR/host-profiles.conf") fi +if [ -z "$PROFILE" ]; then + echo "ERROR: No profile mapping found for hostname '$HOSTNAME' in $DOTFILES_DIR/host-profiles.conf" + exit 1 +fi +export PROFILE +echo "Using device profile: $PROFILE" # Find, sort, and run all modules in the modules directory SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"