Skip to content

Instantly share code, notes, and snippets.

@zekesonxx
Created February 2, 2016 00:20
Show Gist options
  • Save zekesonxx/3cdb5b1a69a17bc1e1a6 to your computer and use it in GitHub Desktop.
Save zekesonxx/3cdb5b1a69a17bc1e1a6 to your computer and use it in GitHub Desktop.
07:11:24 PM <mjec> I want to bind a key or key-combo to type "¯\_(ツ)_/¯"; using i3. Any thoughts on best way to do this? xmodmap? some script + shortcut key in i3 conf?
# copyright Zeke Sonxx 2016 <github.com/zekesonxx>
# license MIT
SHRUG="¯\_(ツ)_/¯"
TMPFILE=`mktemp`
xclip -o > $TMPFILE
echo $SHRUG | xclip -selection clipboard
xdotool key Ctrl+V
cat $TMPFILE | xclip -selection clipboard
rm $TMPFILE
@mjec
Copy link

mjec commented Feb 2, 2016

This ended up not working when triggered from i3; it's not clear why. However, xdotool was the solution. I ended up with the following in my i3config:

bindsym $mod+Shift+z exec --no-startup-id xdotool key --clearmodifiers --window `xdotool getactivewindow` U00AF backslash underscore parenleft U30C4 parenright underscore slash U00AF

Thanks for pointing me in the right direction!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment