From e7133668e8cd3909d808678f0b690052f75a3d52 Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Thu, 8 Aug 2024 10:57:15 +0200 Subject: bukuadd: add wayland/x11 guard --- .local/bin/bukuadd_c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to '.local/bin/bukuadd_c') diff --git a/.local/bin/bukuadd_c b/.local/bin/bukuadd_c index 86f705d..1ec34a7 100755 --- a/.local/bin/bukuadd_c +++ b/.local/bin/bukuadd_c @@ -1,8 +1,14 @@ #!/bin/bash -#set -e -url=$(xsel -b) -tags=$(zenity --entry --text="enter tags for $url") +SESH=$(loginctl show-session $(awk '/tty/ {print $1}' <(loginctl)) -p Type | awk -F= '{print $2}') + +if [[ "$SESH" = "wayland" ]]; then + url=$(wl-paste) + tags=$(yad --entry --text="enter tags for $url") +else + url=$(xsel -b) + tags=$(zenity --entry --text="enter tags for $url") +fi if [[ $? -ne 0 ]]; then exit 0 -- cgit v1.2.3-70-g09d2