diff options
Diffstat (limited to 'dmenu')
-rw-r--r-- | dmenu/Makefile | 18 | ||||
-rwxr-xr-x | dmenu/man | 39 | ||||
-rwxr-xr-x | dmenu/plumb | 4 |
3 files changed, 13 insertions, 48 deletions
diff --git a/dmenu/Makefile b/dmenu/Makefile index 5ed7d04..d60be4d 100644 --- a/dmenu/Makefile +++ b/dmenu/Makefile @@ -1,23 +1,23 @@ .POSIX: -include ../common.mk install: - $(CHECK_INSTALLED) dash - $(CHECK_INSTALLED) vis - make -C unicode.d + ../check-installed-shebang dmenu + ../check-installed-shebang ipa + ../check-installed-shebang unicode + ../check-installed-shebang plumb + ../check-in-path vis + cd unicode.d && make mkdir -p -- ~/.local/bin ln -sf -- ~/.dotfiles/dmenu/dmenu ~/.local/bin/ - ln -sf -- ~/.dotfiles/dmenu/man ~/.local/bin/ ln -sf -- ~/.dotfiles/dmenu/ipa ~/.local/bin/ ln -sf -- ~/.dotfiles/dmenu/unicode ~/.local/bin/ ln -sf -- ~/.dotfiles/dmenu/plumb ~/.local/bin/ uninstall: + +! ../check-installed dmenu + +! ../check-installed suckless-tools -unlink -- ~/.local/bin/dmenu - -unlink -- ~/.local/bin/man -unlink -- ~/.local/bin/ipa -unlink -- ~/.local/bin/unicode -unlink -- ~/.local/bin/plumb - -make -C unicode.d reallyclean - -.PHONY: install uninstall + -cd unicode.d && make reallyclean diff --git a/dmenu/man b/dmenu/man deleted file mode 100755 index 1b29656..0000000 --- a/dmenu/man +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/dash - -# Browse with dmenu if no page has been specified -if test $# = 0; then - manpage="$(/usr/bin/man -k '' | dmenu -l 40 | sed 's/^\([^ ]*\) (\([^)]*\)).*$/\2 \1/')" - if test -z "$manpage"; then - exit 1 - fi - set $manpage -fi - - -# Bold -export LESS_TERMCAP_md="$(printf '\033[01;34m')" -export LESS_TERMCAP_me="$(printf '\033[0m')" - -# Italic -export LESS_TERMCAP_us="$(printf '\033[01;04;32m')" -export LESS_TERMCAP_ue="$(printf '\033[0m')" - -# Reverse video -if test "$TERM" = linux; then - export LESS_TERMCAP_so="$(printf '\033[07m')" -else - export LESS_TERMCAP_so="$(printf '\033[07;01m')" -fi -export LESS_TERMCAP_se="$(printf '\033[0m')" - - -# Display, open new terminal if in the background -if isfg; then - exec /usr/bin/man "$@" -elif test -x /usr/bin/terminator; then - exec terminator -e "/usr/bin/man $*" -elif test -x /usr/bin/st; then - exec st -e /usr/bin/man "$@" -else - exec xterm -e /usr/bin/man "$@" -fi diff --git a/dmenu/plumb b/dmenu/plumb index 13cfca8..c0d98f3 100755 --- a/dmenu/plumb +++ b/dmenu/plumb @@ -90,7 +90,11 @@ functions="$functions duckduckgo" duckduckgo () { exec $WEB_BROWSER "https://duckduckgo.com/?q=$sel"; } +# TODO add other search engines +if (( $(printf '%s' "$sel" | wc -m) > 100 )); then + sel='selected text' +fi function="$(printf '%s\n' $functions | dmenu -i -p "Plumb $sel to:" -l 50)" if test -n "$function"; then |