It helps if you have Font Awesome set up on your system.
This needs cleaning up. As pasted from my prompt.sh
# prompt.sh# the unified prompt for Dave Jacoby, based on system settings# and capabilities.# if a capability is absent for an entry, such as TaskWarrior# or ACPI, the prompt will drop that in favor of entries it# can handle.# Tasks# * I have partially added Font Awesome to the prompt,# especially for the buttons. I need to more fully # integrate FA fonts. For example, with TaskWarrior # icons# TASK WARRIOR INTO MY PROMPT# this part is just fun-with-utf8# https://twitter.com/pjf/status/852466839145795584URGENT="2757"DUETOMORROW="2690"DUETODAY="2691"OVERDUE="2639"OK="2714"# shows if any TaskWarrior tasks are in need of attentionfunction task_indicator {if[`task +READY +OVERDUE count`-gt"0"];then
printf"%b""\u$OVERDUE"elif[`task +READY +DUETODAY count`-gt"0"];then
printf"%b""\u$DUETODAY"elif[`task +READY +DUETomorrow count`-gt"0"];then
printf"%b""\u$DUETOMORROW"elif[`task +READY urgency \> 10 count`-gt"0"];then
printf"%b""\u$URGENT"else
printf"%b""\u$OK"fi}# here I switch to Font-Awesome, which might not show for dev.toHOT_BEVERAGE="2615"POWER="26A1"#BATTERY="8984"#POWER="2605"BATTERY="2606"NOT=""fa_bolt=""fa_plug=""# fa-plug [�_battery=""# fa-battery (alias) [] 4.4fa_battery_0=""# fa_battery_0 (alias) [] 4.4fa_battery_1=""# fa_battery_1 (alias) [] 4.4fa_battery_2=""# fa_battery_2 (alias) [] 4.4fa_battery_3=""# fa_battery_3 (alias) [] 4.4fa_battery_4=""# fa_battery_4 (alias) [] 4.4fa_battery_empty=""# fa_battery_empty [] 4.4fa_battery_full=""# fa_battery_full [] 4.4fa_battery_half=""# fa_battery_half [] 4.4fa_battery_quarter=""# fa_battery_quarter [] 4.4fa_battery_three=""# fa_battery_three-quarters [] 4.3 fa-bed [&# PLUGGED IN OR NO# works on my Linux laptop, not on my desktop# shows if the battery is currently chargingfunction battery_charging {CHARGING=`/usr/bin/acpi | awk'{ print $3}'`if[$CHARGING='Discharging,'];then
printf'%s'$fa_plugelse
printf'%s'$fa_boltfi}# shows current status of battery# 0 - 12 EMPTY# 13 - 37 QUARTER# 38 - 62 HALF# 63 - 87 THREE-QUARTER# 88 - 100 FULLfunction battery_life {ACPI=`/usr/bin/acpi | awk'{ print $4}'`ACPI=${ACPI//[!0-9]/}if[$ACPI=="100"];then
printf'%s '$fa_battery_4elif[$ACPI-lt"13"];then
printf'%s '$fa_battery_0elif[$ACPI-lt"38"];then
printf'%s '$fa_battery_1elif[$ACPI-lt"63"];then
printf'%s '$fa_battery_2elif[$ACPI-lt"88"];then
printf'%s '$fa_battery_3else
printf'%s '$fa_battery_4fi}# opening tag for setting color. depends on a lot of# variations, including hostfunction opentag {if[-f"/bin/hostname"];then
HOST=`/bin/hostname`else
HOST='NONE'fi
if[[$HOST==*"purdue.edu"]];then
HOST=`/bin/hostname -s`fi
foreground='38;5;255'background=''bold='1;'#1dim=''#2italic=''#3reverse=''#7# WORK LINUX COMPUTERif[$HOST='oz'];then
foreground='38;5;82'bold='1;'if[[-z$DESKTOP_SESSION]];then
reverse='7;'fi# WORK WINDOWS 10 COMPUTER elif[$HOST='Lion'];then
foreground='38;5;206'foreground='38;5;79'bold='1;'# if [ -z $SYSTEMDRIVE ] ; then# foreground='38;5;196'# bold='1;'# fi# PERSONAL LINUX COMPUTERelif[$HOST='gort'];then
foreground='38;5;39'bold='1;'# PERSONAL WIN10 COMPUTER# works in WSL, not in Git4Windows Bashelif[$HOST='K9'];then
foreground='38;5;39'bold='1;'# REMOVING SOME WORK HOSTSfi
printf"\e[%s%s%s%s%sm"$bold$dim$italic$reverse$background$foreground# unset HOST foreground background bold dim italic reverse }# closes all open tag typesfunction closetag {printf"\e[0m"}# if wanted, just bold and whitefunction boldwhite {printf"\e\[1;38;5;255m"}# sets the PS1 variable# function set_ps1 {header="\[\033]0;\u@\h: \w\007\]"# chroot="${debian_chroot:+($debian_chroot)}"chroot=""userhost="\u@\h "localtime="\A "path="\w "end="\n\$ "# the coffee, weather and reboot info are called in other programs# every time the prompt is runtask="\$(task_indicator)"battery_charging="\$(battery_charging)"battery_life="\$(battery_life)"timer_show="($timer_show)"reboot="\$(~/bin/need_reboot.pl)"temp="\$(~/bin/get_temp.pl)"coffee="\$(~/bin/get_coffee.pl) "dbus="\$(~/local/bin/pull_dbus_address.sh)"git="\$(__git_ps1)"open="$(opentag)"close="$(closetag)"prompt=$header# I add getting and storing the DBUS address so I can # control Spotify from the command line and take webcam# pictures via Crontabif[-f ~/local/bin/pull_dbus_address.sh ];then
prompt="$prompt$dbus"fi
prompt="$prompt\n\[$open\]"if[-f ~/bin/need_reboot.pl ];then
prompt="$prompt$reboot "fi
if[-f /usr/bin/acpi ];then
prompt="$prompt$battery_charging "prompt="$prompt$battery_life "fi
if[-f /usr/bin/task ];then
prompt="$prompt$task "fi
prompt=$prompt$userhostprompt=$prompt$localtimeif[-f ~/bin/get_temp.pl ];then
prompt="$prompt$temp "fi
if[-f ~/bin/get_coffee.pl ];then
prompt="$prompt$coffee "fi
prompt=$prompt$pathprompt=$prompt$chrootprompt=$prompt$gitif[-f ~/.timing ];then
prompt="$prompt$timer_show "fi
prompt=$prompt$endprompt="$prompt\[$close\]"trap'timer_start' DEBUG
PROMPT_COMMAND="timer_stop"export PS1=$prompt# unset chroot close coffee dbus end git header open path prompt reboot task temp localtime userhost# }# set_ps1
It helps if you have Font Awesome set up on your system.
This needs cleaning up. As pasted from my prompt.sh
and this in my .bashrc:
Thanks