dwm-bar for archlinux
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

252 lines
7.6 KiB

5 years ago
4 years ago
5 years ago
5 years ago
4 years ago
5 years ago
4 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
4 years ago
5 years ago
4 years ago
5 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
5 years ago
4 years ago
5 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. # dwm-bar
  2. A modular statusbar for dwm
  3. ![screenshot](sshot.png)
  4. [![ko-fi](https://www.ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/J3J11S7DZ)
  5. ## Table of Contents
  6. - [Current Functions](#current-functions)
  7. - [dwm_alsa](#dwm_alsa)
  8. - [dwm_pulse](#dwm_pulse)
  9. - [dwm_battery](#dwm_battery)
  10. - [dwm_countdown](#dwm_countdown)
  11. - [dwm_alarm](#dwm_alarm)
  12. - [dwm_keyboard](#dwm_keyboard)
  13. - [dwm_resources](#dwm_resources)
  14. - [dwm_cmus](#dwm_cmus)
  15. - [dwm_mpc](#dwm_mpc)
  16. - [dwm_spotify](#dwm_mpc)
  17. - [dwm_date](#dwm_date)
  18. - [dwm_mail](#dwm_mail)
  19. - [dwm_weather](#dwm_weather)
  20. - [dwm_networkmanager](#dwm_networkmanager)
  21. - [dwm_wpa](#dwm_wpa)
  22. - [dwm_vpn](#dwm_vpn)
  23. - [dwm_ccurse](#dwm_ccurse)
  24. - [dwm_transmission](#dwm_transmission)
  25. - [dwm_backlight](#dwm_backlight)
  26. - [dwm_connman](#dwm_connman)
  27. - [dwm_loadavg](#dwm_loadavg)
  28. - [dwm_currency](#dwm_currency)
  29. - [dwm_solar_panel](#dwm_solar_panel)
  30. - [Installation](#installation)
  31. - [Configuration](#configuration)
  32. - [Reccomendations](#reccomendations)
  33. - [Usage](#usage)
  34. - [Customizing](#customizing)
  35. - [Contributing](#contributing)
  36. - [Acknowledgements](#acknowledgements)
  37. ### dwm_alsa
  38. Displays the current master volume of ALSA
  39. ```
  40. [🔉 55%]
  41. ```
  42. Dependencies: ```alsa-utils```
  43. ### dwm_pulse
  44. Displays the current master volume of PulseAudio
  45. ```
  46. [🔉 55%]
  47. ```
  48. Dependencies: ```pamixer```
  49. ### dwm_battery
  50. Displays battery level and status
  51. ```
  52. [🔋 100% full]
  53. ```
  54. ### dwm_countdown
  55. Displays the status of [countdown](https://github.com/joestandring/countdown)
  56. ```
  57. [⏳ 00:10:00]
  58. ```
  59. Dependencies: ```countdown.sh```
  60. ### dwm_alarm
  61. Displays upcoming alarms from [alarm](https://github.com/joestandring/alarm)
  62. ```
  63. [⏰ 22:30:00]
  64. ```
  65. Dependencies: ```alarm.sh```
  66. ### dwm_keyboard
  67. Displays the current keyboard layout
  68. ```
  69. [⌨ gb]
  70. ```
  71. Dependencies: ```xorg-setxkbmap```
  72. ### dwm_resources
  73. Displays information regarding memory, CPU temperature, and storage
  74. ```
  75. [🖥 MEM 1.3Gi/15Gi CPU 45C STO 2.3G/200G: 2%]
  76. ```
  77. ### dwm_cmus
  78. Displays current cmus status, artist, track, position, duration, and shuffle
  79. ```
  80. [▶ The Unicorns - Tuff Ghost 0:43/2:56 🔀]
  81. ```
  82. Dependencies: ```cmus```
  83. ### dwm_mpc
  84. Displays current mpc status, artist, track, position, duration, and shuffle
  85. ```
  86. [▶ The Unicorns - Tuff Ghost 0:43/2:56 🔀]
  87. ```
  88. Dependencies: ```mpc```
  89. ### dwm_spotify
  90. Displays current Spotify status, artist, track, and duration
  91. Either the official Spotify client or spotifyd can be used. Unfortunately, only spotifyd can provide track position and shuffle status
  92. ```
  93. [▶ The Unicorns - Tuff Ghost 0:43/2:56 🔀]
  94. ```
  95. Dependencies: ```spotify/spotifyd, playerctl```
  96. ### dwm_date
  97. Displays the current date and time
  98. ```
  99. [🕰 Mon 06-05-19 21:31:58]
  100. ```
  101. ### dwm_mail
  102. Displays the current number of emails in an inbox
  103. ```
  104. [📫 2]
  105. ```
  106. ### dwm_weather
  107. Displays the current weather provided by [wttr.in](https://wttr.in)
  108. 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.
  109. ```
  110. [☀ +20°C]
  111. ```
  112. ### dwm_networkmanager
  113. Displays the current network connection, private IP, and public IP using NetworkManager
  114. ```
  115. [🌐 enp7s0: 192.168.0.1/24 | 185.199.109.153]
  116. ```
  117. Dependencies: ```NetworkManager, curl```
  118. ### dwm_wpa
  119. Displays the current network connection and private IP using wpa_cli
  120. ```
  121. [襤 My-Wifi 192.168.0.3]
  122. ```
  123. Dependencies: ```wpa_cli```
  124. ### dwm_vpn
  125. Displays the current VPN connections with OpenVPN or Wireguard
  126. ```
  127. [🔒 Sweden - Stockholm]
  128. ```
  129. Dependencies: ```NetworkManager, NetworkManager-openvpn (for OpenVPN connections)```
  130. ### dwm_ccurse
  131. Displays the next appointment from calcurse
  132. ```
  133. [💡 18/04/19 19:00 20:00 Upload dwm_ccurse]
  134. ```
  135. Dependencies: ```calcurse```
  136. ### dwm_transmission
  137. Displays the current status of a torrent with transmission-remote
  138. ```
  139. [⏬ archlinux-2019.06.01... | 92% 1min ⬆3.4 ⬇1.5]
  140. ```
  141. Dependencies: ```transmission-remote```
  142. ### dwm_backlight
  143. Displays the current backlight level with xbacklight
  144. ```
  145. [☀ 80]
  146. ```
  147. Dependencies: ```xbacklight```
  148. ### dwm_connman
  149. Shows network information IP, SSID, WLan strength (if connected to WLan) using connman.
  150. ```
  151. [🌐 192.169.189.12 HomeNetworkName 53%]
  152. ```
  153. Dependencies: ```connman```
  154. ### dwm_loadavg
  155. Displays the average system load
  156. ```
  157. [⏱ 0.14 0.17 0.18]
  158. ```
  159. ### dwm_solar_panel
  160. Displays how much power is being produced from your solar panels
  161. ```
  162. [💡 3.012 W ]
  163. ```
  164. ### dwm_currency
  165. Displays the current rate of your currency in comparison to the USD provided by [rate.sx](http://rate.sx/)
  166. ```
  167. [💡 1.225 ]
  168. ```
  169. Dependencies: ```curl```
  170. ## Installation
  171. 1. Clone and enter the repository:
  172. ```
  173. $ git clone https://github.com/joestandring/dwm-bar
  174. $ cd dwm-bar
  175. ```
  176. 2. Make the script executable
  177. ```
  178. $ chmod +x dwm_bar.sh
  179. ```
  180. ## Configuration
  181. dwm-bar supports the [extrabar](https://dwm.suckless.org/patches/status2d/dwm-status2d-extrabar-6.2.diff) patch for dwm. This allows the user to add a second status bar at the bottom of the screen. To add the second bar:
  182. 1. Patch dwm with the the [extrabar](https://dwm.suckless.org/patches/status2d/dwm-status2d-extrabar-6.2.diff) plugin
  183. 2. Comment out the line ```xsetroot -name "$upperbar"``` in ```dwm_bar.sh```
  184. 3. Uncomment the line ```xsetroot -name "$upperbar;$lowerbar"``` in ```dwm_bar.sh```
  185. 4. Append functions underneath ```upperbar=""``` and ```lowerbar=""```. For example:
  186. ```
  187. # Append results of each func one by one to the upperbar string
  188. upperbar=""
  189. upperbar="$upperbar$(dwm_myupperfunction)"
  190. # Append results of each func one by one to the lowerbar string
  191. lowerbar=""
  192. lowerbar="$lowerbar$(dwm_mylowerfunction)"
  193. ```
  194. ## Recommendations
  195. To make the most out of Unicode support, consider using a font that includes many Unicode characters. For example:
  196. * [Nerd Fonts](https://github.com/ryanoasis/nerd-fonts)
  197. * [Siji](https://github.com/stark/siji)
  198. * [Font Awesome](https://fontawesome.com/)
  199. While not always necessary, it's a good idea to specify these fonts in your dwm config.
  200. ## Quick Start
  201. Simply run the script and dwm should display your bar:
  202. ```
  203. $ ./dwm_bar.sh
  204. ```
  205. Most likely, you will need to change some values for functions to get them to work - these are outlined with a comment for functions where this is likely the case.
  206. If you would like your bar to be displayed when X starts, add this to your .xinitrc file before launching dwm. For example, if the script is located in /home/$USER/dwm-bar/:
  207. ```
  208. # Statusbar
  209. /home/$USER/dwm-bar/dwm_bar.sh &
  210. # Start dwm
  211. exec dwm
  212. ```
  213. ## Customizing
  214. dwm-bar is completely modular, meaning you can mix and match functions to your heart's content. It's functions are located in the bar-functions/ subdirectory and included in dwm_bar.sh
  215. If you want to make your own function, for example, dwm_myfunction.sh, you should create it in the bar-functions/ subdirectory before including it in dwm_bar.sh and adding it to the xsetroot command:
  216. ```
  217. # Import the modules
  218. . "$DIR/bar-functions/dwm_myfucntion"
  219. while true
  220. do
  221. xsetroot -name "$(dwm_myfunction)"
  222. sleep 1
  223. done
  224. ```
  225. You can also decide to use Unicode or plaintext identifiers for functions by altering the ```$IDENTIFIER``` value. For example, set to ```"unicode"```, ```dwm_mail``` will display:
  226. ```
  227. [📫 0]
  228. ```
  229. Whereas, if it is not set it will display:
  230. ```
  231. [MAIL 0]
  232. ```
  233. ## Contributing
  234. See [CONTRIBUTING.md](CONTRIBUTING.md) before contributing.
  235. ## Acknowledgements
  236. Code for some functions was modified from:
  237. * [Klemens Nanni](https://notabug.org/kl3)
  238. * [@boylemic](https://github.com/boylemic/configs/blob/master/dwm_status)
  239. * [Parket Johnson](https://github.com/ronno/scripts/blob/master/xsetcmus)
  240. * [suckless.org](https://dwm.suckless.org/status_monitor/)
  241. * [@mcallistertyler95](https://github.com/mcallistertyler95/dwm-bar)