mybin

my ~/bin
git clone https://a3nm.net/git/mybin/
Log | Files | Refs | README

dmenu_run_urxvtcd (439B)


      1 #!/bin/sh
      2 # modified version of dmenu_run to run programs with urxvtcd and shell
      3 
      4 cachedir=${XDG_CACHE_HOME:-"$HOME/.cache"}
      5 if [ -d "$cachedir" ]; then
      6 	cache=$cachedir/dmenu_run
      7 else
      8 	cache=$HOME/.dmenu_cache # if no xdg dir, fall back to dotfile in ~
      9 fi
     10 IFS=:
     11 if stest -dqr -n "$cache" $PATH; then
     12   L=$(stest -flx $PATH | sort -u | tee "$cache" | ~/bin/my-rofi "$@")
     13 else
     14   L=$(~/bin/my-rofi "$@" < "$cache")
     15 fi
     16 urxvtcd -e zsh -c "$L"