• ArcaneSlime@lemmy.dbzer0.com
    link
    fedilink
    arrow-up
    1
    ·
    4 days ago

    What it feels like using windows.

    “Please shutdown?”

    “No, forced update time.”

    “Please uninstall this browser and use this other instead?”

    “No.”

  • LovableSidekick@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    10 days ago

    side note: My all-time favorite linux utility is “fuck”. When you make a mistake and get a command line error, you type the word fuck and it looks at what you previously typed and the error message, and tries to figure out your mistake and what you should have typed instead. Then it types that in for you. If it’s correct all you have to do is hit Enter. Or you can edit first, but it’s usually right. Amazing tool, and doesn’t even use AI, just a list of common errors. It’s been around for years and years. Its mere existence really captures the whole culture of linux IMO.

  • hasecilu@lemm.ee
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    8 days ago

    I prefer to use kudasai … but as some may already know, it should be at the end of the sentence command 😅, so I added a custom hook to my ZSH config to make it run commands as pacman -Syu kudasai.

    Essentially you can add any type of string matching in the function. Add this to the end of your .zshrc file:

    function kudasai_preexec() {
        # Check if the last word is ' kudasai'
        if [[ $1 == *" kudasai" ]]; then
            # Remove ' kudasai' and prepend 'sudo'
            cmd=${1%" kudasai"}
            eval "sudo $cmd"
            # Prevent the original command from running
            return 1
        fi
    }
    
    # Register the preexec hook
    autoload -Uz add-zsh-hook
    add-zsh-hook preexec kudasai_preexec
    

    Edit: as downside you always get 1 exit code with this implementation (little_annoying) .