A modular statusbar for dwm
I no longer use this account for personal reasons, however this repo has been left up as an archive as to not break existing configs. This project can now be found on my Codeberg account. I'd like to thank everyone who ever contributed here/used this project and I hope it has inspired your own work <3 - Holly
- Clone and enter the repository:
git clone https://github.com/hollystandring/dwm-bar
cd dwm-bar
- (Optional) Install Dependencies from
dep/YourDisto.txt
. This will install dependencies for ALL functions so consider excluding ones you do not plan to use. These can be found at the top of each bar function.
sudo xbps-install -S $(cat dep/void.txt) # Void
sudo pacman -S $(cat dep/arch.txt) # Arch
sudo dnf install $(cat dep/fedora.txt) # Fedora
β οΈ There are no dnf packages for spotifyd, pamixer and cmus. If you want to utilise these packages, please install them manually as shown in the corresponding gihub repos.
- (Optional) If you plan to use unicode identifiers, you should install a font which includes these (Nerd Fonts, siji)
- Enable/disable desired functions (see Configuration).
- Run the script
./dwm_bar.sh
dwm-bar will require some setup before it can be used.
Functions can be enabled by adding them to the import and upperbar variable in dwm_bar.sh. By default, all available functions will be commented here. If you are using the extrabar patch, functions can also be added to lowerbar to appear on the bottom of the screen. Some more intensive functions are parallelized to prevent the bar freezing. These are imported the same as regular functions but added to the parallelize()
function first. These use different names to regular functions and are commented out by default in dwm_bar.sh.
To enable dwm_battery and dwm_backlight on the top bar and dwm_pulse and dwm_weather (parallelized) on the bottom bar, for example, you should use:
# Import the modules
. "$DIR/bar-functions/dwm_battery.sh"
. "$DIR/bar-functions/dwm_backlight.sh"
. "$DIR/bar-functions/dwm_pulse.sh"
. "$DIR/bar-functions/dwm_weather.sh"
parallelize() {
while true
do
printf "Running parallel processes\n"
dwm_weather &
sleep 5
done
}
parallelize &
# Update dwm status bar every second
while true
do
# Append results of each func one by one to the upperbar string
upperbar=""
upperbar="$upperbar$(dwm_battery)"
upperbar="$upperbar$(dwm_backlight)"
# Append results of each func one by one to the lowerbar string
lowerbar=""
lowerbar="$lowerbar$(dwm_pulse)"
lowerbar="$lowerbar$(__DWM_BAR_WEATHER__)"
#xsetroot -name "$upperbar"
# Uncomment the line below to enable the lowerbar
xsetroot -name "$upperbar;$lowerbar"
sleep 1
done
If updating the bar every second is an issue, you can change the sleep
amount of both regular and parallelized functions in dwm_bar.sh.
Some functions, such as dwm_weather require additional setup and will be outlined with a comment where this is the case.
Unicode or plaintext identifiers can be used by altering the $IDENTIFIER
value in dwm_bar.sh. For example, when set to "unicode"
, dwm_mail will display:
[π« 0]
Otherwise, when not set it will display:
[MAIL 0]
Displays the current master volume of ALSA
[π 55%]
Dependencies: alsa-utils
Displays the current master volume of PulseAudio
[π 55%]
Dependencies: pamixer
Displays battery level and status
[π 100% full]
Displays the status of countdown
[β³ 00:10:00]
Dependencies: countdown.sh
Displays upcoming alarms from alarm
[β° 22:30:00]
Dependencies: alarm.sh
Displays the current keyboard layout
[β¨ gb]
Dependencies: xorg-setxkbmap
Displays information regarding memory, CPU temperature, and storage
[π₯ MEM 1.3Gi/15Gi CPU 45C STO 2.3G/200G: 2%]
Displays current cmus status, artist, track, position, duration, and shuffle
[βΆ The Unicorns - Tuff Ghost 0:43/2:56 π]
Dependencies: cmus
Displays current mpc status, artist, track, position, duration, and shuffle
[βΆ The Unicorns - Tuff Ghost 0:43/2:56 π]
Dependencies: mpc
Displays current Spotify status, artist, track, and duration
Either the official Spotify client or spotifyd can be used. Unfortunately, only spotifyd can provide track position and shuffle status
[βΆ The Unicorns - Tuff Ghost 0:43/2:56 π]
Dependencies: spotify/spotifyd, playerctl
Displays the current date and time
[π° Mon 06-05-19 21:31:58]
Displays the current number of emails in an inbox
[π« 2]
Displays the current weather provided by wttr.in
Please remember wttr.in has a limited number of requests, so this module may occasionally not be able to recieve weather information when experiencing high traffic.
[β +20Β°C]
Displays the current network connection, private IP, and public IP using NetworkManager
[π enp7s0: 192.168.0.1/24 | 185.199.109.153]
Dependencies: NetworkManager, curl
Displays the current network connection and private IP using wpa_cli
[ο€€ My-Wifi 192.168.0.3]
Dependencies: wpa_cli
Displays the current VPN connections with OpenVPN or Wireguard
[π Sweden - Stockholm]
Dependencies: NetworkManager, NetworkManager-openvpn (for OpenVPN connections)
Displays the next appointment from calcurse
[π‘ 18/04/19 19:00 20:00 Upload dwm_ccurse]
Dependencies: calcurse
Displays the current status of a torrent with transmission-remote
[β¬ archlinux-2019.06.01... | 92% 1min β¬3.4 β¬1.5]
Dependencies: transmission-remote
Displays the current backlight level with xbacklight
[β 80]
Dependencies: xbacklight
Shows network information IP, SSID, WLan strength (if connected to WLan) using connman.
[π 192.169.189.12 HomeNetworkName 53%]
Dependencies: connman
Displays the average system load
[β± 0.14 0.17 0.18]
Displays how much power is being produced from your solar panels
[π‘ 3.012 W ]
Displays the current rate of your currency in comparison to the USD provided by rate.sx
[π‘ 1.225 ]
Dependencies: curl
Displays the speed of download and upload.
[六 0KB/s 0KB/s]
See CONTRIBUTING.md before contributing.
Code for some functions was modified from: