diff options
| author | Peter Son Struschka <me@peter-struschka.com> | 2020-10-11 12:15:08 +0800 |
|---|---|---|
| committer | Peter Son Struschka <me@peter-struschka.com> | 2020-10-11 20:22:03 +0800 |
| commit | e5209aad576fe44d3965fcb94d6709348b0a93bf (patch) | |
| tree | 3f8c4388d5b2511d78debf5e2d9b1357c3187b38 /herbstluftwm/.local/bin/run_list.sh | |
| parent | 37dd411698bd6eae8365260dde39b8ae9c7cbd36 (diff) | |
| download | dotfiles-e5209aad576fe44d3965fcb94d6709348b0a93bf.tar.gz dotfiles-e5209aad576fe44d3965fcb94d6709348b0a93bf.tar.bz2 dotfiles-e5209aad576fe44d3965fcb94d6709348b0a93bf.tar.lz dotfiles-e5209aad576fe44d3965fcb94d6709348b0a93bf.tar.xz dotfiles-e5209aad576fe44d3965fcb94d6709348b0a93bf.tar.zst dotfiles-e5209aad576fe44d3965fcb94d6709348b0a93bf.zip | |
all: overhaul
all: Remove old symlinks
herbstluftwm: use polybar instead of dzen2
polybar: update config
doom-emacs: update repository
Diffstat (limited to 'herbstluftwm/.local/bin/run_list.sh')
| -rwxr-xr-x | herbstluftwm/.local/bin/run_list.sh | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/herbstluftwm/.local/bin/run_list.sh b/herbstluftwm/.local/bin/run_list.sh new file mode 100755 index 0000000..463bbaf --- /dev/null +++ b/herbstluftwm/.local/bin/run_list.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env sh +set -eu #o pipefail + +cachedir=${XDG_CACHE_HOME:-"$HOME/.cache"} +if [ -d "$cachedir" ]; then + cache=$cachedir/run_list +else + cache=$HOME/.run_list +fi + +#if [ ! -f "$cache" ] || [ $(find "$cache" -mmin +180) = "$cache" ]; then +IFS=':' +if [ ! -f "$cache" ] || [ $(find $PATH -prune -cnewer "$cache" 2>/dev/null |\ + head -c1 | wc -c) -eq 1 ]; then + + find -L $PATH -maxdepth 1 -type f -executable -printf "%f\n" 2>/dev/null |\ + sort -u | tee "$cache" +else + cat "$cache" +fi |
