Print an ascii cat randomly about every 20th time you type cd in your shell. Write to your ~/.bashrc:
[[ -t 1 && $((RANDOM%20)) -eq 0 ]] && echo " meow (=^_^=) )~"
builtin cd "$@"
@adi zsh and fish users might complain with "it's not working!" 😉
@absturztaube Das ist ja nicht nervig, nur wenn er nicht gerne Katzen hat, aber dann hat er es verdient :-D
@adi Great idea for when a colleague forgot to lock his system!
@alex just make sure to replace the cat with a more confusing message like "cd: write error: No space left on device" ;-)
@adi [[ -t 1 ]] tests if it's interactive?
@luna It tests if stdout is opened in a terminal. I had to add it, because copy-pasted commands like `(cd directory && some_command) | another_command` failed.
@luna You can see the difference here:
$ [[ -t 1 ]] && echo yes || echo no
$ ([[ -t 1 ]] && echo yes || echo no) | cat
@email@example.com i put it in the cat command, but it echos to stderr so if im using cat to copy files or image stuff, its fine
and also cd too
@purringChaos That is a really nice touch to it!
@firstname.lastname@example.org mew :3
@adi Thank you! It works!
@irina My pleasure! I'm happy to spread some joy 😃
@adi Would be better for the "cat" command, I would've thought...
chaos.social – a Fediverse instance for & by the Chaos community