├── LICENSE ├── README.md └── conf.d └── insulter.fish /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 asteroidalaz 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # fish-insulter 2 | 3 | The Fish-Insulter is a fun utility that randomly teases or jests at the user when an incorrect command is typed. It is inspired from the [bash-insulter](https://github.com/hkbakke/bash-insulter) project to add a playful twist to Fish Shell! 4 | 5 | **Disclaimer: No users were harmed during the making of this utility. 😄** 6 | 7 | ![Preview](https://github.com/Alaz-Oz/fish-insulter/assets/51114513/d4274be7-38ab-4696-be52-3ccf8ca7c934) 8 | 9 | ```fish 10 | noob@fish:~ > sl 11 | 12 | Y u no speak computer??? 13 | 14 | fish: Unknown command: sl 15 | noob@fish:~ > gti status 16 | 17 | This is why nobody likes you. 18 | 19 | fish: Unknown command: gti 20 | noob@fish:~ > sp aux 21 | 22 | Go outside. 23 | 24 | fish: Unknown command: sp 25 | noob@fish:~ > f 26 | 27 | n00b alert! 28 | 29 | fish: Unknown command: f 30 | ``` 31 | ### Features 32 | - Offers humorous responses for mistyped commands. 33 | - Customizable insult messages and frequency to match your style. 34 | - Easy installation for the modern Fish shell, version 3.2.0 and above. 35 | 36 | ## Compatibility 37 | - Compatible with Fish shell version `3.2.0` or higher. 38 | 39 | ## Installation 40 | 41 | ### Using Package Managers 42 | 43 | For [Oh My Fish (omf)](https://github.com/oh-my-fish/oh-my-fish) users: 44 | ```fish 45 | omf install https://github.com/Alaz-Oz/fish-insulter 46 | ``` 47 | 48 | For [Fisher](https://github.com/jorgebucaran/fisher) users: 49 | ```fish 50 | fisher install Alaz-Oz/fish-insulter 51 | ``` 52 | 53 | ### Manual Installation 54 | 55 | For Single User: 56 | ```fish 57 | git clone https://github.com/Alaz-Oz/fish-insulter.git fish-insulter 58 | cp fish-insulter/conf.d/insulter.fish ~/.config/fish/conf.d/ 59 | ``` 60 | 61 | For All Users (not recommended): 62 | ```fish 63 | sudo git clone https://github.com/Alaz-Oz/fish-insulter.git fish-insulter 64 | sudo cp fish-insulter/conf.d/insulter.fish /etc/fish/conf.d/ 65 | ``` 66 | 67 | Open a new Fish shell instance to enjoy the insults! 68 | 69 | ### Customization 70 | The Fish-Insulter allows for easy customization using environment variables, offering control over the insults' content, frequency, and appearance. These variables can be set in your `config.fish` file or created in a file within the `conf.d` directory of your Fish configuration folder. 71 | 72 | #### Available Environment Variables: 73 | 74 | - **`CMD_NOT_FOUND_MSGS`**: Custom messages to replace the default insult list. 75 | 76 | - **`CMD_NOT_FOUND_MSGS_APPEND`**: Additional messages to complement the existing insult list. 77 | 78 | - **`COMMENT_FREQ`**: Sets the frequency of insults. A value of `0` means never, `5` implies about half the time, and `10` triggers an insult every time. (Default: `4`) 79 | 80 | - **`COMMENT_COLOR`**: Specifies the text color printed with a number from 1 to 255. Using `0` results in a random color for added enjoyment. (Default: `0`) 81 | 82 | #### Configuration Steps: 83 | 84 | 1. **For `config.fish`**: 85 | 86 | Open your `config.fish` file using a text editor and add or modify the desired environment variables in the following format: 87 | ```fish 88 | set -gx CMD_NOT_FOUND_MSGS "Your custom insult messages here" 89 | set -gx CMD_NOT_FOUND_MSGS_APPEND "Additional insults to append" 90 | set -gx COMMENT_FREQ 5 91 | set -gx COMMENT_COLOR 123 92 | ``` 93 | 94 | 2. **For `conf.d` Directory**: 95 | 96 | Create a new file (e.g., `insulter-customization.fish`) within your Fish configuration's `conf.d` directory. Inside this file, define the environment variables in the same format as above. 97 | 98 | Ensure to replace the values with your preferred messages, frequencies, or colors as desired. 99 | 100 | ## Future enhancements 101 | - **Angel Mode**: A kinder, supportive alternative. 102 | - Improved customization options for a tailored experience. 103 | 104 | ### Similar Projects 105 | - [bash-insulter](https://github.com/hkbakke/bash-insulter): For users of Bash or Zsh. 106 | 107 | ### Contribution and Feedback 108 | We appreciate your input! If you have ideas to enhance this project or encounter any issues, please raise an issue or submit a pull request. 109 | 110 | Remember, it's all in good fun! 😉 Feel free to drop by and say hi to `AlazOz`. 111 | -------------------------------------------------------------------------------- /conf.d/insulter.fish: -------------------------------------------------------------------------------- 1 | # Author: AlazOz 2 | # Inspiration: https://github.com/hkbakke/bash-insulter 3 | 4 | function __insulter_print_message 5 | set color 0 6 | set freq 4 7 | set messages \ 8 | "Go ask your mother"\ 9 | "Quit typing rubbish"\ 10 | "Okay, I am leaving"\ 11 | "Go play outside"\ 12 | "Did you mean, sudo rm -rf /"\ 13 | "End this here and now"\ 14 | "Waiting for the AI to take over?"\ 15 | "Sorry there is no Auto-correct feature here"\ 16 | "Calling FBI on you"\ 17 | "Please write carefully"\ 18 | "Deleting system..."\ 19 | "You are mad! or what!?" \ 20 | "Boooo!" \ 21 | "Don't you know anything?" \ 22 | "RTFM!" \ 23 | "Haha, n00b!" \ 24 | "Wow! That was impressively wrong!" \ 25 | "Pathetic" \ 26 | "The worst one today!" \ 27 | "n00b alert!" \ 28 | "Your application for reduced salary has been sent!" \ 29 | "lol" \ 30 | "u suk" \ 31 | "lol... plz" \ 32 | "plz uninstall" \ 33 | "And the Darwin Award goes to.... $USER!" \ 34 | "ERROR_INCOMPETENT_USER" \ 35 | "Incompetence is also a form of competence" \ 36 | "Bad." \ 37 | "Fake it till you make it!" \ 38 | "What is this...? Amateur hour!?" \ 39 | "Come on! You can do it!" \ 40 | "Nice try." \ 41 | "What if... you type an actual command the next time!" \ 42 | "What if I told you... it is possible to type valid commands." \ 43 | "Y u no speak computer???" \ 44 | "This is not Windows" \ 45 | "Perhaps you should leave the command line alone..." \ 46 | "Please step away from the keyboard!" \ 47 | "error code: 1D10T" \ 48 | "ACHTUNG! ALLES TURISTEN UND NONTEKNISCHEN LOOKENPEEPERS! DAS KOMPUTERMASCHINE IST NICHT FÜR DER GEFINGERPOKEN UND MITTENGRABEN! ODERWISE IST EASY TO SCHNAPPEN DER SPRINGENWERK, BLOWENFUSEN UND POPPENCORKEN MIT SPITZENSPARKEN. IST NICHT FÜR GEWERKEN BEI DUMMKOPFEN. DER RUBBERNECKEN SIGHTSEEREN KEEPEN DAS COTTONPICKEN HÄNDER IN DAS POCKETS MUSS. ZO RELAXEN UND WATSCHEN DER BLINKENLICHTEN." \ 49 | "Pro tip: type a valid command!" \ 50 | "Go outside." \ 51 | "This is not a search engine." \ 52 | "So, I'm just going to go ahead and run rm -rf / for you." \ 53 | "Why are you so stupid?!" \ 54 | "Perhaps computers is not for you..." \ 55 | "Why are you doing this to me?!" \ 56 | "Don't you have anything better to do?!" \ 57 | "I am _seriously_ considering 'rm -rf /'-ing myself..." \ 58 | "This is why you get to see your children only once a month." \ 59 | "This is why nobody likes you." \ 60 | "Are you even trying?!" \ 61 | "Try using your brain the next time!" \ 62 | "My keyboard is not a touch screen!" \ 63 | "Commands, random gibberish, who cares!" \ 64 | "Typing incorrect commands, eh?" \ 65 | "Are you always this stupid or are you making a special effort today?!" \ 66 | "Dropped on your head as a baby, eh?" \ 67 | "Brains aren't everything. In your case they're nothing." \ 68 | "I don't know what makes you so stupid, but it really works." \ 69 | "You are not as bad as people say, you are much, much worse." \ 70 | "Two wrongs don't make a right, take your parents as an example." \ 71 | "You must have been born on a highway because that's where most accidents happen." \ 72 | "If what you don't know can't hurt you, you're invulnerable." \ 73 | "If ignorance is bliss, you must be the happiest person on earth." \ 74 | "You're proof that god has a sense of humor." \ 75 | "Keep trying, someday you'll do something intelligent!" \ 76 | "If shit was music, you'd be an orchestra." \ 77 | "How many times do I have to flush before you go away?" 78 | 79 | # Seed RANDOM with an integer of some length 80 | set RANDOM (random) 81 | 82 | test -n "$COMMENT_FREQ" && set freq $COMMENT_FREQ 83 | # Compatiblity with bash-insulter 84 | test -n "$CMD_NOT_FOUND_MSGS" && set messages $CMD_NOT_FOUND_MSGS 85 | test -n "$CMD_NOT_FOUND_MSGS_APPEND" && set -a messages $CMD_NOT_FOUND_MSGS_APPEND 86 | 87 | test -n "$COMMENT_COLOR" && set color $COMMENT_COLOR 88 | if [ $color = 0 ]; 89 | set color (random 1 255) 90 | end 91 | 92 | # Print a randomly selected message, but only about half the time to annoy the user a 93 | # little bit less. 94 | if test (math $RANDOM % 10) -lt $freq; 95 | set message $messages[(math \( $RANDOM % (count $messages) \) + 1)] 96 | printf "\\n %s\\n\\n" "$(tput bold)$(tput setaf $color)$message$(tput sgr0)" >&2 97 | end 98 | end 99 | 100 | function fish_command_not_found 101 | __insulter_print_message 102 | __fish_default_command_not_found_handler $argv 103 | end 104 | --------------------------------------------------------------------------------