Polybar Modules filesystem - ulises-jeremias/dotfiles GitHub Wiki
Monitor disk usage and storage capacity across your mounted filesystems directly in polybar.
Tip
The filesystem module provides real-time disk usage information with customizable mount points and visual indicators for storage health.
The filesystem module displays:
- Disk usage percentage for mounted filesystems
- Available space and total capacity
- Mount point information for multiple drives
- Visual indicators with color-coded warnings
[module/filesystem]
type = internal/fs
interval = 25
mount-0 = /
label-mounted = %{T5}%{T-} %mountpoint% %percentage_used%% of %total%
label-mounted-foreground = ${xrdb:color7}
label-unmounted = %mountpoint% not mounted
label-unmounted-foreground = ${colors.foreground}
Property | Value | Description |
---|---|---|
type |
internal/fs |
Built-in filesystem monitoring |
interval |
25 |
Update interval in seconds |
mount-0 |
/ |
Primary mount point to monitor |
mount-1 |
/home |
Additional mount point (optional) |
fixed-values |
true |
Use fixed-width values |
💾 / 45% of 500GB
💾 / 45% 💾 /home 78%
# Minimal format
label-mounted = %{T5}💾%{T-} %percentage_used%%
# Detailed format with colors
label-mounted = %{F#4fc3f7}%{T5}💾%{T-}%{F-} %mountpoint% %percentage_used%% (%available%)
# Progress bar format
label-mounted = %{T5}💾%{T-} %mountpoint% <bar-used> %percentage_used%%
[module/filesystem-root]
type = internal/fs
interval = 25
mount-0 = /
[module/filesystem-multi]
type = internal/fs
interval = 25
; Monitor root, home, and external drives
mount-0 = /
mount-1 = /home
mount-2 = /media/external
; Show only mounted filesystems
display-mounted = true
[module/filesystem-network]
type = internal/fs
interval = 60
; Monitor network shares (longer interval)
mount-0 = /mnt/nas
mount-1 = /mnt/backup
Token | Description | Example |
---|---|---|
%mountpoint% |
Mount point path |
/ , /home
|
%percentage_used% |
Used space percentage | 45 |
%percentage_free% |
Free space percentage | 55 |
%total% |
Total filesystem size | 500GB |
%used% |
Used space amount | 225GB |
%free% |
Available space amount | 275GB |
%percentage_shared% |
Shared space percentage | 2 |
[module/filesystem-bar]
type = internal/fs
interval = 25
mount-0 = /
; Enable progress bar
format-mounted = <label-mounted> <bar-used>
label-mounted = %{T5}💾%{T-} %mountpoint%
; Bar configuration
bar-used-width = 10
bar-used-indicator =
bar-used-fill = ─
bar-used-empty = ─
bar-used-foreground-0 = #55aa55
bar-used-foreground-1 = #557755
bar-used-foreground-2 = #f5a70a
bar-used-foreground-3 = #ff5555
[module/filesystem-warnings]
type = internal/fs
interval = 25
mount-0 = /
; Warning thresholds
warn-percentage = 95
critical-percentage = 98
; Format with warnings
format-mounted = <label-mounted>
format-warn = <label-warn>
format-critical = <label-critical>
label-mounted = %{F#55aa55}%{T5}💾%{T-}%{F-} %percentage_used%%
label-warn = %{F#f5a70a}%{T5}⚠️%{T-}%{F-} %percentage_used%%
label-critical = %{F#ff5555}%{T5}🚨%{T-}%{F-} %percentage_used%%
[module/filesystem-smart]
type = custom/script
exec = ~/.config/polybar/configs/default/scripts/filesystem-check
interval = 30
; Custom script with emoji warnings
Example script (~/.config/polybar/configs/default/scripts/filesystem-check
):
#!/usr/bin/env bash
usage=$(df / | tail -1 | awk '{print $5}' | sed 's/%//')
if [ "$usage" -gt 95 ]; then
echo "%{F#ff5555}%{T5}🚨%{T-}%{F-} Critical: ${usage}%"
elif [ "$usage" -gt 80 ]; then
echo "%{F#f5a70a}%{T5}⚠️%{T-}%{F-} Warning: ${usage}%"
else
echo "%{F#55aa55}%{T5}💾%{T-}%{F-} Storage: ${usage}%"
fi
[module/filesystem-clickable]
type = internal/fs
interval = 25
mount-0 = /
format-mounted = <label-mounted>
label-mounted = %{A1:thunar /:}%{T5}💾%{T-} %percentage_used%%%{A}
; Click to open file manager
click-left = thunar /
click-right = baobab / # Disk usage analyzer
[module/filesystem-adaptive]
type = internal/fs
interval = 25
mount-0 = /
; Different formats based on usage
format-mounted = <label-mounted>
format-mounted-underline = ${colors.blue}
; High usage format
format-warn = <label-warn>
format-warn-underline = ${colors.orange}
; Critical usage format
format-critical = <label-critical>
format-critical-underline = ${colors.red}
modules-right = cpu memory filesystem
[module/storage-panel]
type = internal/fs
interval = 25
mount-0 = /
mount-1 = /home
mount-2 = /var
format-mounted = <label-mounted>
label-mounted = %{T5}💾%{T-} %mountpoint%: %used%/%total% (%percentage_used%%)
spacing = 2
[module/filesystem-homelab]
type = internal/fs
interval = 60
; Monitor multiple drives
mount-0 = /
mount-1 = /home
mount-2 = /media/data
mount-3 = /media/backup
label-mounted = %{T6}💾%{T-} %mountpoint% %percentage_used%%
separator = " | "
Mount points not showing:
- Verify mount point exists:
mount | grep /path
- Check filesystem permissions
- Ensure mount point is accessible
Incorrect usage values:
- Check filesystem type support
- Verify permissions for filesystem access
- Update interval may be too fast for network mounts
Performance issues:
; Increase interval for network mounts
interval = 120
; Reduce mount points being monitored
mount-0 = / ; Only monitor essential mounts
# Test filesystem access
df -h /
ls -la /mount/point
# Check polybar filesystem module
polybar-msg action filesystem hook 0
[module/filesystem-emoji]
type = internal/fs
interval = 25
mount-0 = /
label-mounted = %{T6}💽%{T-} Root: %percentage_used%% %{T6}📊%{T-} Free: %percentage_free%%
[module/filesystem-minimal]
type = internal/fs
interval = 25
mount-0 = /
label-mounted = %percentage_used%%
format-mounted-prefix = "💾 "
format-mounted-prefix-foreground = ${colors.blue}
[module/filesystem-detailed]
type = internal/fs
interval = 25
mount-0 = /
label-mounted = %{T5}💾%{T-} %mountpoint% • Used: %used% • Free: %free% • Total: %total%
- ✅ All bar configurations (top, bottom, i3)
- ✅ Multiple mount points simultaneously
- ✅ Network filesystems (with appropriate intervals)
- ✅ Any file manager for click actions
- System resource modules (CPU, memory)
- System tray for disk utility access
- Temperature monitoring for drive health
Keep track of your storage health at a glance! 💽
Tip
Position the filesystem module in your bottom bar alongside other system monitoring modules for a comprehensive system status overview.