Skip to content

Instantly share code, notes, and snippets.

@lukeramsden
Last active December 3, 2018 16:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lukeramsden/9d552e38c00edef05b458ea3035ef800 to your computer and use it in GitHub Desktop.
Save lukeramsden/9d552e38c00edef05b458ea3035ef800 to your computer and use it in GitHub Desktop.
screenFetch custom lines
use_customlines=1
customlines () {
# The following line can serve as an example.
# feel free to let the computer generate the output: e. g. using $(cat /etc/motd) or $(upower -d | grep THISORTHAT)
# In the example cutom0 line replace <YOUR LABEL> and <your text> with options specified by you.
# Also make sure the $custom0 variable in out_array=... matches the one at the beginning of the line
#
# custom0=$(echo -e "$labelcolor :$textcolor your text"); out_array=( "${out_array[@]}" "$custom0" ); ((display_index++));
# Battery percentage and time to full/empty:
# (uncomment lines below to use)
#
#custom1=$(echo -e "$labelcolor Battery:$textcolor $(upower -d | grep percentage | head -n1 | cut -d ' ' -f 15-)"); out_array=( "${out_array[@]}" "$custom1" ); ((display_index++));
#if [ "$(upower -d | grep time)" ]; then
# battery_time="$(upower -d | grep time | head -n1 | cut -d ' ' -f 14-) $(upower -d | grep time | head -n1 | cut -d ' ' -f 6-7 | cut -d ':' -f1)"
#else
# battery_time="power supply plugged in"
#fi
#custom2=$(echo -e "$labelcolor $(echo ' `->')$textcolor $battery_time"); out_array=( "${out_array[@]}" "$custom2" ); ((display_index++));
# Display public IP:
custom0=$(echo -e "$labelcolor Public IP:$textcolor $(curl -s ipinfo.io/ip)"); out_array=( "${out_array[@]}" "$custom0" ); ((display_index++));
###########################################
## MY CUSTOM LINES
###########################################
#custom4=...
custom1=$(echo -e "\e[1;32m Time:"); out_array=( "${out_array[@]}" "$custom1" ); ((display_index++));
custom2=$(echo -e "\e[0;32m London: $textcolor $(tzconv london)"); out_array=( "${out_array[@]}" "$custom2" ); ((display_index++));
custom3=$(echo -e "\e[0;32m Paris: $textcolor $(tzconv paris)"); out_array=( "${out_array[@]}" "$custom3" ); ((display_index++));
custom4=$(echo -e "\e[0;32m China: $textcolor $(tzconv shanghai)"); out_array=( "${out_array[@]}" "$custom4" ); ((display_index++));
custom5=$(echo -e "\e[0;32m New York: $textcolor $(tzconv newyork)"); out_array=( "${out_array[@]}" "$custom5" ); ((display_index++));
custom6=$(echo -e "\e[0;32m Los Angeles:$textcolor $(tzconv losangeles)"); out_array=( "${out_array[@]}" "$custom6" ); ((display_index++));
custom7=$(echo -e "\e[0;32m Moscow: $textcolor $(tzconv losangeles)"); out_array=( "${out_array[@]}" "$custom7" ); ((display_index++));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment