Skip to content

chhajedji/dwm

Repository files navigation

Continued from dwm version 6.2

dwm - dynamic window manager

dwm is an extremely fast, small, and dynamic window manager for X.

** Easy and better build process for suckless utilities. **


Most suckless utilities like st, dmenu, dwm etc can be build with make install and hence I use easy way to install and save the configuration neatly. If you use any suckless utility, this method can come handy to you as well. 😃

The function:
bsa() {
    [ $1 ] && cd $HOME/pnl/github/$1
    sudo make clean install >/dev/null &&
        echo "$1 build successful." &&
        echo "Last built on commit ID $(git log |head -n1 | cut -f2 -d ' ') with changes:" > .build &&
        git diff >> .build &&
        git diff --cached >> .build
}
  • All my suckless utilities like dwm, st are kept inside ~/pnl/github/ directory. So if I give any argument to bsa, then it will cd into that directory and then build it. If no argument is given, then function assumes that you are in one of the suckless directories and want to build current utility.
  • If the current directory is a git directory (which it should be :P ), then some details as described further, are stored in a .build file whenever build is success. Maybe you want to add .build in your .gitignore.
  • Details like:
    • latest commit ID on which you used bsa and compiled successfully.
    • diff if you had some staged/unstaged changes in your tree at time of last successful build. are stored in .build file.

This comes handy when you need to track why your current build is failing by looking at the last successful build status stored in .build file.

The usage:
bsa [OPTIONAL: Utility name]

~/pnl/github/dwm$ bsa dwm
dwm build successful.
~/pnl/github/dwm$ bsa st
4 entries written to /etc/terminfo
st build successful.
~/pnl/github/st$ cd ~/pnl/github/dwm
~/pnl/github/dwm$ bsa
 build successful.

Requirements

In order to build dwm you need the Xlib header files.

Installation

Edit config.mk to match your local setup (dwm is installed into the /usr/local namespace by default).

Afterwards enter the following command to build and install dwm (if necessary as root):

make clean install

Running dwm

Add the following line to your .xinitrc to start dwm using startx:

exec dwm

In order to connect dwm to a specific display, make sure that the DISPLAY environment variable is set correctly, e.g.:

DISPLAY=foo.bar:1 exec dwm

(This will start dwm on display :1 of the host foo.bar.)

In order to display status info in the bar, you can do something like this in your .xinitrc:

while xsetroot -name "`date` `uptime | sed 's/.*,//'`"
do
	sleep 1
done &
exec dwm

Configuration

The configuration of dwm is done by creating a custom config.h and (re)compiling the source code.

Patches

The file include_patches.h contains macros which enable/disable some of the patches. To enable a patch, set the value of corresponding macro to 1. And similarly to disable, set to 0.

Note that there are 10 tags in this dwn fork rather default 9. 10th tag is binded with "0" key.

  • fullgaps - For showing gaps in dwm 6.2.
  • autostart - Autostart applications after startup.
  • systray - Showing system tray to hold icons for applications like nm-applet.
  • restartsig - Apply changes without quitting dwm.
  • pertag - This patch keeps layout, mwfact and nmaster separate for each tag. barpos remains same for every tag.
  • bottomstack with ru_gaps - Same as tile layout but instead of single columns, new windows are attached in single row below master window. ru_gaps adds gaps to it.
  • centeredmaster with ru_gaps - Keep master in center and slaves at sides. This is with gaps present between windows. Here is original without gaps.
  • fullscreen - Applies the monocle layout with the focused client on top and hides the bar. When pressed again, shows the bar and restores the layout that was active before going fullscreen.
  • hide vacant tags - Hide vacant tags :)
  • activetagindicatorbar - Show rectangular boxes instead of squares on tags with some windows. This is not so useful when hide-vacant-tags is used and hence currently inacitve.

Modified patch activetagindicatorbar. Changed bar length and position from top to bottom. Indication is slimmer now 😎.

After modified activetagindicatorbar:

bar

  • tagswapmon - Swap tags between two monitors. Bring the important tag present on secondary screen onto primary screen with a single keybinding.
  • holdbar - Shows bar only when HOLDKEY is pressed. Some modifications in this patch. When bar is hidden, holdbar will be active and when bar is visible (after using togglebar), holdbar will not work. This is actually the default behavior of the patch when HOLDKEY is not MODKEY. But now this will work even when HOLDKEY is MODKEY. See this thread.
  • attachaside - Make new clients get attached and focused in the stacking area instead of always becoming the new master.
  • statuscolors - Add colors to status bar. This patch is currently inactive as it adds some unknown gaps when used with along systray patch. Here is a reddit discussion regarding same issue. Really useful patch if it's working properly.
  • statuscmd - This patch adds the ability to execute shell commands based on the mouse button and position when clicking the status bar. This patch has been slightly modified as per suggestion from @bakkeby. When applied with systray patch, a variable needs to be updated to get correct clicked location.
  • pywal - Set colors according to your wallpaper. This patch is useful when you have a single constant wallpaper. When wallpaper changes frequently, dwm will have to be recompiled to incorporate new colors. See this guide for setup.
  • scratchpads - Add scratchpads similar to i3wm. Useful for handy programs to be kept in scratchpad rather than always launching.

Scripts used in config.h can be found here.

After all the pathces, view appears as follows.

screen

About

Personal built of Dynamic Window Manager from suckless.org

Topics

Resources

License

Stars

Watchers

Forks