Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hollystandring/dwm-bar
A modular statusbar for dwm
https://github.com/hollystandring/dwm-bar
dwm dwm-status shell statusbar
Last synced: 3 months ago
JSON representation
A modular statusbar for dwm
- Host: GitHub
- URL: https://github.com/hollystandring/dwm-bar
- Owner: hollystandring
- License: gpl-3.0
- Archived: true
- Created: 2019-05-06T13:01:36.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-07-30T13:15:47.000Z (4 months ago)
- Last Synced: 2024-07-31T16:16:38.488Z (4 months ago)
- Topics: dwm, dwm-status, shell, statusbar
- Language: Shell
- Homepage:
- Size: 479 KB
- Stars: 423
- Watchers: 5
- Forks: 62
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# 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](https://codeberg.org/pndaspace) 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](https://raw.githubusercontent.com/hollystandring/dwm-bar/master/sshot.png)
## Table of Contents
- [Installation](#installation)
- [Configuration](#configuration)
- [Enabling Functions](#enabling-functions)
- [Refresh Rate](#refresh-rate)
- [Configuring Functions](#configuring-functions)
- [Identifiers](#identifiers)
- [Current Functions](#current-functions)
- [dwm_alsa](#dwm_alsa)
- [dwm_pulse](#dwm_pulse)
- [dwm_battery](#dwm_battery)
- [dwm_countdown](#dwm_countdown)
- [dwm_alarm](#dwm_alarm)
- [dwm_keyboard](#dwm_keyboard)
- [dwm_resources](#dwm_resources)
- [dwm_cmus](#dwm_cmus)
- [dwm_mpc](#dwm_mpc)
- [dwm_spotify](#dwm_mpc)
- [dwm_date](#dwm_date)
- [dwm_mail](#dwm_mail)
- [dwm_weather](#dwm_weather)
- [dwm_networkmanager](#dwm_networkmanager)
- [dwm_wpa](#dwm_wpa)
- [dwm_vpn](#dwm_vpn)
- [dwm_ccurse](#dwm_ccurse)
- [dwm_transmission](#dwm_transmission)
- [dwm_backlight](#dwm_backlight)
- [dwm_connman](#dwm_connman)
- [dwm_loadavg](#dwm_loadavg)
- [dwm_currency](#dwm_currency)
- [dwm_solar_panel](#dwm_solar_panel)
- [dwm_network_speed](#dwm_network_speed)
- [Contributing](#contributing)
- [Acknowledgements](#acknowledgements)
## Installation
1. Clone and enter the repository:
```
git clone https://github.com/hollystandring/dwm-bar
cd dwm-bar
```
2. (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
```
> :warning: There are no dnf packages for [spotifyd](https://github.com/Spotifyd/spotifyd), [pamixer](https://github.com/cdemoulins/pamixer) and [cmus](https://github.com/cmus/cmus). If you want to utilise these packages, please install them manually as shown in the corresponding gihub repos.
3. (Optional) If you plan to use unicode identifiers, you should install a font which includes these ([Nerd Fonts](https://github.com/ryanoasis/nerd-fonts), [siji](https://github.com/stark/siji))
4. Enable/disable desired functions (see [Configuration](#configuration)).
5. 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](https://dwm.suckless.org/patches/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](https://github.com/hollystandring/countdown)
```
[โณ 00:10:00]
```
Dependencies: ```countdown.sh```
### dwm_alarm
Displays upcoming alarms from [alarm](https://github.com/hollystandring/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 durationEither 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](https://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](http://rate.sx/)
```
[๐ก 1.225 ]
```
Dependencies: ```curl```
### dwm_network_speed
Displays the speed of download and upload.
```
[๏งก 0KB/s 0KB/s]
```
## Contributing
See [CONTRIBUTING.md](CONTRIBUTING.md) before contributing.
## Acknowledgements
Code for some functions was modified from:
* [Klemens Nanni](https://notabug.org/kl3)
* [@boylemic](https://github.com/boylemic/configs/blob/master/dwm_status)
* [Parket Johnson](https://github.com/ronno/scripts/blob/master/xsetcmus)
* [suckless.org](https://dwm.suckless.org/status_monitor/)
* [@mcallistertyler95](https://github.com/mcallistertyler95/dwm-bar)