21 lines
540 B
Bash
21 lines
540 B
Bash
|
#!/bin/sh
|
||
|
|
||
|
## quick web browsing ##
|
||
|
|
||
|
. $HOME/.config/wms/wms_var
|
||
|
|
||
|
COLORS="-menu-background-color 0x000000 \
|
||
|
-menu-foreground-color 0x$AC \
|
||
|
-scroll-bar-bar-color 0x$AC \
|
||
|
-scroll-bar-frame-color 0x$IC"
|
||
|
|
||
|
BROWSER="links2 -g $COLORS"
|
||
|
XSEL=$(atomx CUT_BUFFER0 $(lsw -r))
|
||
|
|
||
|
echo $XSEL | grep -Eq "^https://|^http://" && $BROWSER $XSEL \
|
||
|
|| $BROWSER "https://duckduckgo.com/?q=$XSEL"
|
||
|
|
||
|
## xselection ##
|
||
|
# under xprop: XSEL=$(xprop -root | awk -F "=" '/CUT_BUFFER0/ {gsub("\"","",$2); print $2}')
|
||
|
# under wmutils: XSEL=$(atomx CUT_BUFFER0 $(lsw -r))
|