From 2b54422aedf3f07f01ee2bba06dd2442c45360d7 Mon Sep 17 00:00:00 2001 From: cronyakatsuki <64900606+cronyakatsuki@users.noreply.github.com> Date: Sun, 23 Oct 2022 21:54:23 +0200 Subject: [PATCH] Added wayland support. --- dmenu-link-handler | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/dmenu-link-handler b/dmenu-link-handler index c4f6eff..000f21b 100755 --- a/dmenu-link-handler +++ b/dmenu-link-handler @@ -5,11 +5,10 @@ source $HOME/.config/dmenu/config -[ -z "$@" ] && link=$(xclip -o) || link="$@" - -case "$(printf "mpv\\nbrowser\\ncopy url\\nw3m" | $DMENU -p "Open link with what program?")" in - mpv) "$VIDEO" "$link" ;; - browser) "$BROWSER" "$link" > /dev/null;; - "copy url") echo "$link" | xclip -selection clipboard ;; - w3m) readable "$link" | w3m -T text/html ;; +case "$(printf "mpv\\nbrowser\\ncopy url [X11]\\ncopy url [Wayland]\\nw3m" | $DMENU -p "Open link with what program?")" in + mpv) "$VIDEO" "$@" ;; + browser) "$BROWSER" "$@" > /dev/null;; + "copy url [X11]") echo "$@" | xclip -selection clipboard ;; + "copy url [Wayland]") echo "$@" | wl-copy -n ;; + w3m) readable "$@" | w3m -T text/html ;; esac