Polybar Emoji Support - ulises-jeremias/dotfiles GitHub Wiki
π Polybar: Emoji Support
Polybar in this dotfiles setup includes full emoji support using Noto Color Emoji fonts. You can now use colorful emojis alongside traditional Nerd Font icons to create visually appealing status bars.
[!TIP] Emoji support is available across all polybar configurations without modifying existing modules. Simply use the new font tags to display emojis in your custom scripts and modules.
π¨ Available Emoji Fonts
Four emoji font sizes have been added to all polybar configurations:
Font Tag | Size | Usage |
---|---|---|
%{T6} |
Small (size=10) | Inline icons that match text size |
%{T7} |
Medium (pixelsize=15) | Slightly larger emphasis |
%{T8} |
Large (pixelsize=20) | Module headers or important status |
%{T9} |
Extra Large (pixelsize=25) | Dashboard-style displays |
Remember to use %{T-}
to reset back to the default font.
π Quick Start Examples
Simple Emoji Usage
# Display battery with emoji
echo "%{T6}π%{T-} 85%"
# Weather with different sizes
echo "%{T7}π€οΈ%{T-} 22Β°C"
echo "%{T8}βοΈ%{T-} Sunny"
Custom Script Example
#!/usr/bin/env bash
# Weather script with emoji support
case "$(dots-weather-info --condition)" in
"sunny") echo "%{T7}βοΈ%{T-} $(dots-weather-info --temp)" ;;
"cloudy") echo "%{T7}βοΈ%{T-} $(dots-weather-info --temp)" ;;
"rain") echo "%{T7}π§οΈ%{T-} $(dots-weather-info --temp)" ;;
*) echo "%{T7}π€οΈ%{T-} $(dots-weather-info --temp)" ;;
esac
π¦ Module Integration
Direct Module Format
Use emojis directly in polybar module formats:
[module/cpu-emoji]
type = internal/cpu
interval = 2
format = %{T6}π»%{T-} %percentage:2%%
[module/memory-emoji]
type = internal/memory
interval = 2
format = %{T6}π§ %{T-} %percentage_used%%
[module/date-emoji]
type = internal/date
interval = 5
format = %{T6}π
%{T-} %date% %{T6}π%{T-} %time%
Script-Based Modules
Create enhanced scripts for existing modules:
[module/battery-emoji]
type = custom/script
exec = ~/.config/polybar/configs/default/scripts/battery-emoji
interval = 60
[module/volume-emoji]
type = custom/script
exec = ~/.config/polybar/configs/default/scripts/volume-emoji
interval = 1
click-left = pamixer --toggle-mute
π― Popular Emoji Collections
System Monitoring
- π» CPU usage
- π§ Memory/RAM
- πΎ Storage/Disk space
- π₯ Temperature
- β‘ Power/Performance
Connectivity
- πΆ WiFi signal
- π Internet connection
- π‘ Network activity
- π Connection status
Audio & Media
- π High volume
- π Medium volume
- π Low volume
- π Muted
- π΅ Music playing
- βΈοΈ Paused
- βοΈ Next track
Weather
- βοΈ Sunny
- β Partly cloudy
- βοΈ Cloudy
- π§οΈ Rain
- βοΈ Snow
- βοΈ Thunderstorm
Power & Battery
- π Battery levels
- πͺ« Low battery
- π Charging
- π‘ Brightness
π§ Advanced Usage
Color Coordination
Combine emojis with polybar color formatting:
echo "%{F#ff6b6b}%{T7}π₯%{T-}%{F-} High CPU Usage"
echo "%{F#4ecdc4}%{T6}πΎ%{T-}%{F-} Storage OK"
echo "%{F#ffcc02}%{T6}β οΈ%{T-}%{F-} Warning"
Dynamic Emoji Selection
Create smart scripts that choose emojis based on values:
#!/usr/bin/env bash
# Smart battery emoji script
battery_level=$(cat /sys/class/power_supply/BAT0/capacity)
status=$(cat /sys/class/power_supply/BAT0/status)
if [ "$status" = "Charging" ]; then
emoji="π"
elif [ "$battery_level" -gt 75 ]; then
emoji="π"
elif [ "$battery_level" -gt 25 ]; then
emoji="π"
else
emoji="πͺ«"
fi
echo "%{T6}$emoji%{T-} $battery_level%"
π Updated Configuration Files
Emoji support has been added to these polybar configurations:
~/.config/polybar/bars/common-top.conf
~/.config/polybar/bars/common-bottom.conf
~/.config/polybar/bars/i3-top.conf
~/.config/polybar/bars/i3-bottom.conf
~/.config/polybar/bars/i3-top-multipart.conf
π§ͺ Testing Emoji Support
Test if emojis are working correctly:
-
Restart Polybar:
~/.config/polybar/launch.sh
-
Create a Test Module:
[module/emoji-test] type = custom/script exec = echo "%{T6}π%{T-} %{T7}πΆ%{T-} %{T8}π€οΈ%{T-} %{T9}π»%{T-}" interval = 60
-
Add to Bar Configuration:
modules-right = emoji-test
β Compatibility
- β Rice Support: Works with all existing rice configurations
- β Font Compatibility: Compatible with current Nerd Font icons
- β Module Safety: No changes needed to existing modules
- β Backward Compatible: Existing setup continues to work
- β Window Manager: Works with both Openbox and i3
π‘ Best Practices
Accessibility
- Always include descriptive text alongside emojis
- Use consistent emoji meanings across modules
- Consider colorblind-friendly alternatives
Performance
- Avoid excessive emoji usage in high-frequency modules
- Use appropriate font sizes for your display resolution
- Test emoji rendering on different screen sizes
Design
- Maintain visual consistency across your polybar setup
- Use emojis to enhance, not replace, informative text
- Consider your overall theme when choosing emojis
Ready to add some personality to your status bar with emojis! π
[!TIP] Start with simple emojis in low-frequency modules like weather or battery, then expand to other areas as you get comfortable with the syntax.