Last active
December 26, 2023 09:56
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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