commit b7a520a31c02b086a391b9dfe637df5b446cde4e
parent ba4f5feeaf8d9b45540577d5878fd8f38865a3a4
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Thu, 13 Jun 2019 13:49:12 +0200
Add man9 command for looking up POSIX man pages, simplify showclip
Diffstat:
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/.commands.sh b/.commands.sh
@@ -22,7 +22,6 @@ c() {
[ -n "$dir" ] && cd "$dir" || return
}
-
## ls
if [ "$(uname)" != 'Darwin' ]; then
alias ls='ls --color=auto -F'
@@ -32,7 +31,6 @@ fi
alias l='ls -alFh'
alias la='ls -A'
-
## Open files
o() {
[ "$(uname)" = 'Darwin' ] && open="open" || open="xdg-open"
@@ -141,7 +139,6 @@ news() {
torify w3m "$url"
}
-
## web services
alias youtube-dl='youtube-dl -f bestvideo+bestaudio/best --all-subs --embed-subs'
weather() { curl "wttr.in/?m"; }
@@ -206,5 +203,14 @@ gcagp_all_sl() {
done
}
+man9() {
+ plan9mans="/opt/plan9/share/man/man1"
+ if [ $# -lt 1 ]; then
+ 1="$(cd "$plan9mans" && find -- * -type f | sed 's/\.1$//' | fzy)"
+ fi
+ f="$plan9mans/${1}.1"
+ [ -e "$f" ] && man "$f"
+}
+
# shellcheck source=/dev/null
[ -f ~/.shortcuts ] && . ~/.shortcuts
diff --git a/.local/bin/showclip b/.local/bin/showclip
@@ -1,13 +1,7 @@
#!/bin/sh
-# Display contents of selection via dunst if running.
-# Separate script for i3.
-
-! pgrep -x dunst >/dev/null && echo "dunst not running." && exit
-
clip=$(xclip -o -selection clipboard)
-
prim=$(xclip -o -selection primary)
-[ "$clip" != "" ] && notify-send "Clipboard (C-v, st)" "$clip"
-[ "$prim" != "" ] && notify-send "Primary (middle click, Vim, Tmux)" "$prim"
+[ -n "$clip" ] && notify-send "Clipboard (C-v, st)" "$clip"
+[ -n "$prim" ] && notify-send "Primary (middle click, Vim, Tmux)" "$prim"