I have this script at ~/.config/sway/status.sh:
# The Sway configuration file in ~/.config/sway/config calls this script.
# You should see changes to the status bar after saving this script.
# If not, do "killall swaybar" and $mod+Shift+c to reload the configuration.
# Produces "21 days", for example
uptime_formatted=$(uptime | cut -d ',' -f1 | cut -d ' ' -f4,5)
# The abbreviated weekday (e.g., "Sat"), followed by the ISO-formatted date
# like 2018-10-06 and the time (e.g., 14:01)
date_formatted=$(date "+%a %F %H:%M")
# Get the Linux version but remove the "-1-ARCH" part
linux_version=$(uname -r | cut -d '-' -f1)
# Returns the battery status: "Full", "Discharging", or "Charging".
battery_status=$(cat /sys/class/power_supply/BAT0/status)
# Emojis and characters for the status bar
# ⚡ \|
echo $uptime_formatted ↑ $linux_version $battery_status $date_formatted
The part in ~/.config/sway/config that defines the status bar is this:
bar {
position top
# Keep in mind that the current directory of this config file is $HOME
status_command while ~/.config/sway/status.sh; do sleep 1; done
colors {
# Text color of status bar
statusline #ffffff
# Background of status bar
background #323232
}
font pango:DejaVu Sans Mono 10
}
That's how the bar looks using this configuration:

The above settings works also in i3 with an identical result.
You need to have an appropriate font installed to render the emoji characters, for example:
pacman -S noto-fonts-emoji
or
apt install fonts-noto-color-emoji