Giter Club home page Giter Club logo

dwm-anybar's Introduction

dwm-anybar

Main CI

dwm-anybar is a patch for dwm that enables dwm to manage external status bars such as lemonbar and polybar. Dwm treats the external bar as it would its own, so all regular dwm commands such as togglebar affect the external bar in the same way.

Requirements

This patch has no additional requirements beyond regular dwm.

Appling the Patch

The patch can be found on the Releases page. Download the latest version of the patch that matches your version of dwm.

Update patches can also be found on the same page which can be applied on top of previous anybar patches to fix bugs, improve compatability, etc.

Configuration

static const int showbar       = 1;          /* 0 means no bar */
static const int topbar        = 1;          /* 0 means bottom bar */
static const int usealtbar     = 1;          /* 1 means use non-dwm status bar */
static const char *altbarclass = "Polybar";  /* Alternate bar class name */
static const char *altbarcmd   = "$HOME/bar.sh"; /* Alternate bar launch command */

showbar and topbar affect the external status bar as it would dwm's status bar. showbar must be 1 to show the external bar. topbar must be set appropriately as well based on if the external bar is docked at the bottom or the top of the screen. The patch only supports bars docked at the top/bottom of the monitor.

usealtbar must be set to 1 to use an external status bar, otherwise dwm's own bar will be enabled.

altbarclass must be set to the class name of the external status bar for dwm to differentiate it from regular windows. The class name of the bar can be found using xprop

xprop(1):
 WM_CLASS(STRING) = instance, class
                              ^^^^^
                              altbarclass should be set to this
 WM_NAME(STRING) = title

altbarcmd can be set to the path to a script that launches your bar. This script should launch the bar in the background (i.e. with an & after the launch command in the script), otherwise dwm will keep waiting for the launch script to end and freeze. Environment variables are supported. This method to starting your bar is preferred since it ensures that the bar launches once dwm is ready rather than launching too early. Make sure this script checks for running bars before launching, else restarting dwm will cause duplicate bars. One way to do this would be to add something like this at the beginning of your script:

if pgrep '^polybar' > /dev/null; then
  exit 0
fi

Patch Compatability

If the patch is in some way incompatible with any other patches, feel free to create an issue.

The anybar patch has been successfully applied together with the following patches:

  • activetagindicatorbar
  • cfacts
  • combo
  • emptyview
  • ewmhtags
  • fullgaps
  • gaplessgrid
  • hide-vacant-tags
  • ipc
  • movestack
  • pertag
  • restartsig
  • scratchpad
  • statuspadding (merge conflict, but solveable)
  • sticky
  • swallow
  • title color
  • viewontag
  • warp
  • xrdb

Polybar Tray Fix

Since polybar's tray is handled as a separate window and is populated slowly, it is difficult to manage. There is a polybar-tray-fix version of the patch that allows dwm to manage the tray. The tray isn't actually managed until the togglebar command is called, but it fixes the issue where toggling the bar would not hide the tray.

This version of the patch adds alttrayname to config.def.h which is already set to the correct value.

Related Projects

See dwm-ipc

See polybar-dwm-module

dwm-anybar's People

Contributors

garbeam avatar hiltjo avatar mihirlad55 avatar cls avatar cdown avatar anydot avatar n-r-k avatar bakkeby avatar schachmat avatar ericpruitt avatar klemensn avatar mil avatar natehalsey avatar shad0w73 avatar dcousens avatar ianremmler avatar osandov avatar inzanity avatar explosion-mental avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.