This repository contains a collection of custom scripts and configurations for i3blocks, designed to generate a dynamic and informative status line for the i3 window manager.
This i3blocks
setup provides the following status line blocks:
- Volume: Displays current audio volume and mute status with appropriate icons and color coding.
- Battery: Shows battery level, charging status, and uses color to indicate charge level (red for low, yellow for medium, green for high).
- Time: Displays the current date and time.
- WLAN: Indicates active Wi-Fi connection and displays the SSID.
- Ethernet: Shows if an Ethernet connection is active.
- Updates: (Arch Linux specific) Displays the number of pending system updates.
- Active Window: Shows the title of the currently active window, truncated if too long.
- Caps Lock: Indicates if Caps Lock is active.
- Display Brightness: Shows the current screen brightness percentage.
Ensure you have the following tools and fonts installed on your system for all blocks to function correctly:
i3blocks
: The main status line program.xdotool
: Foractive_window.sh
.amixer
: Forvolume.sh
(part ofalsa-utils
on many systems).xbacklight
: Fordisplay_brightness.sh
.checkupdates
: Forcheckforupdates.sh
(Arch Linux specific, part ofpacman-contrib
).iwgetid
: Forwlan_connection.sh
(part ofwireless_tools
).iwctl
: Foriwd_wlan_connection.sh
(if usingiwd
for Wi-Fi).Font Awesome 5 Free
: Used for various icons.statusline-icons.ttf
: Custom font for additional icons.
- Clone the repository:
git clone https://github.com/yourusername/i3blocks.git cd i3blocks
- Copy configuration:
Copy the
i3blocks.config
file to your i3 configuration directory. A common location is~/.config/i3/
or~/.config/i3blocks/
.mkdir -p ~/.config/i3blocks/ cp i3blocks.config ~/.config/i3blocks/
- Copy scripts:
Copy the
scripts/
directory to~/.config/i3blocks/
.cp -r scripts ~/.config/i3blocks/
- Make scripts executable:
Ensure all scripts in
~/.config/i3blocks/scripts/
are executable.chmod +x ~/.config/i3blocks/scripts/*.sh
- Install custom font:
Install
statusline-icons.ttf
to your system's font directory (e.g.,~/.local/share/fonts/
or/usr/local/share/fonts/
) and update your font cache.mkdir -p ~/.local/share/fonts/ cp statusline-icons.ttf ~/.local/share/fonts/ fc-cache -fv
The main configuration file for i3blocks
. It defines the order, interval, and commands for each block.
- Global Properties: The
[general]
section sets defaultinterval
,color
, andseparator_block_width
for all blocks. - Block-specific Properties: Each
[block_name]
section overrides global properties and defines thecommand
to execute. - Pango Markup: Most blocks use
markup=pango
to enable rich text formatting, including custom fonts and colors.
Note: The battery2.sh
and iwd_wlan_connection.sh
scripts are present but not currently used in the provided i3blocks.config
. You can integrate them if needed.
The scripts/
directory contains the bash scripts executed by i3blocks
.
helpers.sh
: Contains reusable functions, such asget_color_for_percentage
, to maintain consistency across scripts.- Individual scripts (e.g.,
volume.sh
,battery.sh
): Fetch system information and format it fori3blocks
output, often using Pango markup for icons and colors.
The generate_color_gradient.py
Python script can be used to generate a gradient of hex colors. This can be useful for creating custom color schemes for your status line.
python3 generate_color_gradient.py <start_hex_color> <end_hex_color> <steps>
Example:
python3 generate_color_gradient.py "#FF0000" "#0000FF" 10
This setup utilizes:
- Font Awesome 5 Free: For a wide range of common icons.
statusline-icons.ttf
: A custom font providing additional specific icons.
Ensure both are correctly installed and accessible by your system.
The statusline-icons.ttf
font was generated using IcoMoon (as indicated by selection.json
in the icons/
directory). The statusline-icons.README
file in the root directory incorrectly states Fontello.com as the generator.
This font includes icons from the following open-source iconic fonts (as listed in the original statusline-icons.README
):
-
Font Awesome (http://fontawesome.io)
- License: SIL OFL 1.1 (http://scripts.sil.org/OFL)
- Copyright: Font Awesome is a trademark of Fonticons, Inc.
-
Entypo (http://www.entypo.com)
- License: CC BY-SA 4.0 (http://creativecommons.org/licenses/by-sa/4.0/)
- Copyright: Daniel Bruce
-
Typicons (http://typicons.com)
- License: CC BY-SA 3.0 (http://creativecommons.org/licenses/by-sa/3.0/)
- Copyright: Stephen Hutchings
-
Modern Pictograms (http://modernpictograms.com)
- License: SIL OFL 1.1 (http://scripts.sil.org/OFL)
- Copyright: John Caserta
-
Meteocons (http://www.alessioatzeni.com/meteocons/)
- License: CC BY-SA 3.0 (http://creativecommons.org/licenses/by-sa/3.0/)
- Copyright: Alessio Atzeni
-
Linecons (http://designmodo.com/linecons-free/)
- License: CC BY 3.0 (http://creativecommons.org/licenses/by/3.0/)
- Copyright: Designmodo
-
MFG Labs Iconset (http://mfglabs.github.io/mfglabs-iconset/)
- License: SIL OFL 1.1 (http://scripts.sil.org/OFL)
- Copyright: MFG Labs
-
Zocial (http://zocial.smcllns.com/)
- License: MIT (http://opensource.org/licenses/MIT)
- Copyright: Sam Collins
-
Brandico (https://github.com/andreysitnik/Brandico)
- License: MIT (http://opensource.org/licenses/MIT)
- Copyright: Andrey Sitnik
-
Elusive Icons (http://elusiveicons.com/)
- License: MIT (http://opensource.org/licenses/MIT)
- Copyright: Aristeides Stathopoulos
-
Web Symbols (http://www.websymbols.net/)
- License: CC BY-SA 3.0 (http://creativecommons.org/licenses/by-sa/3.0/)
- Copyright: Just Be Nice Studio
-
Iconic (http://somerandomdude.com/work/iconic/)
- License: CC BY-SA 3.0 (http://creativecommons.org/licenses/by-sa/3.0/)
- Copyright: P.J. Onori
-
Maki (https://www.mapbox.com/maki/)
- License: BSD (https://github.com/mapbox/maki/blob/master/LICENSE.txt)
- Copyright: Mapbox
-
Open Iconic (https://useiconic.com/open/)
- License: MIT (https://github.com/iconic/open-iconic/blob/master/LICENSE)
- Copyright: Waybury
-
Rpg Awesome (https://nagoshiashumari.github.io/Rpg-Awesome/)
- License: MIT (https://github.com/nagoshiashumari/Rpg-Awesome/blob/master/LICENSE.txt)
- Copyright: Nagoshiashumari
-
Material Design Icons (https://materialdesignicons.com/)
- License: Apache 2.0 (https://github.com/Templarian/MaterialDesign/blob/master/LICENSE)
- Copyright: Google
-
Community Material Design Icons (https://materialdesignicons.com/)
- License: Apache 2.0 (https://github.com/Templarian/MaterialDesign/blob/master/LICENSE)
- Copyright: Community
Additionally, some icons may originate from Flaticon, specifically from:
- Freepik (https://www.flaticon.com/de/autoren/freepik)
- Those Icons (https://www.flaticon.com/authors/those-icons)
(As noted in
icons/Read Me.txt
)
To integrate i3blocks
with your i3 window manager, add the following line to your ~/.config/i3/config
file:
bar {
status_command i3blocks -c ~/.config/i3blocks/i3blocks.config
# Other bar configurations...
}
After modifying your i3 config, reload i3 (usually Mod+Shift+R
).
Feel free to fork this repository, make improvements, and submit pull requests.
This project is licensed under the MIT License - see the LICENSE
file for details.