Skip to content

Instantly share code, notes, and snippets.

@enisozgen
Last active December 26, 2023 09:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save enisozgen/fc4ed9ad300e954629c93a0ccb32a395 to your computer and use it in GitHub Desktop.
Save enisozgen/fc4ed9ad300e954629c93a0ccb32a395 to your computer and use it in GitHub Desktop.
ingilizce klavye ile yazılmış türkçe kelimeleri doğru yazmaya yarayan script
#!/bin/bash
# 1. Run `bash global-emacs-turkish-correct-buffer.sh` from rofi or set some keybinding for this command
# More info
# https://github.com/emres/turkish-mode
# http://denizyuret.blogspot.com/2006/11/emacs-turkish-mode.html
function global-emacs-turkish-correct-buffer
{
TEMPFILE="$(mktemp emacs-turkish-$(date +"%Y-%m-%dT%H-%M-%S").XXXXXXX --tmpdir)"
xsel --clipboard > "$TEMPFILE"
emacsclient -c -n --no-wait --eval "(find-file \"$TEMPFILE\")" \
--eval '(turkish-correct-buffer)' \
--eval '(save-buffer)' \
--eval '(set-visited-file-name nil)' \
--eval '(spacemacs/frame-killer)'
}
# Copy file
xdotool key --clearmodifiers ctrl+c
global-emacs-turkish-correct-buffer
cat $TEMPFILE | xclip -sel clip
# Paste output
xdotool key --clearmodifiers ctrl+v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment