GithubHelp home page GithubHelp logo

jimknopfiot / bash-customization Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 1.0 85 KB

bash customization. Add battery status and color codes to your command prompt.

License: MIT License

Shell 100.00%
linux bash shell command command-prompt prompt bashrc terminal ssh battery status battery-status color colorcode sailfish sailfishos

bash-customization's Introduction

bash customization

I got some linux devices like Notebooks, RPi's and SailfishOS Smartphones. It's anoying working remotly via ssh on this devices when powered by battery, not knowing the battery status. So i added this cool function to the bash command prompt. Additionally i added different colors for the prompt for each device and user.

Add this at the beginning of your .bashrc file or /etc/bashrc for global use. I found the battery code on a pine64 forum but it had some issues. I fixed it for my best use case.

Btw. since Sailfish OS 4.x update replaces /bin/bash with a symlink to /usr/bin/busybox, you have to install gnu-bash to use .bashrc.

On SailfishOS, fingerterm is the default terminal app. There is an odd Problem with the first character of a string value in PS1 prompt. Maybe it is related to libreadline and the octal escape sequence \001 and \002. It leads to a wrong color for the first character of a string value when using any character before the string value" Using havoc as a terminal app will work without problems. However, if you use fingerterm, you can move the $BATSTT value before the percentage value. This problem will ocur on SailfishOS/fingerterm only localy on the device.

bash-customization's People

Contributors

jimknopfiot avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

qu1que

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.