about summary refs log tree commit diff

dwm-status-sh

A configurable shell script, that will display the status bar for the suckless DWM window manager.

Status bar items are refreshed periodically in general, but some less prioritized information is queried less often.

Features

Status bar items include the following modules:

  • New/Unread emails indicator (with amount)
  • Current weather temperature
  • Ethernet and WLAN connection status (whether the interface is active)
  • CPU temperature
  • CPU usage (in percent)
  • RAM usage (formatted with IEC (binary) prefixes)
  • Available disk space for /home
  • Audio output muted/unmuted indicator and master volume
  • Battery charging status and percentage (if battery recognized)
  • System uptime since last reboot
  • Date and time

The current weather temperature module is disabled by default, unless an API key for the web service openweathermap.org is specified in the configuration section of the shell script.

Also, other status bar modules, that could not retrieve the corresponding information, won't get displayed at all. So for example, if there is no ethernet interface active, or there is no battery attached to the device, the status bar won't waste any space for these things that don't exist.

Usage

Before executing this script, you may want to open it inside a text editor and overview the configuration section.

Then, for the ability to execute the script, change the file mode of the script to add the 'execute' permission. In a terminal, navigate to the directory where you saved the shell script, and type:

chmod +x ./dwm-status.sh

After that, you can directly launch the script using:

./dwm-status.sh &

The ampersand (&) ensures, that the shell script will run in the background, even if you close the current terminal window. You will get the process ID (PID) of the created process returned though.

For testing and debugging purposes, it is certainly easier to omit the ampersand and terminate the script using the Ctrl+c key press.

If you have decided to utilize this script from now on, make sure that it gets launched automatically, whenever you log in to DWM. This can be done using the 'autostart' patch for DWM, or by editing .xinitrc (login from TTY) or .xsession (login from graphical login screen).

Refreshing the weather status module

For the current weather temperature and a description to show up in the status bar, you need to specify the API key for OpenWeatherMap in the script's configuration section before executing the script.

To obtain such an API key, register for free at the OpenWeatherMap website:

Also, weather information is only received and displayed by the script, if requested manually.

To use the weather status module, make sure that the shell script is already running in the background, and then call another instance for refreshing the weather status module by executing:

./dwm-status.sh refresh-weather

You need to run this command every time, that you want to display the current, up-to-date weather information from OpenWeatherMap.

For convenience, it is of course recommended, that you bind that command to a key kombination, or run it as a scheduled task if you prefer automation.

License

This script is licensed under the GNU General Public License version 3 or newer.

See the file LICENSE for more information.