Hi. I’ve been using powerlevel10k for a long time, but a few days ago, I decided I wanted to customize it a bit. I opened the .p10k.zsh file, and I was shocked. It’s really massive, with TONS of options. I’ve been digging through for a few hours already, and it’s absolutely amazing how much you can customize it without actually programming anything. I was wondering what other people are using. So my questions are:

  • Do you customize your shell prompt?
  • If yes, do you use some framework or pre-made theme, or do you just configure it the vanilla way in your bashrc/zshrc/…
  • How is your experiences with it so far?
  • Share screenshot of your prompts, please (Sadly, my prompt is currently half done, so I can’t really share it)
  • Hellfire103@sopuli.xyz
    link
    fedilink
    English
    arrow-up
    14
    arrow-down
    1
    ·
    edit-2
    9 months ago

    I use Zsh with the Oh My Zsh! framework, and I use a different theme depending on which subuserland I’m in, by customising ~/.zshrc. For example, I use the gentoo theme on Debian and its derivatives, agnoster on NixOS, darkblood on Arch, strug for Mageia, apple on my macOS device, aussiegeek on FreeBSD, and gallifrey on OpenBSD. Different themes helps me remember which package manager to use and which distro-specific commands will work.

    I’ll send some screenshots in a bit, when I boot up my PC.

    I like Zsh because of its tab completion and command history. I also quite like its plugins.

    Before anyone asks, I have tried Fish before, and I prefer Zsh. I have tried configuring Bash before, and I prefer Zsh. I have played with Ksh and Tcsh on BSD, and I prefer Zsh. I used PowerShell a long time ago, and I prefer Zsh.

  • Guenther_Amanita@feddit.de
    link
    fedilink
    arrow-up
    12
    arrow-down
    1
    ·
    edit-2
    9 months ago

    I just use the default fish without any modifications.

    To be fair, I don’t use the terminal that often.

    Even for my homeserver, I access most stuff (containers, updates, etc.) graphically with CasaOS (a web interface), and as a more “casual” PC user, I work with the tools given by my DE. I don’t do much fancy stuff.

    And when I really need the CLI, fish is alright for me. It’s simple, has sane defaults, and feels (thanks to the automatically activated spell check and completion) very efficient for me.

    Bash isn’t bad, but feels a bit lackluster. Zsh may be better, but requires too much configuration for what it’s worth for me.

    • PseudoSpock@lemmy.dbzer0.com
      link
      fedilink
      arrow-up
      1
      arrow-down
      1
      ·
      9 months ago

      You’ll want to start toning your skills with Bash and other POSIX shells like AT&T ksh, zsh, and dash if you ever wish to do serious scripting for work… either that, or start learning Python. That is, unless you already have those under your belt. Apology in advance if you already do… I just couldn’t understand switching to Fish after already having those skills. If you do, and you then switched to Fish, what was the benefit of that? Just curious.

  • nbailey@lemmy.ca
    link
    fedilink
    English
    arrow-up
    9
    ·
    9 months ago

    I use plain old bash with the plain old .bashrc that ships with Debian. I’ll bolt on a git-branch-aware function into the prompt here and there, but that’s about it.

    Why? I ssh into a few dozen machines most days and my shitty little lizard brain can’t deal with everything being different on each box. So as much as I appreciate zsh, powerline plug-ins, all that glitzy stuff, I’ll be a late adopter when it comes to plain old Debian stable…

    • thelastknowngod@lemm.ee
      link
      fedilink
      arrow-up
      0
      arrow-down
      1
      ·
      9 months ago

      This was me until the kubernetes transition occurred. Now I ssh into nothing unless it’s a personal box. I’ve become a zsh convert.

      • InputZero@lemmy.ml
        link
        fedilink
        arrow-up
        1
        ·
        9 months ago

        I’ve been casually transitioning to kubernetes and zsh, but I’m just too comfortable with bash and my os running on bare metal. (He says with more than half his apps switched to containers.) It’s simple, effective, and is always available. I should take the plunge, someday.

        • thelastknowngod@lemm.ee
          link
          fedilink
          arrow-up
          1
          ·
          9 months ago

          FWIW, once I got deep enough into it, the thought of going back to the old way seemed like a crazy idea. I don’t want to manage servers like that again if it can be avoided. YMMV.

  • z3bra@lemmy.sdf.org
    link
    fedilink
    arrow-up
    6
    ·
    9 months ago

    I’m on the boring side…

    PS1="% "
    

    I like it though, it gives me more room for commands !

    • stepanzak@iusearchlinux.fyiOP
      link
      fedilink
      arrow-up
      0
      arrow-down
      1
      ·
      9 months ago

      Most of the pre-built prompts have two lines to give enough space for commands. The first line has all the info, and the second line is something like your prompt. If your prompt works for you, it’s great, though.

        • stepanzak@iusearchlinux.fyiOP
          link
          fedilink
          arrow-up
          3
          arrow-down
          1
          ·
          edit-2
          9 months ago

          That’s fair. Powerlevel10k actually has a very smart feature for this called transient prompt that removes the first line full of info from every executed command. It’s hard to explain. There is a screen recording in the README I have linked.

  • theshatterstone54@feddit.uk
    link
    fedilink
    arrow-up
    6
    arrow-down
    1
    ·
    9 months ago

    Currently, I use starship, but I have considered switching to a regular PS1 or similar setup, it’s just that I can’t get the colours right when using PS1.

  • happyhippo@feddit.it
    link
    fedilink
    arrow-up
    4
    ·
    9 months ago

    I tried oh-my-bash with some fancy theme, but went back to plain old bash from my distro since suggestions for autocomplete had suddenly started to lag. Went back to default and it’s as quick as ever to suggest.

    I’m not willing to trade efficiency for bells and whistles

    • stepanzak@iusearchlinux.fyiOP
      link
      fedilink
      arrow-up
      2
      arrow-down
      1
      ·
      9 months ago

      I don’t know about oh-my-bash themes, but on the zsh side, the powerlevel10k can display a lot of information without any lag due to asynchronous implementation. I’m sure there is something similar for bash too.

  • chayleaf@lemmy.ml
    link
    fedilink
    arrow-up
    4
    arrow-down
    1
    ·
    edit-2
    9 months ago

    I use fish + tide

    I tried zsh+p10k before fish+tide, but zsh felt annoying in subtle ways that weren’t fixable with (existing) plugins, so I switched back to fish, but installed tide to mimic my previous p10k theme.

  • 30p87@feddit.de
    link
    fedilink
    arrow-up
    3
    ·
    edit-2
    9 months ago

    As I use bash basically for everything, I wanted my prompt to be as basic as possible (No newlines, fixed format) and compatible across my PC, Laptop as well as server and Pi via SSH.
    Therefore, it’s a simple __prompt_command function in my .bashrc (nearly) everywhere.
    It’s structured as:

    1. Terminal/TTY number in orange
    2. Username in green (for roots .bashrc it’s red)
    3. Hostname in green
    4. Current working dir in blue
    5. Current git branch in yellow (if in a git repo)
    6. Exit code in red (if not 0)

    Looks like this: 1000011281

    I used some prompt generator to get the variables and colors right, and then wrapped parts in if-then where needed.
    The result is:

    __prompt_command() {
        local EXIT="$?"
        PS1="\[\033[38;5;216m\](\l)\[$(tput sgr0)\] \[$(tput sgr0)\]\[\033[38;5;85m\]\u@\H\[$(tput sgr0)\]:\[$(tput sgr0)\]\[\033[38;5;68m\][\w\[$(tput sgr0)\]"
        local GIT_BRANCH="$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/')"
        if ! [[ -z "$GIT_BRANCH" ]]; then
            PS1+=":\[$(tput sgr0)\]\[\033[38;5;142m\]${GIT_BRANCH}\[$(tput sgr0)\]"
        fi
        PS1+="\[\033[38;5;68m\]]\[$(tput sgr0)\]"
        if [ $EXIT != 0 ]; then
            PS1+=":\[$(tput sgr0)\]\[\033[38;5;1m\]${EXIT}\[$(tput sgr0)\]"
        fi
        PS1+="\\$ \[$(tput sgr0)\]"
    }
    

    In practice I use every aspect of it. The terminal number is useful for sorting, the username is needed especially when handling e.g. git or db servers with specific users, and one has a terminal as the user, one as root and one as normal user. Hostname is obviously important with multiple ssh sessions open all the time (especially without terminal emulator titles). Typing pwd all the time would be very tedious, as I only move around my system in bash, so having it in the prompt is nice. If I am in a git repo I also need to know the branch and otherwise it’s not displayed anyway. Quickly identifying silently failed commands is tedious, especially because issuing one command overwrites $? again, so ‘logging’ it if necessary is nice.

  • mikesailin@lemmy.ml
    link
    fedilink
    arrow-up
    2
    ·
    9 months ago

    Color green for normal users and red for root. then date, hostname. and finally time of day

  • Free Palestine 🇵🇸@sh.itjust.works
    link
    fedilink
    arrow-up
    3
    arrow-down
    1
    ·
    9 months ago

    I’ve been using zsh for some time, but I finally switched to fish. I also checked out Nushell, it lacks some features, but it’s really interesting. On zsh I was using Powerlevel10k, on Fish I used oh-my-fish with the shellder theme before I switched to Starship. I’m very happy with this setup. My prompt looks like this:

    My Terminal Emulator of choice is kitty, the font is Monocraft.

  • Pixel@lemmy.sdf.org
    link
    fedilink
    arrow-up
    2
    ·
    9 months ago

    I used to color my prompt depending on which server I was connected to (ssh), and a different color scheme for prod, dev and local. But that was a long time ago and the script is buried somewhere, also I don’t stay ssh’d to nearly as many places as I did back then. But I did like it, I’d use it now if I had it.