A polybar module for managing and displaying rice configurations directly from your status bar.
- 🍚 Display current rice status in polybar
- ⚡ Quick rice switching with click actions
- 📋 List all available rices
- ➕ Add new rices from the status bar
- 🗑️ Remove rices with confirmation
- ℹ️ Get detailed rice information
- 🎨 Rofi integration for better UX
-
Make the installation script executable and run it:
chmod +x install-polybar-extension.sh ./install-polybar-extension.sh
-
Add the riceify module to your polybar config:
Copy the
[module/riceify]section frompolybar-config-example.inito your polybar config file (usually~/.config/polybar/config.ini). -
Add the module to your bar:
Add
riceifyto themodules-leftormodules-rightline in your bar configuration. -
Restart polybar:
polybar-msg cmd restart
[module/riceify]
type = custom/script
exec = python3 ~/Riceify/polybar-riceify.py --status
click-left = python3 ~/Riceify/polybar-riceify.py --menu
click-right = rofi -show riceify -modi riceify:python3 ~/Riceify/polybar-riceify.py --menu
format-padding = 1
format-foreground = #f0c674
format-background = #282a2e[module/riceify-menu]
type = custom/menu
format-spacing = 1
label-open = 🍚
label-open-foreground = #f0c674
label-close = ✕
label-close-foreground = #cc6666
label-separator = |
label-separator-foreground = #373b41
menu-0-0 = Add Rice
menu-0-0-exec = rofi -dmenu -p "Rice name:" | xargs -I {} python3 ~/Riceify/polybar-riceify.py --add {}
menu-0-1 = Switch Rice
menu-0-1-exec = python3 ~/Riceify/polybar-riceify.py --list | rofi -dmenu -p "Select rice:" | xargs -I {} python3 ~/Riceify/polybar-riceify.py --switch {}
menu-0-2 = Remove Rice
menu-0-2-exec = python3 ~/Riceify/polybar-riceify.py --list | rofi -dmenu -p "Remove rice:" | xargs -I {} python3 ~/Riceify/polybar-riceify.py --remove {}
menu-0-3 = List Rices
menu-0-3-exec = python3 ~/Riceify/polybar-riceify.py --list | rofi -dmenu -p "Rices:"The polybar extension can be used directly from the command line:
# Show current rice status
python3 ~/Riceify/polybar-riceify.py --status
# Display rice menu
python3 ~/Riceify/polybar-riceify.py --menu
# List all rices
python3 ~/Riceify/polybar-riceify.py --list
# Add a new rice
python3 ~/Riceify/polybar-riceify.py --add "my-rice"
# Switch to a rice
python3 ~/Riceify/polybar-riceify.py --switch "my-rice"
# Remove a rice
python3 ~/Riceify/polybar-riceify.py --remove "my-rice"
# Get rice information
python3 ~/Riceify/polybar-riceify.py --info "my-rice"- Left click: Shows rice menu
- Right click: Opens rofi with rice options
- Status display: Shows current rice and total count
You can bind keyboard shortcuts to rice operations using your window manager or desktop environment:
# Example i3wm bindings
bindsym $mod+r exec python3 ~/Riceify/polybar-riceify.py --menu
bindsym $mod+Shift+r exec rofi -dmenu -p "Rice name:" | xargs -I {} python3 ~/Riceify/polybar-riceify.py --add {}For better user experience, you can integrate with rofi:
-
Add rofi modi to your rofi config:
rofi -show riceify -modi riceify:python3 ~/Riceify/polybar-riceify.py --menu -
Create a rofi theme (optional): Copy the rofi theme section from
polybar-config-example.inito your rofi theme file.
-
Script not found: Make sure the path to
polybar-riceify.pyis correct in your polybar config. -
Permission denied: Run the installation script to make the file executable:
chmod +x ~/Riceify/polybar-riceify.py -
Python not found: Ensure Python 3 is installed:
python3 --version
-
Rice directory not found: The script will create the directory structure automatically when you add your first rice.
To debug issues, run the script with verbose output:
python3 ~/Riceify/polybar-riceify.py --statusRiceify/
├── polybar-riceify.py # Main polybar extension script
├── polybar-config-example.ini # Example polybar configuration
├── install-polybar-extension.sh # Installation script
├── POLYBAR_README.md # This file
└── Headers/
└── Rice.h # Original Riceify C++ header
- Python 3.6+
- polybar
- rofi (optional, for better UX)
- rsync (for rice operations)
Feel free to submit issues and enhancement requests!
This extension follows the same license as the main Riceify project.