forked from extern/nix-config
sxhkd: Add clipboard to browser
This makes it easy to search for text without having to worry about browser extensions or even being in the browser itself.
This commit is contained in:
parent
5a3b02add8
commit
bd83212581
27
sxhkd/.config/sxhkd/ctb.sh
Executable file
27
sxhkd/.config/sxhkd/ctb.sh
Executable file
@ -0,0 +1,27 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# Clipboard to browser
|
||||||
|
|
||||||
|
CLIPBOARD="$(xclip -o)"
|
||||||
|
OPEN="/usr/bin/$BROWSER"
|
||||||
|
URL=""
|
||||||
|
|
||||||
|
if [[ "$1" == "jisho" ]]; then
|
||||||
|
URL="https://jisho.org/search/$CLIPBOARD"
|
||||||
|
|
||||||
|
elif [[ "$1" == "weblio" ]]; then
|
||||||
|
URL="https://ejje.weblio.jp/content/$CLIPBOARD"
|
||||||
|
|
||||||
|
elif [[ "$1" == "forvo" ]]; then
|
||||||
|
# URL="https://forvo.com/search/$CLIPBOARD"
|
||||||
|
URL="https://forvo.com/word/$CLIPBOARD/#ja"
|
||||||
|
|
||||||
|
elif [[ "$1" == "deepl" ]]; then
|
||||||
|
URL="https://www.deepl.com/translator#ja/en/$CLIPBOARD"
|
||||||
|
|
||||||
|
elif [[ "$1" == "cambridge" ]]; then
|
||||||
|
URL="https://dictionary.cambridge.org/dictionary/english/$CLIPBOARD"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$URL" != "" ]]; then
|
||||||
|
"$OPEN" "$URL"
|
||||||
|
fi
|
@ -128,6 +128,18 @@ super + F11
|
|||||||
notify-send -t 2000 "F11" "No command defined."
|
notify-send -t 2000 "F11" "No command defined."
|
||||||
|
|
||||||
super + F12
|
super + F12
|
||||||
notify-send -t 2000 "F12" "No command defined."
|
~/.config/sxhkd/ctb.sh jisho
|
||||||
|
|
||||||
|
super + Home
|
||||||
|
~/.config/sxhkd/ctb.sh forvo
|
||||||
|
|
||||||
|
super + End
|
||||||
|
~/.config/sxhkd/ctb.sh weblio
|
||||||
|
|
||||||
|
super + Insert
|
||||||
|
~/.config/sxhkd/ctb.sh deepl
|
||||||
|
|
||||||
|
super + Delete
|
||||||
|
~/.config/sxhkd/ctb.sh cambridge
|
||||||
|
|
||||||
# vim:ft=sxhkdrc
|
# vim:ft=sxhkdrc
|
||||||
|
Loading…
Reference in New Issue
Block a user