blob: 9b3b1f27dc14e474a3d16c89a7dacccf5706bd9c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
#!/bin/sh
#
# dmenu_path: Override dmenu_path sorting results by atime.
#
# By default, dmenu_path sorts executables alphabetically. It seems to make
# more sense to sort them by atime in an effort to reduce the number of
# keystrokes needed to start a program.
echo $PATH | tr ':' '\n' | uniq | sed 's#$#/#' | # List directories in $PATH
xargs ls -lu --time-style=+%s | # Add atime epoch
awk '/^(-|l)/ { print $6, $7 }' | # Only print timestamp and name
sort -rn | cut -d' ' -f 2
|