Skip to content

Commit 54865ad

Browse files
committed
add COPY_TO_CLIPBOARD_OPTION
also fix duplicate 'Copy to clipboard'
1 parent cc97d9c commit 54865ad

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

nbrowser

100644100755
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
NBROWSER_CONFIG_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/nbrowser"
99
NBROWSER_DEFAULT_SEARCH=${NBROWSER_DEFAULT_SEARCH:-duckduckgo}
10+
COPY_TO_CLIPBOARD_OPTION=true
1011

1112
declare -A ENGINES
1213

@@ -198,8 +199,11 @@ open_picture_with(){
198199

199200
open_in_browser(){
200201
# add clipboard
201-
browser_count=$((browser_count+1))
202-
installed_browsers[$browser_count]="Copy to clipboard"
202+
if [ "${COPY_TO_CLIPBOARD_OPTION}" = true ]; then
203+
browser_count=$((browser_count+1))
204+
installed_browsers[$browser_count]="Copy to clipboard"
205+
COPY_TO_CLIPBOARD_OPTION=false
206+
fi
203207

204208
selected_browser=$(printf "%s\n" "${installed_browsers[@]}" | awk 'BEGIN { RS="\n"; FS=" : " } { print $1 "\t : " $2 }'| column -t -s $'\t' | rofi -dmenu -p 'Open URL with' -mesg "${@//&/&}" -i -l "$browser_count" )
205209

0 commit comments

Comments
 (0)