mirror of
https://github.com/prdlk/dotfiles.git
synced 2026-11-02 19:32:43 +00:00
- 16 cross-shell utilities converted to sh/bash chezmoi executables: ai c2p cp-appid extract_agents fab gdc gh-sonr-org-migrate ghg-clone ghn gho git-summary launch_omp_livediff_overlay lc-elir mdcp mdp pj (ghg-clone not named ghg: unrelated cargo binary owns that name) - cwd/history helpers stay per-shell: yy c cd clip-last + ghg/ghn/gho cd-wrappers in bash/functions/ and zsh/functions/, loaded by rc files - fish keeps only shell-state functions; converted ones now hit PATH - cp-appid ignore gating moved to .local/bin path - dot_agents/skills: 82 skills materialized from dotstate storage so dot_claude skill symlinks resolve on fresh bootstrap; dotstate profile/symlinks.json released .agents/skills .bashrc .zshrc
44 lines
1.2 KiB
Bash
Executable File
44 lines
1.2 KiB
Bash
Executable File
#!/bin/sh
|
||
# Fuzzy-pick a desktop app ID and copy to clipboard.
|
||
existing_dirs=""
|
||
for d in /usr/share/applications \
|
||
/usr/local/share/applications \
|
||
"$HOME/.local/share/applications" \
|
||
/var/lib/flatpak/exports/share/applications \
|
||
"$HOME/.local/share/flatpak/exports/share/applications" \
|
||
/var/lib/snapd/desktop/applications; do
|
||
[ -d "$d" ] && existing_dirs="$existing_dirs $d"
|
||
done
|
||
|
||
if [ -z "$existing_dirs" ]; then
|
||
echo "No application directories found." >&2
|
||
exit 1
|
||
fi
|
||
|
||
# word splitting of $existing_dirs is intended
|
||
# shellcheck disable=SC2086
|
||
chosen=$(
|
||
fd --type f --extension desktop . $existing_dirs \
|
||
| while IFS= read -r f; do
|
||
app_id=$(basename "$f" .desktop)
|
||
name=$(sed -n 's/^Name=//p' "$f" | head -n1)
|
||
[ -z "$name" ] && name=$app_id
|
||
printf '%s\t%s\n' "$name" "$app_id"
|
||
done \
|
||
| sort -u -t "$(printf '\t')" -k1 \
|
||
| fzf \
|
||
--delimiter='\t' \
|
||
--with-nth=1,2 \
|
||
--prompt="App ID › " \
|
||
--height=50% \
|
||
--layout=reverse \
|
||
--border=rounded \
|
||
--info=inline
|
||
)
|
||
|
||
[ -n "$chosen" ] || exit 0
|
||
|
||
app_id=$(printf '%s\n' "$chosen" | cut -f2)
|
||
printf '%s' "$app_id" | wl-copy
|
||
echo "Copied: $app_id"
|