Skip to content

Instantly share code, notes, and snippets.

@kylescottmcgill
Created March 17, 2016 05:34
Show Gist options
  • Select an option

  • Save kylescottmcgill/94af548623ee2e150086 to your computer and use it in GitHub Desktop.

Select an option

Save kylescottmcgill/94af548623ee2e150086 to your computer and use it in GitHub Desktop.
#!/bin/bash
function yap_yank {
focused=$(xdotool getwindowfocus getwindowname)
if [[$focused == "termite"]];
then
xdotool key ctrl+shift+c
else
xdotool key ctrl+c
fi
exit
}
function yap_paste {
focused=$(xdotool getwindowfocus getwindowname)
if [[$focused == "termite"]];
then
xdotool key ctrl+shift+v
else
xdotool key ctrl+v
fi
exit
}
case "$1" in
"yank") yap_yank ;;
"paste") yap_paste ;;
*) exit;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment