Files
nixos-config/home/shell/wayland.sh
T
kiskaadee 3597e035d3 refactor: transition repository to a standalone declarative workstation
- Remove headless server configuration, homelab services, and legacy host directories (`hosts/server/`, `hosts/laptop/`).
- Consolidate privileged system files into a clean `system/` directory (`core.nix`, `hardware.nix`, `desktop.nix`).
- Migrate Home Manager configuration into functional domain modules under `home/` (`desktop.nix`, `dev.nix`, `shell.nix`).
- Update `flake.nix` to expose a single `laptop` target.
- Overhaul documentation (`architecture.md`, `AGENTS.md`, `README.md`) to reflect the standalone architecture and homelab decoupling.

This refactor eliminates the multi-host maintenance tax by decoupling server infrastructure into the Core repository and simplifying workstation management around domain-driven cohesion.
2026-09-12 16:22:58 -05:00

36 lines
1.1 KiB
Bash

# 📋 Custom Wayland Desktop Utilities
# Sourced in .bashrc to provide command-line utilities optimized for Wayland compositor environments.
# 1. wlc: Executing a command, printing output to terminal, and concurrently piping output into the Wayland clipboard.
# Optional `-h` or `--headers` inserts a command/time header at the top of clipboard content.
wlc() {
local header_mode=false
local cmd_str
# Process script command line flags
while [[ "$#" -gt 0 ]]; do
case "$1" in
-h|--headers) header_mode=true; shift ;;
--) shift; break ;;
*) break ;;
esac
done
if [[ "$#" -eq 0 ]]; then
echo "Usage: wlc [--headers] <command> [args...]" >&2
return 1
fi
cmd_str="$*"
# Execute and output
{
if [[ "$header_mode" == true ]]; then
printf "# Command: %s\n" "$cmd_str"
printf "# Date: %s\n" "$(date '+%Y-%m-%d %H:%M:%S')"
printf "# Type: combined (stdout/stderr)\n\n"
fi
"$@" 2>&1
} | tee >(wl-copy) # Output to terminal and copy to clipboard buffer using wl-copy
}