From c0bc49b150716d400891f6d5f823e9828a4bfe62 Mon Sep 17 00:00:00 2001 From: Ben Reaves Date: Thu, 11 Feb 2021 20:11:39 -0600 Subject: [PATCH] - Refined Back/Forward/Undo Text/Tabs config for Linux --- linux/browsers.sh | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/linux/browsers.sh b/linux/browsers.sh index 0013911..d1e3794 100755 --- a/linux/browsers.sh +++ b/linux/browsers.sh @@ -3,29 +3,39 @@ action=$1 saveClipboard=$(xclip -selection clipboard -o) -echo "$saveClipboard" echo "" | xclip -i -selection clipboard -# --delay 12 -xdotool getactivewindow key --clearmodifiers Left Left Right Shift+Right ctrl+c Right +if [ "$action" == "Left" ];then + xdotool getactivewindow key --delay 40 --clearmodifiers End bar Shift+Left ctrl+x +fi +if [ "$action" == "Right" ];then + xdotool getactivewindow key --delay 40 --clearmodifiers Home bar Shift+Left ctrl+x +fi +if [ "$action" == "Undo" ];then + xdotool getactivewindow key --delay 24 --clearmodifiers bar Shift+Left ctrl+x + sleep 0.1 +fi + newClipboard=$(xclip -selection clipboard -o) +# echo "$newClipboard" +# echo "hello" -if [ "$newClipboard" == "" ] && [ "$action" == "Left" ];then +if [ "$newClipboard" != "|" ] && [ "$action" == "Left" ];then xdotool getactivewindow key --clearmodifiers alt+Left elif [ "$action" == "Left" ];then xdotool getactivewindow key --clearmodifiers Home fi -if [ "$newClipboard" == "" ] && [ "$action" == "Right" ];then +if [ "$newClipboard" != "|" ] && [ "$action" == "Right" ];then xdotool getactivewindow key --clearmodifiers alt+Right elif [ "$action" == "Right" ];then xdotool getactivewindow key --clearmodifiers End fi -if [ "$newClipboard" == "" ] && [ "$action" == "Undo" ];then - xdotool getactivewindow key --clearmodifiers ctrl+Shift+t +if [ "$newClipboard" != "|" ] && [ "$action" == "Undo" ];then + xdotool getactivewindow key ctrl+Shift+t elif [ "$action" == "Undo" ];then - xdotool getactivewindow key --clearmodifiers ctrl+z + xdotool getactivewindow key --delay 24 --clearmodifiers ctrl+z ctrl+z ctrl+z fi echo $saveClipboard | xclip -i -selection clipboard \ No newline at end of file