Compare commits

...

10 Commits

Author SHA1 Message Date
92b9d417fb fix(zsh): apply keybindings reliably on first startup
- set bindkey -e before custom binds and load zsh/terminfo early
- remove later bindkey -e that reset earlier keymaps
- preserve terminfo application mode hooks

This prevents Ctrl+Arrow and other navigation keys from failing until .zshrc is re-sourced.

🤖 Generated with [opencode](https://opencode.ai)

Co-Authored-By: opencode <noreply@opencode.ai>
2025-08-10 01:37:32 +02:00
bab7526ac9 chore(hyprland): clean up autostart apps
- Remove mako, wlogout, and rofi-wayland from autostart
- Only start waybar and hypridle by default

🤖 Generated with [opencode](https://opencode.ai)

Co-Authored-By: opencode <noreply@opencode.ai>
2025-08-08 17:41:25 +02:00
42f6cc3180 feat(waybar): restore and style wlogout button, increase font and icon size
- Add custom wlogout button to modules-right in both desktop and laptop configs
- Style wlogout button for visibility and theme consistency
- Increase font size globally by 30%
- Increase icon size for wlogout button

🤖 Generated with [opencode](https://opencode.ai)

Co-Authored-By: opencode <noreply@opencode.ai>
2025-08-08 17:40:31 +02:00
1e02be0a39 refactor: symlinks script now only links files (not directories), traverses recursively, and ensures target dirs are not symlinks; remove custom wlogout config and device-specific repo symlinks for maintainability
- Only files are symlinked, not directories
- Symlinks are created in target config dirs, not inside repo
- Target dirs are checked and cleaned if symlinks
- Removes wlogout config and device-specific repo symlinks
- Updates .zshrc and wp-vol for robustness

🤖 Generated with [opencode](https://opencode.ai)

Co-Authored-By: opencode <noreply@opencode.ai>
2025-08-08 17:06:36 +02:00
cbe3ff94ac fix: improve VSCode terminal compatibility in .zshrc; update README for device-aware setup and troubleshooting
- Add VSCode detection and fallback keybinds to .zshrc for robust navigation in integrated terminals
- Expand README with device profile logic, troubleshooting, and module reference

🤖 Generated with [opencode](https://opencode.ai)

Co-Authored-By: opencode <noreply@opencode.ai>
2025-08-08 14:33:00 +02:00
d9bebb71ac refactor: DRY device-specific symlinking, standardize on DOTFILES_DEVICE, improve comments and safety
- Remove duplicate device-specific blocks in symlinks script
- Use DOTFILES_DEVICE everywhere, remove PROFILE
- Add clear comments and documentation for maintainability
- Polish symlink removal logic for safety and idempotence

🤖 Generated with [opencode](https://opencode.ai)

Co-Authored-By: opencode <noreply@opencode.ai>
2025-08-08 14:20:13 +02:00
f20f7179ef chore(hyprland): remove wl-clipboard-history and autostart usage; add network-manager-applet; ensure both JetBrains Mono font variants are installed
chore(setup): unify device profile detection and symlink logic via PROFILE env var

🤖 Generated with opencode.ai

Co-Authored-By: opencode <noreply@opencode.ai>
2025-08-08 11:54:58 +02:00
a9e5ace080 feat: unify host detection and profile mapping
- Add host-profiles.conf for hostname-to-profile mapping
- Update symlinks script to use mapping and error early if unmapped

🤖 Generated with opencode
Co-Authored-By: opencode <noreply@opencode.ai>
2025-08-08 11:26:13 +02:00
f66b63354a feat: add device-specific Hyprland config fragments
- Add monitors-archlaptop.conf for laptop profile
- Add hypridle.conf for device-specific idle settings

🤖 Generated with opencode
Co-Authored-By: opencode <noreply@opencode.ai>
2025-08-08 11:20:30 +02:00
15b50be80b chore: update agent safety rules, devtools, and Waybar config symlink
- Clarify agent safety in AGENTS.md
- Update devtools package name
- Update Waybar config symlink for device profile

🤖 Generated with opencode
Co-Authored-By: opencode <noreply@opencode.ai>
2025-08-08 11:19:12 +02:00
20 changed files with 356 additions and 71 deletions

1
.config/hypr/hypridle.conf Symbolic link
View File

@ -0,0 +1 @@
/home/lousy/git/dotfiles/.config/hypr/includes/hypridle-desktop.conf

View File

@ -1,9 +1,5 @@
# Autostart applications
exec-once = waybar &
exec-once = mako &
exec-once = wl-clipboard-history -t &
exec-once = wlogout &
exec-once = rofi-wayland &
# exec-once = hyprpaper &
exec-once = hypridle &

View File

@ -19,6 +19,7 @@ bind = $mainMod, P, pseudo, # dwindle
bind = $mainMod, J, togglesplit, # dwindle
bind = $mainMod SHIFT, P, exec, ~/.config/hypr/reway.sh
bind = $mainMod, L, exec, hyprlock
bind = $mainMod, F12, exec, killall -SIGUSR2 waybar
# Move focus with mainMod + arrow keys
bind = $mainMod, left, movefocus, l

View File

@ -0,0 +1,13 @@
monitor=eDP-1,preferred,auto,1
monitor=DP-1,preferred,auto,1
workspace=10,monitor:eDP-1
workspace=1,monitor:DP-1
workspace=2,monitor:DP-1
workspace=3,monitor:DP-1
workspace=4,monitor:DP-1
workspace=5,monitor:DP-1
workspace=6,monitor:DP-1
workspace=7,monitor:DP-1
workspace=8,monitor:DP-1
workspace=9,monitor:DP-1

View File

@ -1 +0,0 @@
/home/lousy/git/dotfiles/local.config/rofi/remmina_profiles.py

View File

@ -0,0 +1,59 @@
#!/usr/bin/env python3
### Parameters
remmina_cfg = "~/.config/remmina/remmina.pref"
remmina_bin = "/usr/bin/remmina"
### Modules
import os
import re
import sys
import subprocess
### Main routine
def main():
# Get the Remmina data directory path
with open(os.path.abspath(os.path.expanduser(remmina_cfg)), "r") as f:
for l in f.readlines():
m = re.match(r"\s*datadir_path\s*=\s*(.*)$", l.rstrip())
if m:
datadir_path = os.path.abspath(os.path.expanduser(m[1]))
# Parse the Remmina profiles in the directory path, extract their names
profiles = {}
for fpath in os.listdir(datadir_path):
fpath = os.path.join(datadir_path, fpath)
if os.path.isfile(fpath) and fpath.endswith(".remmina"):
try:
with open(fpath, "r") as f:
for l in f.readlines():
m = re.match(r"\s*name\s*=\s*(.*)$", l.rstrip())
if m:
profiles[m[1]] = fpath
except:
pass
# If rofi passed a profile name as argument, start the corresponding profile
if len(sys.argv) > 1 and sys.argv[1] in profiles:
subprocess.Popen([remmina_bin, profiles[sys.argv[1]]],
stdin=subprocess.DEVNULL,
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL)
# Otherwise send the list of profile names to rofi
else:
for p in sorted(profiles):
print(p)
return 0
### Main program
if __name__ == "__main__":
exit(main())

View File

View File

@ -8,7 +8,7 @@
"modules-center": [
"clock"
],
"modules-right": [
"modules-right": [
"cpu",
"memory",
"disk#root",
@ -17,8 +17,8 @@
"pulseaudio",
"network",
"tray",
],
"hyprland/workspaces": {
"custom/wlogout"
], "hyprland/workspaces": {
"format": "{icon}",
"on-click": "activate",
"on-scroll-up": "hyprctl dispatch workspace e-1",
@ -102,5 +102,10 @@
},
"tray": {
"icon-size": 20
},
"custom/wlogout": {
"format": "⏻",
"tooltip": "Logout/Shutdown",
"on-click": "wlogout"
}
}

View File

@ -8,7 +8,7 @@
"modules-center": [
"clock"
],
"modules-right": [
"modules-right": [
"backlight",
"cpu",
"memory",
@ -18,9 +18,9 @@
"pulseaudio",
"network",
"battery",
"tray"
],
"hyprland/workspaces": {
"tray",
"custom/wlogout"
], "hyprland/workspaces": {
"format": "{icon}",
"on-click": "activate",
"on-scroll-up": "hyprctl dispatch workspace e-1",
@ -135,5 +135,10 @@
},
"tray": {
"icon-size": 20
},
"custom/wlogout": {
"format": "⏻",
"tooltip": "Logout/Shutdown",
"on-click": "wlogout"
}
}

View File

@ -1,11 +1,16 @@
* {
font-family: JetBrainsMono, monospace;
font-size: 13px;
font-size: 17px;
border: none;
box-shadow: none;
min-height: 0;
}
.icon, .fa, .material-icons {
font-size: 17px;
}
window#waybar {
background: rgba(30, 30, 46, 0.95);
border-radius: 10px;
@ -46,3 +51,21 @@ window#waybar {
#pulseaudio.muted {
color: #f9e2af;
}
#custom-wlogout {
background: #f38ba8;
color: #1e1e2e;
border-radius: 8px;
padding: 0 8px;
margin: 0 4px;
font-weight: bold;
transition: background 0.2s, color 0.2s;
}
#custom-wlogout .icon {
font-size: 22px;
}
#custom-wlogout:hover, #custom-wlogout:focus {
background: #cba6f7;
color: #1e1e2e;
box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

View File

@ -1,4 +0,0 @@
{
"label": "Logout",
"command": "loginctl terminate-user $USER"
}

2
.local/bin/wp-vol Normal file → Executable file
View File

@ -8,4 +8,4 @@ VOLUME=$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | awk '{printf "%d", $2 * 100}')
MUTED=$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | grep -q MUTED && echo " (muted)" || echo "")
# Show notification
notify-send -a Volume -h string:x-canonical-private-synchronous:volume -u low "Volume: $VOLUME%$MUTED"
notify-send -a Volume -h string:x-canonical-private-synchronous:volume -h int:value:$VOLUME -u low "Volume: $VOLUME%$MUTED"

99
.zshrc
View File

@ -12,6 +12,15 @@
# Environment settings
# =====================
# Ensure ~/.local/bin is in PATH (XDG standard)
if [ -d "$HOME/.local/bin" ] && [[ ":$PATH:" != *":$HOME/.local/bin:"* ]]; then
export PATH="$HOME/.local/bin:$PATH"
fi
# Optionally add XDG-compliant bin dir if present
if [ -d "${XDG_DATA_HOME:-$HOME/.local/share}/bin" ] && [[ ":$PATH:" != *":${XDG_DATA_HOME:-$HOME/.local/share}/bin:"* ]]; then
export PATH="${XDG_DATA_HOME:-$HOME/.local/share}/bin:$PATH"
fi
# Do Not Track for CLI tools
export DO_NOT_TRACK=1
@ -126,8 +135,88 @@ alias gcl="git clone"
alias ..="cd .."
alias ...="cd ../.."
# Dotfiles management
alias dotup="cd ~/git/dotfiles && git pull && ./setup.sh"
# =====================
# Robust keybinds for navigation and editing (support most terminals)
# =====================
# Ensure Emacs keymap is set before custom bindings so later changes don't reset them
bindkey -e
# Load terminfo module for $terminfo[] and echoti
zmodload zsh/terminfo 2>/dev/null || true
# VSCode terminal compatibility detection
export IS_VSCODE_TERM=0
if [[ "$TERM_PROGRAM" == "vscode" ]] || [[ -n "$VSCODE_IPC_HOOK_CLI" ]]; then
export IS_VSCODE_TERM=1
fi
if (( IS_VSCODE_TERM )); then
# VSCode terminal: use standard escape sequences for keybinds
bindkey '^[[H' beginning-of-line
bindkey '^[[F' end-of-line
bindkey '^[[2~' overwrite-mode
bindkey '^[[3~' delete-char
bindkey '^[[5~' beginning-of-buffer-or-history
bindkey '^[[6~' end-of-buffer-or-history
bindkey '^[[A' up-line-or-history
bindkey '^[[B' down-line-or-history
bindkey '^[[C' forward-char
bindkey '^[[D' backward-char
bindkey '^[[1;5D' backward-word # Ctrl+Left
bindkey '^[[1;5C' forward-word # Ctrl+Right
bindkey '^[[1;3D' backward-word # Alt+Left
bindkey '^[[1;3C' forward-word # Alt+Right
else
# Use terminfo for portability
typeset -g -A key
key[Home]="${terminfo[khome]}"
key[End]="${terminfo[kend]}"
key[Insert]="${terminfo[kich1]}"
key[Delete]="${terminfo[kdch1]}"
key[Up]="${terminfo[kcuu1]}"
key[Down]="${terminfo[kcud1]}"
key[Left]="${terminfo[kcub1]}"
key[Right]="${terminfo[kcuf1]}"
key[PageUp]="${terminfo[kpp]}"
key[PageDown]="${terminfo[knp]}"
key[Shift-Tab]="${terminfo[kcbt]}"
[[ -n "${key[Home]}" ]] && bindkey -- "${key[Home]}" beginning-of-line
[[ -n "${key[End]}" ]] && bindkey -- "${key[End]}" end-of-line
[[ -n "${key[Insert]}" ]] && bindkey -- "${key[Insert]}" overwrite-mode
[[ -n "${key[Delete]}" ]] && bindkey -- "${key[Delete]}" delete-char
[[ -n "${key[Up]}" ]] && bindkey -- "${key[Up]}" up-line-or-history
[[ -n "${key[Down]}" ]] && bindkey -- "${key[Down]}" down-line-or-history
[[ -n "${key[Left]}" ]] && bindkey -- "${key[Left]}" backward-char
[[ -n "${key[Right]}" ]] && bindkey -- "${key[Right]}" forward-char
[[ -n "${key[PageUp]}" ]] && bindkey -- "${key[PageUp]}" beginning-of-buffer-or-history
[[ -n "${key[PageDown]}" ]] && bindkey -- "${key[PageDown]}" end-of-buffer-or-history
[[ -n "${key[Shift-Tab]}" ]] && bindkey -- "${key[Shift-Tab]}" reverse-menu-complete
# Common escape sequences for Ctrl/Alt + Arrow keys (Alacritty, xterm, etc.)
bindkey '^[[1;5D' backward-word # Ctrl+Left
bindkey '^[[1;5C' forward-word # Ctrl+Right
bindkey '^[Od' backward-word # Ctrl+Left (alternate)
bindkey '^[Oc' forward-word # Ctrl+Right (alternate)
bindkey '^[[1;3D' backward-word # Alt+Left
bindkey '^[[1;3C' forward-word # Alt+Right
fi
# Already present: Alt+b/f for word movement
# bindkey '^[b' backward-word
# bindkey '^[f' forward-word
# Optionally, Alt+Up/Down for directory navigation (custom widgets can be added)
# Ensure terminal is in application mode for terminfo keycodes
if (( ${+terminfo[smkx]} && ${+terminfo[rmkx]} )); then
autoload -Uz add-zle-hook-widget
function zle_application_mode_start { echoti smkx }
function zle_application_mode_stop { echoti rmkx }
add-zle-hook-widget -Uz zle-line-init zle_application_mode_start
add-zle-hook-widget -Uz zle-line-finish zle_application_mode_stop
fi
# Quick edit .zshrc
alias ezrc="nvim ~/.zshrc"
@ -173,10 +262,8 @@ autoload -Uz compinit && compinit
# Keybinds (Navigation, Editing, FZF, Completion)
# =====================
# Emacs mode by default (comment out for vi mode)
bindkey -e
# Uncomment below for vi mode
# bindkey -v
# Emacs/vi mode selection handled earlier to avoid resetting custom binds
# bindkey -v # Uncomment to use vi mode instead
# History search
bindkey '^R' fzf-history-widget # fzf history search (fzf-tab)

View File

@ -1,5 +1,14 @@
# AGENTS.md — Agentic Coding Guide for Dotfiles
**🚨 ABSOLUTE AGENT SAFETY RULES — DO NOT IGNORE 🚨**
- Agents MUST NEVER run any scripts in this repo automatically.
- Agents MUST NEVER modify, symlink, or touch files outside of the repo root or its subdirectories.
- NO file operations or script executions unless the user gives direct, explicit permission for each action.
- All actions must be idempotent, explicit, and user-approved.
- Violating these rules risks breaking the users system and is strictly forbidden.
## Setup, Lint, and Test
- Main entrypoint: `./setup.sh` (runs all `modules/*.sh` in order)
- To re-run a single module: `bash modules/XX-name.sh`

View File

@ -2,10 +2,12 @@
This repository manages your personal dotfiles and a modular, Wayland-ready desktop environment for Arch Linux using `paru`.
---
## Features
- Modular setup: each aspect (packages, symlinks, shell, Neovim, Hyprland, sound, browsers, devtools, etc.) is handled by its own script in `modules/`.
- All dotfiles and app configs are version-controlled and symlinked to your home directory.
- Device-aware: uses `$DOTFILES_DEVICE` and `$HOSTNAME` to select device-specific config fragments (e.g., laptop/desktop, monitor layouts).
- Out-of-the-box integration for Hyprland, Waybar, Rofi, Mako, Alacritty, wlogout, and more.
- Modern sound stack (PipeWire, WirePlumber, pavucontrol, etc.).
- Volume notifications: see current volume as a Mako popup at the bottom center when changed.
@ -13,7 +15,9 @@ This repository manages your personal dotfiles and a modular, Wayland-ready desk
- Brave browser always launches on workspace 10 and autostarts with Hyprland.
- TTY/console uses German nodeadkeys layout (`de-latin1-nodeadkeys`).
- Devtools module installs git, Python, Node.js, Docker, VS Code, opencode-bin, and more.
- Easily extensible: add new modules or configs as needed.
- Easily extensible: add new modules, fragments, or configs as needed.
---
## Setup
@ -27,30 +31,64 @@ This repository manages your personal dotfiles and a modular, Wayland-ready desk
./setup.sh
```
When you run `setup.sh`, you will be prompted to select your device profile (`laptop` or `desktop`).
This ensures that device-specific configs (e.g., battery, backlight, touchpad, monitor layout) are applied correctly for your hardware.
You can also set the environment variable `DOTFILES_DEVICE` to skip the prompt:
When you run `setup.sh`, your device profile is detected via `host-profiles.conf` (mapping `$HOSTNAME` to `$DOTFILES_DEVICE`, e.g., `laptop` or `desktop`).
This ensures that device-specific configs (battery, backlight, touchpad, monitor layout, etc.) are applied correctly for your hardware.
You can also set the environment variable manually to override:
```sh
DOTFILES_DEVICE=desktop ./setup.sh
```
The script will install all required packages and symlink dotfiles and configs (including everything in `.config/`) to your home directory, using the correct device-specific fragments for Hyprland and Waybar.
The script will install all required packages and symlink dotfiles and configs (including everything in `.config/`) to your home directory, using the correct device-specific fragments for Hyprland, Waybar, and more.
---
## Customization
## Customization & Extending
- Add new dotfiles to the repo root (e.g., `.zshrc`, `.tmux.conf`).
- Place app configs in `.config/` (e.g., `.config/hypr/hyprland.conf`).
- Add or edit modules in the `modules/` directory to automate more setup steps.
- To add custom scripts, place them in `.local/bin/` in the repo; they will be symlinked to `~/.local/bin/`.
- To add browsers, edit `modules/06-browsers.sh` (Chrome, Firefox, Brave supported out of the box).
- To add devtools, edit `modules/50-devtools.sh` (includes VS Code, opencode-bin, lazygit, etc.).
- To add new device types (e.g., tablet, server), update `host-profiles.conf` and add corresponding config fragments (e.g., `hypridle-tablet.conf`).
- To add new fragment types, extend the `fragment_types` array in `modules/02-symlinks.sh`.
---
## Requirements
- Arch Linux
- [paru](https://github.com/Morganamilo/paru) (will be installed automatically if missing)
- For TTY keymap: `kbd` package (should be present on most systems)
---
## Quick Reference: Main Modules
| Module | Purpose |
|-----------------------|-----------------------------------------|
| 01-packages.sh | Base packages (shell, tools, etc.) |
| 02-symlinks.sh | Symlinks dotfiles/configs, device-aware |
| 03-shell.sh | Shell setup (Zsh, keymap) |
| 04-nvim.sh | Neovim (AstroNvim) setup |
| 05-sound.sh | Sound stack (PipeWire, etc.) |
| 06-hyprland.sh | Hyprland, Waybar, Rofi, etc. |
| 07-browsers.sh | Browsers (Chrome, Firefox, Brave) |
| 50-devtools.sh | Devtools (git, VS Code, etc.) |
| 99-postinstall.sh | Post-install steps |
---
## Troubleshooting
- **Missing device-specific fragment:** If you see a warning about a missing fragment (e.g., `hypridle-laptop.conf`), create the file in `.config/hypr/includes/` or update your `host-profiles.conf` mapping.
- **Symlink warnings:** If a non-empty directory exists where a symlink should be, the script will warn and skip removal for safety. Manually back up and remove if needed.
- **Package install errors:** Ensure your Arch system is up to date and AUR is reachable. Rerun `setup.sh` after fixing network or package issues.
- **Updating dotfiles:** Pull the latest changes and re-run `./setup.sh` to sync configs and packages.
---
## Safety & Idempotence
- All scripts are safe to re-run and will not overwrite user files unintentionally.
- Symlinking logic only removes symlinks or empty directories; non-empty directories are preserved with a warning.
---
## Notable Integrations & Tips
- **Browsers:** Chrome, Firefox, and Brave are installed via the browser module. Brave autostarts and is always on workspace 10.
@ -61,5 +99,7 @@ The script will install all required packages and symlink dotfiles and configs (
- **No official Teams/Outlook client:** Use the web app or AUR wrappers for best compatibility.
- **TortoiseGit alternative:** Use GitKraken, Sublime Merge, SmartGit, or lazygit for graphical Git workflows.
---
## License
MIT

3
host-profiles.conf Normal file
View File

@ -0,0 +1,3 @@
# Map hostnames to device profiles
lousy-arch=desktop
archlaptop=laptop

View File

@ -1,5 +1,13 @@
#!/usr/bin/env bash
# Ensure required directories exist
# =====================
# Dotfiles Symlinking Script
# =====================
# - Symlinks all dotfiles and app configs from the repo to $HOME and $HOME/.config
# - Handles device-specific fragments for Hyprland, Waybar, etc. using $DOTFILES_DEVICE and $HOSTNAME
# - Idempotent and safe to re-run
# - To extend, add new fragment types to the fragment_types array below
# =====================
mkdir -p "$HOME/.config"
echo "Symlinking dotfiles..."
@ -23,40 +31,76 @@ done
# Symlink .config directory contents
CONFIG_DIR="$DOTFILES_DIR/.config"
if [ -d "$CONFIG_DIR" ]; then
echo "Symlinking .config contents..."
for item in "$CONFIG_DIR"/*; do
[ -e "$item" ] || continue
baseitem="$(basename "$item")"
target_dir="$HOME/.config/$baseitem"
# Remove existing symlink or directory to avoid conflicts
[ -L "$target_dir" ] && rm "$target_dir"
[ -d "$target_dir" ] && [ ! -L "$target_dir" ] && rm -rf "$target_dir"
ln -sf "$item" "$target_dir"
echo "Linked .config/$baseitem"
echo "Symlinking .config contents (files only, recursive)..."
find "$CONFIG_DIR" -type f | while read -r srcfile; do
# Get relative path from $CONFIG_DIR
relpath="${srcfile#$CONFIG_DIR/}"
targetfile="$HOME/.config/$relpath"
targetdir="$(dirname "$targetfile")"
# If targetdir is a symlink, remove it first
[ -L "$targetdir" ] && rm "$targetdir"
mkdir -p "$targetdir"
# Remove existing file/symlink at target
[ -L "$targetfile" ] && rm "$targetfile"
[ -f "$targetfile" ] && rm "$targetfile"
ln -sf "$srcfile" "$targetfile"
echo "Linked $srcfile -> $targetfile"
done
# =====================
# Device-specific symlinks for Hyprland and Waybar
if [ -n "$DOTFILES_DEVICE" ]; then
# Hyprland monitors (hostname-based)
HOSTNAME=$(hostname)
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
ln -sf "$CONFIG_DIR/hypr/includes/hypridle-$DOTFILES_DEVICE.conf" "$CONFIG_DIR/hypr/hypridle.conf"
echo "Linked hypridle-$DOTFILES_DEVICE.conf as hypridle.conf"
# Waybar config
ln -sf "$CONFIG_DIR/waybar/config-$DOTFILES_DEVICE" "$CONFIG_DIR/waybar/config"
echo "Linked config-$DOTFILES_DEVICE as waybar config"
# =====================
# This section handles device-specific config fragments for Hyprland, Waybar, etc.
# Uses $DOTFILES_DEVICE (set by setup.sh) and $HOSTNAME for profile-specific fragments.
# To add new device types (e.g., tablet, server), update host-profiles.conf and add fragments.
# To add new fragment types, extend the fragment_types array below.
# Format: "source_fragment_path:target_symlink_path"
# Example: fragment_types=(
# "hypr/includes/monitors-$HOSTNAME.conf:hypr/includes/monitors.conf"
# "hypr/includes/hypridle-$DOTFILES_DEVICE.conf:hypr/hypridle.conf"
# "waybar/config-$DOTFILES_DEVICE:waybar/config"
# )
if [ -z "$DOTFILES_DEVICE" ]; then
echo "ERROR: DOTFILES_DEVICE environment variable not set. Run setup.sh to detect device profile."
exit 1
fi
HOSTNAME=$(hostname)
# Device-specific fragments to symlink (source:target)
fragment_types=(
"hypr/includes/monitors-$HOSTNAME.conf:hypr/includes/monitors.conf" # Monitor layout per host
"hypr/includes/hypridle-$DOTFILES_DEVICE.conf:hypr/hypridle.conf" # Idle config per device type
"waybar/config-$DOTFILES_DEVICE:waybar/config" # Waybar config per device type
)
# Symlink each device-specific fragment
for fragment in "${fragment_types[@]}"; do
src="${CONFIG_DIR}/${fragment%%:*}"
tgt_rel="${fragment##*:}"
tgt="$HOME/.config/$tgt_rel"
tgt_dir="$(dirname "$tgt")"
mkdir -p "$tgt_dir"
if [ -f "$src" ]; then
# Remove existing file/symlink at target
[ -L "$tgt" ] && rm "$tgt"
[ -f "$tgt" ] && rm "$tgt"
ln -sf "$src" "$tgt"
echo "Linked $src -> $tgt"
else
echo "Warning: Device-specific fragment missing: $src"
# To troubleshoot, ensure the fragment exists for your device/host
fi
done
# =====================
# End device-specific symlinking
# =====================
fi
echo "Dotfiles setup complete!"
echo "====================="
echo "Dotfiles symlinking complete!"
echo "====================="
# Symlink .local/bin scripts
LOCAL_BIN_REPO="$DOTFILES_DIR/.local/bin"

View File

@ -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[@]}"

View File

@ -14,7 +14,7 @@ DEVTOOLS_PACKAGES=(
htop
lazygit
visual-studio-code-bin
opencode-bin
opencode
)
paru -S --needed --noconfirm "${DEVTOOLS_PACKAGES[@]}"

View File

@ -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)
DOTFILES_DIR="$(cd "$(dirname "$0")" && pwd)"
DOTFILES_DEVICE=""
if [ -f "$DOTFILES_DIR/host-profiles.conf" ]; then
DOTFILES_DEVICE=$(awk -F= -v h="$HOSTNAME" '$1==h{print $2}' "$DOTFILES_DIR/host-profiles.conf")
fi
if [ -z "$DOTFILES_DEVICE" ]; then
echo "ERROR: No device profile mapping found for hostname '$HOSTNAME' in $DOTFILES_DIR/host-profiles.conf"
exit 1
fi
export DOTFILES_DEVICE
echo "Using device profile: $DOTFILES_DEVICE"
# Find, sort, and run all modules in the modules directory
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"