diff options
| author | 2015-09-07 21:24:24 +0200 | |
|---|---|---|
| committer | 2015-09-07 21:25:46 +0200 | |
| commit | 3b4ffb8c9a5c0ed272032920172147d01cc415bb (patch) | |
| tree | 79beeb7cc90eb50a71a8fef2ca5ee779a8f353e5 | |
| parent | 720477b453555b589b9c3fe0518ccb98f8942edd (diff) | |
| download | dmenu_app-3b4ffb8c9a5c0ed272032920172147d01cc415bb.tar.gz dmenu_app-3b4ffb8c9a5c0ed272032920172147d01cc415bb.tar.bz2 dmenu_app-3b4ffb8c9a5c0ed272032920172147d01cc415bb.zip | |
Added configure script
| -rw-r--r-- | .gitignore | 1 | ||||
| -rwxr-xr-x | configure | 31 | ||||
| -rwxr-xr-x | dmenu_app | 2 |
3 files changed, 33 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f3c7a7c --- /dev/null +++ b/.gitignore | |||
| @@ -0,0 +1 @@ | |||
| Makefile | |||
diff --git a/configure b/configure new file mode 100755 index 0000000..1e55dd5 --- /dev/null +++ b/configure | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | for arg in $@; do | ||
| 4 | case $arg in | ||
| 5 | --prefix=*) | ||
| 6 | destdir=$(echo $arg | cut -d= -f2-) | ||
| 7 | ;; | ||
| 8 | *) | ||
| 9 | ;; | ||
| 10 | esac | ||
| 11 | done | ||
| 12 | |||
| 13 | if [ -z "$destdir" ]; then | ||
| 14 | destdir="/usr" | ||
| 15 | fi | ||
| 16 | |||
| 17 | cat <<MAKEFILE > Makefile | ||
| 18 | # Generated on $(date) by $(whoami)@$(hostname) | ||
| 19 | |||
| 20 | DESTDIR = $destdir | ||
| 21 | |||
| 22 | install: | ||
| 23 | @mkdir -vp "\$(DESTDIR)/bin/" | ||
| 24 | @install -vm 755 dmenu_app "\$(DESTDIR)/bin/" | ||
| 25 | |||
| 26 | uninstall: | ||
| 27 | @-rm -fv -- '\$(DESTDIR)/bin/dmenu_app' | ||
| 28 | |||
| 29 | .PHONY: install uninstall | ||
| 30 | MAKEFILE | ||
| 31 | # vim: set ts=8 sw=8 tw=0 noet : | ||
| @@ -29,7 +29,7 @@ if [ ! -f "$cache_file" ] || [ "$(head -n1 "$cache_file")" != "$checksum" ]; the | |||
| 29 | wait | 29 | wait |
| 30 | fi | 30 | fi |
| 31 | 31 | ||
| 32 | choice=$(cat $cache_file | tail -n +2 | cut -d: -f1 | sort -h | dmenu $@) | 32 | choice=$(cat $cache_file | tail -n +2 | cut -d: -f1 | sort -h | dmenu "$@") |
| 33 | if [ -n "$choice" ]; then | 33 | if [ -n "$choice" ]; then |
| 34 | command=$(sed -n "s/^$choice:\(.*\)$/\1/p" "$cache_file") | 34 | command=$(sed -n "s/^$choice:\(.*\)$/\1/p" "$cache_file") |
| 35 | if [ -n "$command" ]; then | 35 | if [ -n "$command" ]; then |
