rot13

I was browsing through one forum and found constantly portions of text being “rotted”. That is, first 13 alphabetical characters rotated to make text unreadable to mask spoilers and such.
Although there is, for example, rot13.com to decypher such text, I came up with the following to streamline the process:
(You need xclip -program to be installed)

rot13.sh (put it somewhere on your path):

#!/bin/sh
echo "$*" | sed 'y/nopqrstuvwxyzabcdefghijklmNOPQRSTUVWXYZABCDEFGHIJKLM/abcdefgh
ijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ/'
sleep 30

(Sed command should be on one line. This could be made straight into a piperead function, or to use sed ‘blahblah’ $*, or some other way.)

fvwm-config:

AddToFunc Clipboard
+ I Exec $* `xclip -o`

Key F A M Clipboard xterm -e rot13.sh

So now you should be able to select rotted portions of text with mouse, and after pressing alt+f, a xterm should pop up displaying the text, and automatically close after 30 seconds.

[color=red]Edited by theBlackDragon:
–> Moved from Basic questions[/color]

There’s millions of ways to do this. I find the ‘tr’ version much shorter than your sed version:

tr a-zA-Z n-za-mN-ZA-M

Also, if you have the ‘bsdgames’ package installed, you can just use the ‘rot13’ command…

– Thomas Adam

^^
Yes, I was aware you could do it in many ways. I tried to imply so.
Very sorry if it was left unclear. One could improve the above stupid all-wrongly-done piece of crap in many ways, maybe use xmessage instead of xterm, for instance.
Don’t know about the bsdgames tho, I’m running FreeBSD and can’t find such thing from the /usr/src, nor the /usr/ports…

The xclip integration was the interesting bit. There’s a bazillion ways to implement a caesar cypher, but access to the clipboard from the FVWM menu? Cool!

Actually, that was from either the manpage, or FAQ, or zensites … can’t remember from which.

Oh well, I must have managed to miss it.

it’s still cool. :slight_smile:

I see this is still in the basic questions -area. Mods or admins, can you move it back to the functions -area. Thanks.