[hackers] [dmenu] use ~/.dmenu_cache if no xdg cache || Connor Lane Smith

From: <hg_AT_suckless.org>
Date: Mon, 17 Oct 2011 03:13:11 +0200 (CEST)

changeset: 451:720497b01222
tag: tip
parent: 448:6e962f2337c2
user: Connor Lane Smith <cls_AT_lubutu.com>
date: Mon Oct 17 02:12:33 2011 +0100
files: dmenu_run
description:
use ~/.dmenu_cache if no xdg cache


diff -r 6e962f2337c2 -r 720497b01222 dmenu_run
--- a/dmenu_run Sun Oct 16 18:26:11 2011 +0100
+++ b/dmenu_run Mon Oct 17 02:12:33 2011 +0100
_AT_@ -1,9 +1,12 @@
 #!/bin/sh
 CACHE=${XDG_CACHE_HOME:-"$HOME/.cache"}/dmenu_run
+if [ ! -d "`dirname "$CACHE"`" ]; then
+ CACHE=$HOME/.dmenu_cache
+fi
 (
         IFS=:
         if test "`ls -dt $PATH "$CACHE" 2> /dev/null | sed 1q`" != "$CACHE"; then
- mkdir -p "`dirname "$CACHE"`" && lsx $PATH | sort -u > "$CACHE"
+ lsx $PATH | sort -u > "$CACHE"
         fi
 )
 cmd=`dmenu "$_AT_" < "$CACHE"` && exec sh -c "$cmd"
Received on Mon Oct 17 2011 - 03:13:11 CEST

This archive was generated by hypermail 2.3.0 : Mon Oct 17 2011 - 03:24:05 CEST