FAQ - liquidprompt/liquidprompt GitHub Wiki

FAQ

How To…

How to change the configuration depending on the directory?

It is possible to change Liquid Prompt's theme or, more generally, configuration, with the help of the (excellent) direnv.

For instance, you may want to change the theme when entering a specific project directory.

Just put any configuration variable you need to change in the .envrc file, and direnv's subshell will update the prompt for you.

For changing the theme, you just have to configure something like:

export LP_THEME='my_theme'

How to use Liquid Prompt as a status bar?

A prompt being essentially an ANSI-colored text, you can use it within anything that displays a text generated by an external command. Most status bar managers allows that, you just have to figure out how to get the Liquid Prompt's text.

The file contrib/status-bar/lp-status.sh is an example of how to get some prompt text. It basically output the text of a Liquid Prompt with a specific configuration (defined in the lp-status.conf file, it essentialy removes the path and displays the complete time and date) and the given theme.

If you do not have a status bar manager, you can just as well use a fixed X-window, as shown in the contrib/status-bar/i3-dock.sh file).

Troubleshooting

Prompt timing isn't working

Check in your .bashrc that the $PROMPT_COMMAND variable is not set, or else prompt will not be available, or at least last command timing will fail. If you must set it or use a add-on that sets it, make sure to set $PROMPT_COMMAND before you source Liquidprompt to avoid history and timing issues. Do not export $PROMPT_COMMAND.

Sensors throw an error each prompt

You see an error something like this:

ERROR: Can't get value of subfeature temp1_input: Can't read

If you run sensors -u, you would see the same error in the middle of the output somewhere.

We are often asked why we don't completely silence this error (see issue #445 and linked issues). We can't suppress errors that users need to know about, and while this one can be safely ignored sometimes, for some errors that is not the case.

If you can't remove or fix the offending physical device, there are two options to fix. The easy fix is to install and use acpi instead.

The other option is to teach lm-sensors to ignore the specific broken sensor. From this comment:

For iwlwifi-virtual-0 virtual device do the following:

Write a file /etc/sensors.d/iwlwifi with the following contents

chip "iwlwifi-virtual-*"
    ignore temp1

Change iwlwifi-virtual- into anything else that throws errors when running sensors -u.

See man 5 sensors.conf for more information on configuring lm-sensors.

I updated/installed something, but it does not show in the prompt

Liquid Prompt will look for the available tools at startup, and disable their corresponding feature if they are not installed. If you installed a dependency (e.g. Git) during a session, Liquid Prompt will not immediately show its information (e.g. branch name and so on). You will have to restart Liquid Prompt so that it sees that the tool is now installed. Either by restarting your terminal, or sourcing the liquidprompt file.