Skip to content

Commit

Permalink
dmenu_run: Do not show duplicate entries
Browse files Browse the repository at this point in the history
  • Loading branch information
veracioux committed Nov 4, 2023
1 parent 8838253 commit 32becf8
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions scripts.org
Original file line number Diff line number Diff line change
Expand Up @@ -1323,10 +1323,14 @@ Create a Xephyr session for the current user that tries to mimic a regular
cache_file=~/.cache/.desktop-apps.txt
age="$(date -d "now - $(stat -c '%Y' "$cache_file") seconds" +%s)"
# Refresh the cache only if the file is older than a specified age (seconds)
[ ! -f "$cache_file" -o $age -gt 36000 ] || ! grep -q '^.' \
&& pull_desktop_apps \
|| cat "$cache_file"
find ~/.local/bin -executable -type f -printf '%f\n'
{
if [ ! -f "$cache_file" -o $age -gt 36000 ] || ! grep -q '^.'; then
pull_desktop_apps
else
cat "$cache_file"
fi
find ~/.local/bin -executable -type f -printf '%f\n'
} | sort | uniq
}
get_aliases() {
extract_aliases ~/.alias ~/.alias-tmp
Expand Down

0 comments on commit 32becf8

Please sign in to comment.