summaryrefslogtreecommitdiff
path: root/scripts/fmenu
diff options
context:
space:
mode:
authorSaumit Dinesan <justsaumit@protonmail.com>2022-03-12 19:54:51 +0530
committerSaumit Dinesan <justsaumit@protonmail.com>2022-03-12 19:54:51 +0530
commit54b772cae06eb25adf33297e35234f33ded81a7b (patch)
treef287ee48faa8013e4a8f0ee764a6d3cd850bb24d /scripts/fmenu
parent7197e45d94dbcf4877d585fff8e634896876ae83 (diff)
neovim addition
Diffstat (limited to 'scripts/fmenu')
-rwxr-xr-xscripts/fmenu77
1 files changed, 0 insertions, 77 deletions
diff --git a/scripts/fmenu b/scripts/fmenu
deleted file mode 100755
index d0c6fce..0000000
--- a/scripts/fmenu
+++ /dev/null
@@ -1,77 +0,0 @@
-#!/bin/bash
-
-usage()
-{
- cat << EOF
-usage: $0 options
-
-Index and search files using dmenu
-
-OPTIONS:
- -h Show this message
- -o Store index [default: /tmp/fmenu_index]
- -i Search folders [default: $HOME]
- -x Exclude files [default: ".*\/..*" (i.e. dot-files)]
- -d dmenu parameters [default: -i -l 20]
- -f force reloading index [default: false]
- -t time [default: 5min]
- -u Just update the index
-EOF
-}
-
-FORCE=false
-INDEX="/tmp/fmenu_index"
-DMENU="-i -l 20"
-TIME="+5"
-INPUT=$HOME
-EXCLUDE='.*/\..*'
-DRY=false
-while getopts "ht:fd:o:i:x:u" OPTION
-do
- case $OPTION in
- h)
- usage
- exit 1
- ;;
- f)
- FORCE=true
- ;;
- d)
- DMENU=$OPTARG
- ;;
- t)
- TIME=$OPTARG
- ;;
- o)
- INDEX=$OPTARG
- ;;
- i)
- INPUT=$OPTARG
- ;;
- x)
- EXCLUDE=$OPTARG
- ;;
- u)
- FORCE=true
- DRY=true
- ;;
- ?)
- usage
- exit
- ;;
- esac
-done
-
-function index_files {
- find "$INPUT" \( ! -regex "$EXCLUDE" \) | sed 's/ /\\ /g' | sort -f > "$INDEX"
-}
-
-if [[ ! -a "$INDEX" ]] || ( test `find $INDEX -mmin $TIME` ) || ($FORCE)
-then
- index_files
-fi
-
-if ( ! $DRY )
-then
- cat "$INDEX" | `dmenu $DMENU > /tmp/dmenu_find_output.txt` && cat /tmp/dmenu_find_output.txt | xargs xdg-open
-fi