diff options
| author | Arpit Chakladar <arpitchakladar+git@gmail.com> | 2026-07-18 14:27:58 +0530 |
|---|---|---|
| committer | Arpit Chakladar <arpitchakladar+git@gmail.com> | 2026-07-18 14:28:30 +0530 |
| commit | bde84587b2a408970086f4c708ac9a629abfa554 (patch) | |
| tree | fc48afc6d44159554d6f18c6fce7ddfccecc364d /modules/scripts/fzf-launcher.sh | |
| parent | 4124a5ae231a585b945c9547a3ab0c37a4eba7e3 (diff) | |
| download | home-manager-config-bde84587b2a408970086f4c708ac9a629abfa554.tar.gz home-manager-config-bde84587b2a408970086f4c708ac9a629abfa554.zip | |
feat: switch launcher to dex, add vi-mode and kitty nav, enable ouch unfree
Rewrite fzf-launcher to use dex via setsid instead of parsing Exec=
lines
Add vi-mode (bindkey -v, KEYTIMEOUT=1) to zsh
Add Ctrl+click link handling and Ctrl+Shift+h/j/k/l window nav to kitty
Switch i3 terminal key from $mod+t to $mod+Return
Enable unRAR support in ouch (override enableUnfree)
Fix epub cover extraction (decompress full archive, use find)
Remove neomutt dd/gT keybindings
Fix missing $TITLE quoting in neomutt-sync
Add findutils and dex to script deps
Diffstat (limited to 'modules/scripts/fzf-launcher.sh')
| -rw-r--r-- | modules/scripts/fzf-launcher.sh | 29 |
1 files changed, 7 insertions, 22 deletions
diff --git a/modules/scripts/fzf-launcher.sh b/modules/scripts/fzf-launcher.sh index 5ae3d95..0858078 100644 --- a/modules/scripts/fzf-launcher.sh +++ b/modules/scripts/fzf-launcher.sh @@ -1,55 +1,41 @@ # Fzf-launcher - FZF-based application launcher (scans .desktop files) + DIRS=( /run/current-system/sw/share/applications "$HOME/.nix-profile/share/applications" "$HOME/.local/share/applications" ) -entries="" +shopt -s nullglob +entries="" for dir in "${DIRS[@]}"; do [[ -d "$dir" ]] || continue - - shopt -s nullglob for f in "$dir"/*.desktop; do [[ -f "$f" ]] || continue - # Skip hidden entries grep -q "^NoDisplay=true" "$f" && continue grep -q "^Hidden=true" "$f" && continue - - # Only GUI apps grep -q "^Type=Application" "$f" || continue grep -q "^Terminal=true" "$f" && continue - # Skip ONLY actual junk categories (not System!) categories=$(grep -m1 "^Categories=" "$f" | cut -d= -f2-) if [[ -n "$categories" ]]; then echo "$categories" | grep -qE "(Settings|Screensaver|DesktopSettings)" && continue fi - # Get name (handle localized fallback) name=$(grep -m1 "^Name=" "$f" | cut -d= -f2-) if [[ -z "$name" ]]; then name=$(grep -m1 -E "^Name\[.*\]=" "$f" | cut -d= -f2-) fi + [[ -z "$name" ]] && continue - # Get exec - exec=$(grep -m1 "^Exec=" "$f" | cut -d= -f2-) - - [[ -z "$name" || -z "$exec" ]] && continue - - # Remove field codes like %U %F etc. - exec=$(echo "$exec" | sed -E 's/ ?%[a-zA-Z]//g') - - entries+="$name"$'\t'"$exec"$'\n' + entries+="$name"$'\t'"$f"$'\n' done done -# Deduplicate + sort entries=$(printf '%s' "$entries" | sort -fu -t$'\t' -k1,1) -# FZF selection chosen=$(printf '%s' "$entries" | fzf \ --prompt='Launch: ' \ --layout=reverse \ @@ -59,7 +45,6 @@ chosen=$(printf '%s' "$entries" | fzf \ [[ -z "$chosen" ]] && exit 0 -exec_cmd=$(printf '%s' "$chosen" | cut -d$'\t' -f2) +desktop_file=$(printf '%s' "$chosen" | cut -d$'\t' -f2-) -# Launch safely -eval "$exec_cmd" &>/dev/null & +setsid -f dex "$desktop_file" </dev/null >/dev/null 2>&1 |
