Git Product home page Git Product logo

welcome.sh's Introduction

welcome.sh

image

A nice welcome script for Bash and Zsh

This is a nice little script for your .bashrc or .zshrc that greets you on every launch, with some helpful (and customizable!) information.

My goal with this script is to keep it simple, just a single line that gives useful information when you start a terminal session.

Features:

  • Relatively fast
  • Works across many distros (update checking support)
  • Clean and simple
  • Customizable
  • Easy to install and update

Requirements:


Installing:

Automatic Installation via Curl

Bash:

bash -c "$(curl -s https://raw.githubusercontent.com/G2-Games/welcome.sh/main/install.sh)"

Zsh:

zsh -c "$(curl -s https://raw.githubusercontent.com/G2-Games/welcome.sh/main/install.sh)"

It installs to ~/.welcome/welcome.sh, and adds a line to the bottom of ~/.bashrc or ~/.zshrc

Manual Installation

To install it manually, download the latest welcome.sh from releases and place it in your home directory. Then add bash ~/welcome.sh to your .bashrc. It works without the config file, but you can also add that to your home directory for easier manual updates.

Updating:

Run the script again to check for an update. If you have an older version it will prompt you. You can update from any version to any newer version. The proper files will be downloaded as necessary.


Configs:

To configure settings, open ~/.welcome/config.cfg in your text editor of choice. There, you'll find a few settings:

#==================SETUP=================#
# Select which parts you want active by  #
# commenting them out. For example, on a #
# desktop, disabling the battery message #
# is a good idea. You can also re-order  #
# them to change how they display!       #
#========================================#

greetings=("Welcome" "Greetings" "Hello" "Hi") # Add your own greetings!
randgreeting="off"  #< Turn the random greetings on (eg. "Hello <user>, Hi <user>")
twelvehour="on"     #< Switch between 12 and 24 hour time (eg. 8:00 PM vs 20:00)
rechargenotif="off" #< Notify that you should recharge if below 15%
updatecheck="on"    #< Check for all updates, slows startup a bit
flatpakupd="off"    #< Check for flatpak updates, this slows startup down A LOT
goodgreeting="on"   #< Display greetings like "Good afternoon," else "It's afternoon"
displaydate="off"   #< Unused so far

#=========COLORS=======#
NCOL='\e[0m'
BOLD='\e[1m'
ITAL='\e[3m'
UNDR='\e[4m'
BLNK='\e[5m'

# Battery level colors
CRIT='\e[31m'
LOW='\e[33m'
NORM='\e[32m'
FULL='\e[3;4;92m'

TIME='\e[38;2;224;146;252;1m' # Clock color
DATE='\e[38;2;50;168;82;1m'   # Future "Date" item color
USRC=$(randcolor)             # Username color

# Greeting colors
NIGH='\e[38;2;200;107;209m'
MORN='\e[38;2;255;164;74m'
AFTN='\e[38;2;250;245;110m'
EVEN='\e[38;2;171;54;3m'

cfgversion=2

TODO:

  • Fix issues across other distros
  • Add new features? (Please suggest!)
  • Improve MacOS functionality

welcome.sh's People

Contributors

clonkdroid avatar g2-games avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

welcome.sh's Issues

clock:17: ampm: parameter not set

Just getting this error since 1.1.0 update. with twelvehour="off"

image

Also when using the random greetings:

greetings=("Welcome" "Greetings" "Hello" "Hi")
randgreeting="on"

I get the error:

welcome:14: greetings[$greetingsNumber]: parameter not set

Shell: Zsh Kernel: 6.1.0-5-amd64 arch: x86_64 Distro: Debian GNU/Linux 12 (bookworm)

Script does not have rust support

I think this script would be greatly improved by adding support for checking updates via cargo.
Thanks for the feature in advance!

Invalid Number Error (printf)

Every run of the Script, printf complains about an invalid number:

./welcome.sh: Zeile 164: printf: 37.378: Ungültige Zahl.
Translation:
./welcome.sh: Line 164: printf: 37.378: Invalid Number.

The number is random every run, considering the error is spawned in the random number generator.

FIX:
adding export LC_NUMERIC="en_US.UTF-8" to my .bashrc fixed it.
Maybe that should be added to the description

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.