Skip to content
This repository has been archived by the owner on Jul 30, 2024. It is now read-only.
/ dwm-bar Public archive

A modular statusbar for dwm

License

Notifications You must be signed in to change notification settings

hollystandring/dwm-bar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

dwm-bar

A modular statusbar for dwm

THIS PROJECT HAS A NEW HOME

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 screenshot

Table of Contents

Installation

  1. Clone and enter the repository:
git clone https://github.com/hollystandring/dwm-bar
cd dwm-bar
  1. (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.

  1. (Optional) If you plan to use unicode identifiers, you should install a font which includes these (Nerd Fonts, siji)
  2. Enable/disable desired functions (see Configuration).
  3. Run the script
./dwm_bar.sh

Configuration

dwm-bar will require some setup before it can be used.

Enabling Functions

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

Refresh rate

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.

Configuring functions

Some functions, such as dwm_weather require additional setup and will be outlined with a comment where this is the case.

Identifiers

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]

Current Functions

dwm_alsa

Displays the current master volume of ALSA

[πŸ”‰ 55%]

Dependencies: alsa-utils

dwm_pulse

Displays the current master volume of PulseAudio

[πŸ”‰ 55%]

Dependencies: pamixer

dwm_battery

Displays battery level and status

[πŸ”‹ 100% full]

dwm_countdown

Displays the status of countdown

[⏳ 00:10:00]

Dependencies: countdown.sh

dwm_alarm

Displays upcoming alarms from alarm

[⏰ 22:30:00]

Dependencies: alarm.sh

dwm_keyboard

Displays the current keyboard layout

[⌨ gb]

Dependencies: xorg-setxkbmap

dwm_resources

Displays information regarding memory, CPU temperature, and storage

[πŸ–₯ MEM 1.3Gi/15Gi CPU 45C STO 2.3G/200G: 2%]

dwm_cmus

Displays current cmus status, artist, track, position, duration, and shuffle

[β–Ά The Unicorns - Tuff Ghost 0:43/2:56 πŸ”€]

Dependencies: cmus

dwm_mpc

Displays current mpc status, artist, track, position, duration, and shuffle

[β–Ά The Unicorns - Tuff Ghost 0:43/2:56 πŸ”€]

Dependencies: mpc

dwm_spotify

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

dwm_date

Displays the current date and time

[πŸ•° Mon 06-05-19 21:31:58]

dwm_mail

Displays the current number of emails in an inbox

[πŸ“« 2]

dwm_weather

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]

dwm_networkmanager

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

dwm_wpa

Displays the current network connection and private IP using wpa_cli

[ο€€ My-Wifi 192.168.0.3]

Dependencies: wpa_cli

dwm_vpn

Displays the current VPN connections with OpenVPN or Wireguard

[πŸ”’ Sweden - Stockholm]

Dependencies: NetworkManager, NetworkManager-openvpn (for OpenVPN connections)

dwm_ccurse

Displays the next appointment from calcurse

[πŸ’‘ 18/04/19 19:00 20:00 Upload dwm_ccurse]

Dependencies: calcurse

dwm_transmission

Displays the current status of a torrent with transmission-remote

[⏬ archlinux-2019.06.01... | 92% 1min ⬆3.4 ⬇1.5]

Dependencies: transmission-remote

dwm_backlight

Displays the current backlight level with xbacklight

[β˜€ 80]

Dependencies: xbacklight

dwm_connman

Shows network information IP, SSID, WLan strength (if connected to WLan) using connman.

[🌐 192.169.189.12 HomeNetworkName 53%]

Dependencies: connman

dwm_loadavg

Displays the average system load

[⏱ 0.14 0.17 0.18]

dwm_solar_panel

Displays how much power is being produced from your solar panels

[πŸ’‘ 3.012 W ]

dwm_currency

Displays the current rate of your currency in comparison to the USD provided by rate.sx

[πŸ’‘ 1.225 ]

Dependencies: curl

dwm_network_speed

Displays the speed of download and upload.

[六 0KB/s 0KB/s]

Contributing

See CONTRIBUTING.md before contributing.

Acknowledgements

Code for some functions was modified from:

Releases

No releases published

Packages

No packages published

Languages