Initial import: chezmoi source for Omarchy (Hyprland)
Imported from prdlk/dotfiles master (efdd827), which supersedes the omarchy branch (3031416). Drops the Umbriel, Noctalia, niri, CachyOS, macOS, and Blume docs-site layers; docs/ is plain Markdown.
This commit is contained in:
commit
b18729f4a0
163 files changed
+12685
No files matched your search
@@ -0,0 +1,27 @@
|
||||
# Re-run last command, copy output to clipboard.
|
||||
# History-offset handling: some line editors add the current command to
|
||||
# history before execution, some after — detect instead of assuming.
|
||||
clip-last() {
|
||||
local last copy
|
||||
last=$(fc -ln -1 -1 2>/dev/null)
|
||||
last=${last#"${last%%[![:space:]]*}"} # trim leading whitespace
|
||||
case $last in
|
||||
clip-last*)
|
||||
last=$(fc -ln -2 -2 2>/dev/null)
|
||||
last=${last#"${last%%[![:space:]]*}"}
|
||||
;;
|
||||
esac
|
||||
if [ -z "$last" ]; then
|
||||
echo "clip-last: no previous command in history" >&2
|
||||
return 1
|
||||
fi
|
||||
if command -v wl-copy >/dev/null 2>&1; then
|
||||
copy=wl-copy
|
||||
else
|
||||
echo "clip-last: no clipboard tool (wl-copy) found" >&2
|
||||
return 1
|
||||
fi
|
||||
eval "$last" | "$copy"
|
||||
command -v notify-send >/dev/null 2>&1 \
|
||||
&& notify-send -a shell "Clipboard" "Command output copied to clipboard"
|
||||
}
|
||||
Reference in new issue
Block a user