Compare commits
	
		
			43 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					af632efafb | ||
| 
						 | 
					5130e64014 | ||
| 
						 | 
					48b71050ab | ||
| 
						 | 
					c959e1cb58 | ||
| 
						 | 
					10b140adff | ||
| 
						 | 
					fde880858a | ||
| 
						 | 
					e896c3107e | ||
| 
						 | 
					e7ece2aaba | ||
| 
						 | 
					7d5b1b38a2 | ||
| 
						 | 
					bfa185fac4 | ||
| 
						 | 
					36e11cc61c | ||
| 
						 | 
					3047114a1f | ||
| 
						 | 
					81f908b5c6 | ||
| 
						 | 
					795f7d0011 | ||
| 
						 | 
					99a906d9e3 | ||
| 
						 | 
					8fe17768f7 | ||
| 
						 | 
					bd69540724 | ||
| 
						 | 
					e4457dd31e | ||
| 
						 | 
					5e3c442a2f | ||
| 
						 | 
					b788a08745 | ||
| 
						 | 
					e9c7ebcddc | ||
| 
						 | 
					699c83b6ff | ||
| 
						 | 
					5015cfc93b | ||
| 
						 | 
					485c40d5f9 | ||
| 
						 | 
					41958715d4 | ||
| 
						 | 
					5ac75bb689 | ||
| 
						 | 
					a60b1c5d2f | ||
| 
						 | 
					0f49dbddfb | ||
| 
						 | 
					d194f2c726 | ||
| 
						 | 
					2769ef11ad | ||
| 
						 | 
					8faf64215e | ||
| 
						 | 
					c2fa943e86 | ||
| 
						 | 
					eaf997ee88 | ||
| 
						 | 
					d0b1d46ed4 | ||
| 
						 | 
					4134edfc38 | ||
| 
						 | 
					5315d6ae96 | ||
| 
						 | 
					0a4ab3b407 | ||
| 
						 | 
					cc1f6ffbc2 | ||
| 
						 | 
					8531dc3158 | ||
| 
						 | 
					ab1c6e3d00 | ||
| 
						 | 
					84d1b45060 | ||
| 
						 | 
					96163849d6 | ||
| 
						 | 
					cbf3a73d72 | 
							
								
								
									
										3
									
								
								.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,3 @@
 | 
			
		||||
.vscode/
 | 
			
		||||
*.o
 | 
			
		||||
dwm
 | 
			
		||||
							
								
								
									
										1
									
								
								LICENSE
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								LICENSE
									
									
									
									
									
								
							@@ -17,6 +17,7 @@ MIT/X Consortium License
 | 
			
		||||
© 2015-2016 Quentin Rameau <quinq@fifth.space>
 | 
			
		||||
© 2015-2016 Eric Pruitt <eric.pruitt@gmail.com>
 | 
			
		||||
© 2016-2017 Markus Teich <markus.teich@stusta.mhn.de>
 | 
			
		||||
© 2020 Sravan Balaji <balajsra@umich.edu>
 | 
			
		||||
 | 
			
		||||
Permission is hereby granted, free of charge, to any person obtaining a
 | 
			
		||||
copy of this software and associated documentation files (the "Software"),
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										48
									
								
								README
									
									
									
									
									
								
							
							
						
						
									
										48
									
								
								README
									
									
									
									
									
								
							@@ -1,48 +0,0 @@
 | 
			
		||||
dwm - dynamic window manager
 | 
			
		||||
============================
 | 
			
		||||
dwm is an extremely fast, small, and dynamic window manager for X.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
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.
 | 
			
		||||
							
								
								
									
										79
									
								
								README.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										79
									
								
								README.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,79 @@
 | 
			
		||||
# Sravan's dwm - dynamic window manager
 | 
			
		||||
 | 
			
		||||
[dwm](https://dwm.suckless.org/) is an extremely fast, small, and dynamic window manager for X.
 | 
			
		||||
This is Sravan's fork of dwm with patches and custom modifications.
 | 
			
		||||
 | 
			
		||||
## dwm Information
 | 
			
		||||
 | 
			
		||||
### 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.
 | 
			
		||||
 | 
			
		||||
## Personal Modifications
 | 
			
		||||
 | 
			
		||||
### Patches
 | 
			
		||||
 | 
			
		||||
* [autostart](https://dwm.suckless.org/patches/autostart/)
 | 
			
		||||
* [centeredmaster](https://dwm.suckless.org/patches/centeredmaster/)
 | 
			
		||||
* [combo](https://dwm.suckless.org/patches/combo/)
 | 
			
		||||
* [cyclelayouts](https://dwm.suckless.org/patches/cyclelayouts/)
 | 
			
		||||
* [gridmode](https://dwm.suckless.org/patches/gridmode/)
 | 
			
		||||
* [movestack](https://dwm.suckless.org/patches/movestack/)
 | 
			
		||||
* [restartsig](https://dwm.suckless.org/patches/restartsig/)
 | 
			
		||||
* [ru_gaps](https://dwm.suckless.org/patches/ru_gaps/)
 | 
			
		||||
* [systray](https://dwm.suckless.org/patches/systray/)
 | 
			
		||||
 | 
			
		||||
### Modifications
 | 
			
		||||
 | 
			
		||||
* Change mod key to super key (windows key)
 | 
			
		||||
* Change terminal from st to alacritty
 | 
			
		||||
* Change colors to follow [Dracula](https://draculatheme.com) theme
 | 
			
		||||
* Increase border to 3 pixels
 | 
			
		||||
* Set default gap size to 10 pixels
 | 
			
		||||
* Change tags to be [Font Awesome](https://fontawesome.com) icons
 | 
			
		||||
* Run programs and processes on autostart
 | 
			
		||||
* [Pulse Audio Volume Control](https://gist.github.com/palopezv/efd34059af6126ad970940bcc6a90f2e)
 | 
			
		||||
* Media Play/Pause, Prev, and Next Keybindings via [Playerctl](https://github.com/altdesktop/playerctl)
 | 
			
		||||
  * Arch Community Repo: [playerctl](https://www.archlinux.org/packages/community/x86_64/playerctl/)
 | 
			
		||||
* Use [light-locker](https://github.com/the-cavalry/light-locker) to lock screen with [LightDM](https://github.com/canonical/lightdm)
 | 
			
		||||
  * Arch Community Repo: [lightdm](https://www.archlinux.org/packages/extra/x86_64/lightdm/)
 | 
			
		||||
  * Arch Community Repo: [light-locker](https://www.archlinux.org/packages/community/x86_64/light-locker/)
 | 
			
		||||
* Brightness Increase and Decrease Keybindings via [acpilight](https://gitlab.com/wavexx/acpilight)
 | 
			
		||||
  * Arch Community Repo: [acpilight](https://www.archlinux.org/packages/community/any/acpilight/)
 | 
			
		||||
							
								
								
									
										53
									
								
								autoquit.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										53
									
								
								autoquit.sh
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,53 @@
 | 
			
		||||
#!/bin/bash
 | 
			
		||||
 | 
			
		||||
########################
 | 
			
		||||
# Startup Applications #
 | 
			
		||||
########################
 | 
			
		||||
# List of applications to kill on exit
 | 
			
		||||
declare -a applications_array=(\
 | 
			
		||||
    # System Tray Applications
 | 
			
		||||
    "volctl" \          # PulseAudio Volume Control
 | 
			
		||||
    "nyrna" \           # Nyrna Application Suspend
 | 
			
		||||
    "blueman-tray" \    # Blueman Bluetooth Manager
 | 
			
		||||
    "nm-applet" \       # Network Manager Applet
 | 
			
		||||
    "kdeconnect-indi" \ # KDE Connect
 | 
			
		||||
    "flameshot" \       # Flameshot Screenshot Tool
 | 
			
		||||
    "redshift-gtk" \    # Redshift Blue Light Filter
 | 
			
		||||
    # Background Processes
 | 
			
		||||
    "picom" \           # Picom Compositor
 | 
			
		||||
    "xfce4-notifyd" \   # Xfce Notification Daemon
 | 
			
		||||
    "greenclip" \       # Greenclip Clipboard Manager
 | 
			
		||||
    "redshift" \        # Redshift Blue Light Filter
 | 
			
		||||
    "polkit-gnome-au" \ # GNOME Polkit Authentication Agent
 | 
			
		||||
    "slstatus" \        # slstatus status bar
 | 
			
		||||
    "light-locker" \    # LightDM Locker
 | 
			
		||||
    # Hardware Driver Applications
 | 
			
		||||
    "solaar" \          # Logitech Mouse Driver
 | 
			
		||||
    "polychromatic-t" \ # Razer Keyboard Customization
 | 
			
		||||
    "optimus-manager" \ # Optimus Manager Qt
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
# Kill applications
 | 
			
		||||
for i in "${applications_array[@]}"
 | 
			
		||||
do
 | 
			
		||||
    pkill -9 $i &
 | 
			
		||||
done
 | 
			
		||||
 | 
			
		||||
#####################
 | 
			
		||||
# Cloud Drive Rsync #
 | 
			
		||||
#####################
 | 
			
		||||
# Local cloud storage directory
 | 
			
		||||
local_clone_dir="$HOME/Cloud"
 | 
			
		||||
 | 
			
		||||
# List of remotes as defined in rclone
 | 
			
		||||
declare -a remote_array=(\
 | 
			
		||||
    "OneDrive - Personal" \
 | 
			
		||||
    "Google Drive - Personal" \
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
# Unmount Remotes
 | 
			
		||||
for i in "${remote_array[@]}"
 | 
			
		||||
do
 | 
			
		||||
    local_path="$local_clone_dir"/"$i"
 | 
			
		||||
    fusermount -u "$local_path" &
 | 
			
		||||
done
 | 
			
		||||
							
								
								
									
										62
									
								
								autostart.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										62
									
								
								autostart.sh
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,62 @@
 | 
			
		||||
#!/bin/bash
 | 
			
		||||
 | 
			
		||||
########################
 | 
			
		||||
# Startup Applications #
 | 
			
		||||
########################
 | 
			
		||||
# List of applications to run on start
 | 
			
		||||
declare -a applications_array=(\
 | 
			
		||||
    # System Restore Processes
 | 
			
		||||
    "bash /home/sravan/.screenlayout/default-screen-layout.sh" \    # Restore default screen layout
 | 
			
		||||
    "nitrogen --restore" \                                          # Restore wallpaper
 | 
			
		||||
    # System Tray Applications
 | 
			
		||||
    "volctl" \                                                      # PulseAudio Volume Control
 | 
			
		||||
    "nyrna" \                                                       # Nyrna Application Suspend
 | 
			
		||||
    "blueman-tray" \                                                # Blueman Bluetooth Manager
 | 
			
		||||
    "nm-applet" \                                                   # Network Manager Applet
 | 
			
		||||
    "kdeconnect-indicator" \                                        # KDE Connect
 | 
			
		||||
    "flameshot" \                                                   # Flameshot Screenshot Tool
 | 
			
		||||
    # Background Processes
 | 
			
		||||
    "picom --config /home/sravan/.config/picom/picom.conf" \        # Picom Compositor
 | 
			
		||||
    "/usr/lib/xfce4/notifyd/xfce4-notifyd" \                        # Xfce Notification Daemon
 | 
			
		||||
    "greenclip daemon" \                                            # Greenclip Clipboard Manager
 | 
			
		||||
    "redshift -x" \                                                 # Reset redshift display gamma
 | 
			
		||||
    "redshift-gtk" \                                                # Redshift Blue Light Filter
 | 
			
		||||
    "/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1" \   # GNOME Polkit Authentication Agent
 | 
			
		||||
    "slstatus" \                                                    # slstatus status bar
 | 
			
		||||
    "light-locker --lock-on-suspend --lock-on-lid" \                # LightDM Locker
 | 
			
		||||
    # Hardware Driver Applications
 | 
			
		||||
    "solaar --window=hide" \                                        # Logitech Mouse Driver
 | 
			
		||||
    "polychromatic-tray-applet" \                                   # Razer Keyboard Customization
 | 
			
		||||
    "optimus-manager-qt" \                                          # Optimus Manager Qt
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
# Run applications (ignore if they don't exist)
 | 
			
		||||
for i in "${applications_array[@]}"
 | 
			
		||||
do
 | 
			
		||||
    if ! command -v $i > /dev/null
 | 
			
		||||
    then
 | 
			
		||||
        do_nothing() { :; }
 | 
			
		||||
    else
 | 
			
		||||
        $i &
 | 
			
		||||
    fi
 | 
			
		||||
done
 | 
			
		||||
 | 
			
		||||
#####################
 | 
			
		||||
# Cloud Drive Rsync #
 | 
			
		||||
#####################
 | 
			
		||||
# Local cloud storage directory
 | 
			
		||||
local_clone_dir="$HOME/Cloud"
 | 
			
		||||
 | 
			
		||||
# List of remotes as defined in rclone
 | 
			
		||||
declare -a remote_array=(\
 | 
			
		||||
    "OneDrive - Personal" \
 | 
			
		||||
    "Google Drive - Personal" \
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
# Mount Remotes
 | 
			
		||||
for i in "${remote_array[@]}"
 | 
			
		||||
do
 | 
			
		||||
    local_path="$local_clone_dir"/"$i"
 | 
			
		||||
    mkdir -p "$local_path"
 | 
			
		||||
    rclone mount "$i": "$local_path" &
 | 
			
		||||
done
 | 
			
		||||
							
								
								
									
										164
									
								
								config.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										164
									
								
								config.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,164 @@
 | 
			
		||||
/* See LICENSE file for copyright and license details. */
 | 
			
		||||
 | 
			
		||||
/* includes */
 | 
			
		||||
#include <X11/XF86keysym.h>
 | 
			
		||||
#include "movestack.c"
 | 
			
		||||
 | 
			
		||||
/* appearance */
 | 
			
		||||
static const unsigned int borderpx  = 3;        /* border pixel of windows */
 | 
			
		||||
static const int gappx				= 15;		/* gaps between windows */
 | 
			
		||||
static const unsigned int snap      = 10;       /* snap pixel */
 | 
			
		||||
static const unsigned int systraypinning = 0;   /* 0: sloppy systray follows selected monitor, >0: pin systray to monitor X */
 | 
			
		||||
static const unsigned int systrayspacing = 2;   /* systray spacing */
 | 
			
		||||
static const int systraypinningfailfirst = 1;   /* 1: if pinning fails, display systray on the first monitor, False: display systray on the last monitor*/
 | 
			
		||||
static const int showsystray        = 1;     	/* 0 means no systray */
 | 
			
		||||
static const int showbar            = 1;        /* 0 means no bar */
 | 
			
		||||
static const int topbar             = 1;        /* 0 means bottom bar */
 | 
			
		||||
static const char *fonts[]          = { "NotoSans Nerd Font:size=10" };
 | 
			
		||||
static const char col_gray1[]       = "#282a36"; /* background color */
 | 
			
		||||
static const char col_gray2[]       = "#44475a"; /* inactive window border color */
 | 
			
		||||
static const char col_gray3[]       = "#f8f8f2"; /* font color */
 | 
			
		||||
static const char col_gray4[]       = "#282a36"; /* current tag and current window font color */
 | 
			
		||||
static const char col_cyan[]        = "#bd93f9"; /* Top bar second color and active window border color */
 | 
			
		||||
static const char *colors[][3]      = {
 | 
			
		||||
	/*               fg         bg         border   */
 | 
			
		||||
	[SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
 | 
			
		||||
	[SchemeSel]  = { col_gray4, col_cyan,  col_cyan  },
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/* tagging */
 | 
			
		||||
static const char *tags[] = { " ₁", "龎 ₂", " ₃", " ₄", "爵 ₅", " ₆", " ₇", " ₈", " ₉" };
 | 
			
		||||
 | 
			
		||||
static const Rule rules[] = {
 | 
			
		||||
	/* xprop(1):
 | 
			
		||||
	 *	WM_CLASS(STRING) = instance, class
 | 
			
		||||
	 *	WM_NAME(STRING) = title
 | 
			
		||||
	 */
 | 
			
		||||
	/* class      instance    title       tags mask     isfloating   monitor */
 | 
			
		||||
	{ "origin",	  NULL,		  NULL,		  0,			1,			 -1 },
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/* layout(s) */
 | 
			
		||||
static const float mfact     = 0.55; /* factor of master area size [0.05..0.95] */
 | 
			
		||||
static const int nmaster     = 1;    /* number of clients in master area */
 | 
			
		||||
static const int resizehints = 1;    /* 1 means respect size hints in tiled resizals */
 | 
			
		||||
 | 
			
		||||
#include "layouts.c"
 | 
			
		||||
static const Layout layouts[] = {
 | 
			
		||||
	/* symbol     arrange function */
 | 
			
		||||
	{ "[]=",      tile },    /* first entry is default */
 | 
			
		||||
	{ "><>",      NULL },    /* no layout function means floating behavior */
 | 
			
		||||
	{ "[M]",      monocle },
 | 
			
		||||
	{ "|M|",      centeredmaster },
 | 
			
		||||
	{ ">M>",      centeredfloatingmaster },
 | 
			
		||||
	{ "HHH",      grid },
 | 
			
		||||
	{ NULL,       NULL },
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/* key definitions */
 | 
			
		||||
#define MODKEY Mod4Mask		/* Mod1Mask = Alt, Mod4Mask = Super */
 | 
			
		||||
#define TAGKEYS(KEY,TAG) \
 | 
			
		||||
	{ MODKEY,                       KEY,      comboview,      {.ui = 1 << TAG} }, \
 | 
			
		||||
	{ MODKEY|ControlMask,           KEY,      toggleview,     {.ui = 1 << TAG} }, \
 | 
			
		||||
	{ MODKEY|ShiftMask,             KEY,      combotag,       {.ui = 1 << TAG} }, \
 | 
			
		||||
	{ MODKEY|ControlMask|ShiftMask, KEY,      toggletag,      {.ui = 1 << TAG} },
 | 
			
		||||
 | 
			
		||||
/* helper for spawning shell commands in the pre dwm-5.0 fashion */
 | 
			
		||||
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
 | 
			
		||||
 | 
			
		||||
/* configuration parameters */
 | 
			
		||||
static const char rootdir[] = "/home/sravan/.config"; /* Location of dwm source code */
 | 
			
		||||
 | 
			
		||||
/* commands */
 | 
			
		||||
static const char *rofiruncmd[]			= { "rofi", "-show", "drun",	  NULL };
 | 
			
		||||
static const char *roficlipcmd[]		= { "rofi", "-show", "clipboard", NULL };
 | 
			
		||||
static const char *lockcmd[]			= { "light-locker-command", "--lock",  NULL };
 | 
			
		||||
static const char *sleepcmd[]			= { "systemctl",			"suspend", NULL };
 | 
			
		||||
static const char *termcmd[]			= { "alacritty", NULL };
 | 
			
		||||
static const char *upvolcmd[]			= { "/usr/bin/pactl", "set-sink-volume", "@DEFAULT_SINK@", "+1%",     NULL };
 | 
			
		||||
static const char *downvolcmd[]			= { "/usr/bin/pactl", "set-sink-volume", "@DEFAULT_SINK@", "-1%",     NULL };
 | 
			
		||||
static const char *mutevolcmd[]			= { "/usr/bin/pactl", "set-sink-mute",   "@DEFAULT_SINK@", "toggle",  NULL };
 | 
			
		||||
static const char *brightness_up[]		= { "xbacklight", "-inc", "1", NULL };
 | 
			
		||||
static const char *brightness_down[]	= { "xbacklight", "-dec", "1", NULL };
 | 
			
		||||
static const char *playerplaypausecmd[]	= { "playerctl", "--player=playerctld", "play-pause", NULL };
 | 
			
		||||
static const char *playernextcmd[]		= { "playerctl", "--player=playerctld", "next", 	  NULL };
 | 
			
		||||
static const char *playerprevcmd[]		= { "playerctl", "--player=playerctld", "previous",   NULL };
 | 
			
		||||
static const char *flameshotcmd[]		= { "flameshot", "gui",	NULL };
 | 
			
		||||
 | 
			
		||||
/* key definitions */
 | 
			
		||||
static Key keys[] = {
 | 
			
		||||
	/* modifier						key							function		argument */
 | 
			
		||||
	{ MODKEY,						XK_p,						spawn,          {.v = rofiruncmd} },
 | 
			
		||||
	{ MODKEY,						XK_c,						spawn,          {.v = roficlipcmd} },
 | 
			
		||||
	{ MODKEY|ShiftMask,				XK_l,						spawn,          {.v = lockcmd} },
 | 
			
		||||
	{ MODKEY|ShiftMask,				XK_s,						spawn,          {.v = sleepcmd} },
 | 
			
		||||
	{ MODKEY|ShiftMask,				XK_Return,					spawn,          {.v = termcmd} },
 | 
			
		||||
	{ MODKEY,           			XK_b,      					togglebar,      {0} },
 | 
			
		||||
	{ MODKEY,           			XK_j,      					focusstack,     {.i = +1} },
 | 
			
		||||
	{ MODKEY,           			XK_k,      					focusstack,     {.i = -1} },
 | 
			
		||||
	{ MODKEY,           			XK_i,      					incnmaster,     {.i = +1} },
 | 
			
		||||
	{ MODKEY,           			XK_d,      					incnmaster,     {.i = -1} },
 | 
			
		||||
	{ MODKEY,           			XK_h,						setmfact,       {.f = -0.05} },
 | 
			
		||||
	{ MODKEY,           			XK_l,						setmfact,       {.f = +0.05} },
 | 
			
		||||
	{ MODKEY|ShiftMask,				XK_j,						movestack,      {.i = +1} },
 | 
			
		||||
	{ MODKEY|ShiftMask,				XK_k,						movestack,      {.i = -1} },
 | 
			
		||||
	{ MODKEY,           			XK_Return,					zoom,           {0} },
 | 
			
		||||
	{ MODKEY,           			XK_Tab,						view,           {0} },
 | 
			
		||||
	{ MODKEY|ShiftMask, 			XK_c,						killclient,     {0} },
 | 
			
		||||
	{ MODKEY,           			XK_t,						setlayout,      {.v = &layouts[0]} },
 | 
			
		||||
	{ MODKEY,           			XK_f,						setlayout,      {.v = &layouts[1]} },
 | 
			
		||||
	{ MODKEY,           			XK_m,						setlayout,      {.v = &layouts[2]} },
 | 
			
		||||
	{ MODKEY,						XK_u,						setlayout,		{.v = &layouts[3]} },
 | 
			
		||||
	{ MODKEY,						XK_o,						setlayout,		{.v = &layouts[4]} },
 | 
			
		||||
	{ MODKEY,						XK_g,						setlayout,		{.v = &layouts[5]} },
 | 
			
		||||
	{ MODKEY|ControlMask,			XK_comma,					cyclelayout,	{.i = -1 } },
 | 
			
		||||
	{ MODKEY|ControlMask,			XK_period,					cyclelayout,	{.i = +1 } },
 | 
			
		||||
	{ MODKEY,           			XK_space,					setlayout,      {0} },
 | 
			
		||||
	{ MODKEY|ShiftMask, 			XK_space,					togglefloating, {0} },
 | 
			
		||||
	{ MODKEY,           			XK_0,						view,           {.ui = ~0} },
 | 
			
		||||
	{ MODKEY|ShiftMask, 			XK_0,						tag,            {.ui = ~0} },
 | 
			
		||||
	{ MODKEY,           			XK_comma,					focusmon,       {.i = -1} },
 | 
			
		||||
	{ MODKEY,           			XK_period,					focusmon,       {.i = +1} },
 | 
			
		||||
	{ MODKEY|ShiftMask, 			XK_comma,					tagmon,         {.i = -1} },
 | 
			
		||||
	{ MODKEY|ShiftMask, 			XK_period, 					tagmon,         {.i = +1} },
 | 
			
		||||
	{ MODKEY,						XK_minus,					setgaps,        {.i = -5 } },
 | 
			
		||||
	{ MODKEY,						XK_equal,					setgaps,        {.i = +5 } },
 | 
			
		||||
	{ MODKEY|ShiftMask,				XK_equal,					setgaps,        {.i = 0  } },
 | 
			
		||||
	{ 0,							XF86XK_AudioLowerVolume,	spawn,			{.v = downvolcmd} },
 | 
			
		||||
	{ 0,                			XF86XK_AudioMute,			spawn,			{.v = mutevolcmd} },
 | 
			
		||||
	{ 0,                			XF86XK_AudioRaiseVolume,	spawn,			{.v = upvolcmd} },
 | 
			
		||||
	{ 0, 							XF86XK_MonBrightnessUp,		spawn,			{.v = brightness_up} },
 | 
			
		||||
	{ 0, 							XF86XK_MonBrightnessDown,	spawn,			{.v = brightness_down} },
 | 
			
		||||
	{ 0,							XF86XK_AudioPlay,			spawn,			{.v = playerplaypausecmd} },
 | 
			
		||||
	{ 0,							XF86XK_AudioNext,			spawn,			{.v = playernextcmd} },
 | 
			
		||||
	{ 0,							XF86XK_AudioPrev,			spawn,			{.v = playerprevcmd} },
 | 
			
		||||
	{ 0,							XK_Print,					spawn,			{.v = flameshotcmd} },
 | 
			
		||||
	TAGKEYS(            			XK_1,                      					0)
 | 
			
		||||
	TAGKEYS(            			XK_2,                      					1)
 | 
			
		||||
	TAGKEYS(            			XK_3,                      					2)
 | 
			
		||||
	TAGKEYS(            			XK_4,                      					3)
 | 
			
		||||
	TAGKEYS(            			XK_5,                      					4)
 | 
			
		||||
	TAGKEYS(            			XK_6,                      					5)
 | 
			
		||||
	TAGKEYS(            			XK_7,                      					6)
 | 
			
		||||
	TAGKEYS(            			XK_8,                      					7)
 | 
			
		||||
	TAGKEYS(            			XK_9,                      					8)
 | 
			
		||||
	{ MODKEY|ShiftMask, 			XK_q,      					quit,			{0} },
 | 
			
		||||
	{ MODKEY|ControlMask|ShiftMask,	XK_q,      					quit,           {1} },
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/* button definitions */
 | 
			
		||||
/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
 | 
			
		||||
static Button buttons[] = {
 | 
			
		||||
	/* click                event mask      button          function        argument */
 | 
			
		||||
	{ ClkLtSymbol,          0,              Button1,        setlayout,      {0} },
 | 
			
		||||
	{ ClkLtSymbol,          0,              Button3,        setlayout,      {.v = &layouts[2]} },
 | 
			
		||||
	{ ClkWinTitle,          0,              Button2,        zoom,           {0} },
 | 
			
		||||
	{ ClkStatusText,        0,              Button2,        spawn,          {.v = termcmd } },
 | 
			
		||||
	{ ClkClientWin,         MODKEY,         Button1,        movemouse,      {0} },
 | 
			
		||||
	{ ClkClientWin,         MODKEY,         Button2,        togglefloating, {0} },
 | 
			
		||||
	{ ClkClientWin,         MODKEY,         Button3,        resizemouse,    {0} },
 | 
			
		||||
	{ ClkTagBar,            0,              Button1,        view,           {0} },
 | 
			
		||||
	{ ClkTagBar,            0,              Button3,        toggleview,     {0} },
 | 
			
		||||
	{ ClkTagBar,            MODKEY,         Button1,        tag,            {0} },
 | 
			
		||||
	{ ClkTagBar,            MODKEY,         Button3,        toggletag,      {0} },
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										73
									
								
								dwm.1
									
									
									
									
									
								
							
							
						
						
									
										73
									
								
								dwm.1
									
									
									
									
									
								
							@@ -30,6 +30,14 @@ top left corner.  The tags which are applied to one or more windows are
 | 
			
		||||
indicated with an empty square in the top left corner.
 | 
			
		||||
.P
 | 
			
		||||
dwm draws a small border around windows to indicate the focus state.
 | 
			
		||||
.P
 | 
			
		||||
On start, dwm can start additional programs that may be specified in two special
 | 
			
		||||
shell scripts (see the FILES section below), autostart_blocking.sh and
 | 
			
		||||
autostart.sh.  The former is executed first and dwm will wait for its
 | 
			
		||||
termination before starting.  The latter is executed in the background before
 | 
			
		||||
dwm enters its handler loop.
 | 
			
		||||
.P
 | 
			
		||||
Either of these files may be omitted.
 | 
			
		||||
.SH OPTIONS
 | 
			
		||||
.TP
 | 
			
		||||
.B \-v
 | 
			
		||||
@@ -62,9 +70,24 @@ Start
 | 
			
		||||
.TP
 | 
			
		||||
.B Mod1\-p
 | 
			
		||||
Spawn
 | 
			
		||||
.BR dmenu(1)
 | 
			
		||||
.BR rofi(1)
 | 
			
		||||
for launching other programs.
 | 
			
		||||
.TP
 | 
			
		||||
.B Mod1\-c
 | 
			
		||||
Spawn
 | 
			
		||||
.BR rofi(1)
 | 
			
		||||
for Greenclip clipboard manager
 | 
			
		||||
.TP
 | 
			
		||||
.B Mod1\-Shift\-n
 | 
			
		||||
Spawn
 | 
			
		||||
.BR light-locker(1)
 | 
			
		||||
to lock screen.
 | 
			
		||||
.TP
 | 
			
		||||
.B Mod1\-Shift\-s
 | 
			
		||||
Spawn
 | 
			
		||||
.BR suspend(1)
 | 
			
		||||
to lock screen and go to sleep.
 | 
			
		||||
.TP
 | 
			
		||||
.B Mod1\-,
 | 
			
		||||
Focus previous screen, if any.
 | 
			
		||||
.TP
 | 
			
		||||
@@ -77,6 +100,15 @@ Send focused window to previous screen, if any.
 | 
			
		||||
.B Mod1\-Shift\-.
 | 
			
		||||
Send focused window to next screen, if any.
 | 
			
		||||
.TP
 | 
			
		||||
.B Mod1\--
 | 
			
		||||
Decrease window gap.
 | 
			
		||||
.TP
 | 
			
		||||
.B Mod1\-=
 | 
			
		||||
Increase window gap.
 | 
			
		||||
.TP
 | 
			
		||||
.B Mod1\-Shift\-=
 | 
			
		||||
Reset window gap to 0.
 | 
			
		||||
.TP
 | 
			
		||||
.B Mod1\-b
 | 
			
		||||
Toggles bar on and off.
 | 
			
		||||
.TP
 | 
			
		||||
@@ -89,9 +121,24 @@ Sets floating layout.
 | 
			
		||||
.B Mod1\-m
 | 
			
		||||
Sets monocle layout.
 | 
			
		||||
.TP
 | 
			
		||||
.B Mod1\-u
 | 
			
		||||
Sets centered master layout.
 | 
			
		||||
.TP
 | 
			
		||||
.B Mod1\-o
 | 
			
		||||
Sets centered floating master layout.
 | 
			
		||||
.TP
 | 
			
		||||
.B Mod1\-g
 | 
			
		||||
Sets grid layout.
 | 
			
		||||
.TP
 | 
			
		||||
.B Mod1\-space
 | 
			
		||||
Toggles between current and previous layout.
 | 
			
		||||
.TP
 | 
			
		||||
.B Mod1\-Control\-,
 | 
			
		||||
Cycles backwards in layout list.
 | 
			
		||||
.TP
 | 
			
		||||
.B Mod1\-Control\-.
 | 
			
		||||
Cycles forwards in layout list.
 | 
			
		||||
.TP
 | 
			
		||||
.B Mod1\-j
 | 
			
		||||
Focus next window.
 | 
			
		||||
.TP
 | 
			
		||||
@@ -142,6 +189,9 @@ Add/remove all windows with nth tag to/from the view.
 | 
			
		||||
.TP
 | 
			
		||||
.B Mod1\-Shift\-q
 | 
			
		||||
Quit dwm.
 | 
			
		||||
.TP
 | 
			
		||||
.B Mod1\-Control\-Shift\-q
 | 
			
		||||
Restart dwm.
 | 
			
		||||
.SS Mouse commands
 | 
			
		||||
.TP
 | 
			
		||||
.B Mod1\-Button1
 | 
			
		||||
@@ -152,11 +202,30 @@ Toggles focused window between floating and tiled state.
 | 
			
		||||
.TP
 | 
			
		||||
.B Mod1\-Button3
 | 
			
		||||
Resize focused window while dragging. Tiled windows will be toggled to the floating state.
 | 
			
		||||
.SH FILES
 | 
			
		||||
The files containing programs to be started along with dwm are searched for in
 | 
			
		||||
the dwm root directory.
 | 
			
		||||
.P
 | 
			
		||||
The first existing directory is scanned for any of the autostart files below.
 | 
			
		||||
.TP 15
 | 
			
		||||
autostart.sh
 | 
			
		||||
This file is started as a shell background process before dwm enters its handler
 | 
			
		||||
loop.
 | 
			
		||||
.TP 15
 | 
			
		||||
autostart_blocking.sh
 | 
			
		||||
This file is started before any autostart.sh; dwm waits for its termination.
 | 
			
		||||
.SH CUSTOMIZATION
 | 
			
		||||
dwm is customized by creating a custom config.h and (re)compiling the source
 | 
			
		||||
code. This keeps it fast, secure and simple.
 | 
			
		||||
.SH SIGNALS
 | 
			
		||||
.TP
 | 
			
		||||
.B SIGHUP - 1
 | 
			
		||||
Restart the dwm process.
 | 
			
		||||
.TP
 | 
			
		||||
.B SIGTERM - 15
 | 
			
		||||
Cleanly terminate the dwm process.
 | 
			
		||||
.SH SEE ALSO
 | 
			
		||||
.BR dmenu (1),
 | 
			
		||||
.BR rofi (1),
 | 
			
		||||
.BR st (1)
 | 
			
		||||
.SH ISSUES
 | 
			
		||||
Java applications which use the XToolkit/XAWT backend may draw grey windows
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										27
									
								
								layouts.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								layouts.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,27 @@
 | 
			
		||||
void
 | 
			
		||||
grid(Monitor *m) {
 | 
			
		||||
	unsigned int i, n, cx, cy, cw, ch, aw, ah, cols, rows;
 | 
			
		||||
	Client *c;
 | 
			
		||||
 | 
			
		||||
	for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next))
 | 
			
		||||
		n++;
 | 
			
		||||
 | 
			
		||||
	/* grid dimensions */
 | 
			
		||||
	for(rows = 0; rows <= n/2; rows++)
 | 
			
		||||
		if(rows*rows >= n)
 | 
			
		||||
			break;
 | 
			
		||||
	cols = (rows && (rows - 1) * rows >= n) ? rows - 1 : rows;
 | 
			
		||||
 | 
			
		||||
	/* window geoms (cell height/width) */
 | 
			
		||||
	ch = m->wh / (rows ? rows : 1);
 | 
			
		||||
	cw = m->ww / (cols ? cols : 1);
 | 
			
		||||
	for(i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next)) {
 | 
			
		||||
		cx = m->wx + (i / rows) * cw;
 | 
			
		||||
		cy = m->wy + (i % rows) * ch;
 | 
			
		||||
		/* adjust height/width of last row/column's windows */
 | 
			
		||||
		ah = ((i + 1) % rows == 0) ? m->wh - ch * rows : 0;
 | 
			
		||||
		aw = (i >= rows * (cols - 1)) ? m->ww - cw * cols : 0;
 | 
			
		||||
		resize(c, cx, cy, cw - 2 * c->bw + aw, ch - 2 * c->bw + ah, False);
 | 
			
		||||
		i++;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										48
									
								
								movestack.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										48
									
								
								movestack.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,48 @@
 | 
			
		||||
void
 | 
			
		||||
movestack(const Arg *arg) {
 | 
			
		||||
	Client *c = NULL, *p = NULL, *pc = NULL, *i;
 | 
			
		||||
 | 
			
		||||
	if(arg->i > 0) {
 | 
			
		||||
		/* find the client after selmon->sel */
 | 
			
		||||
		for(c = selmon->sel->next; c && (!ISVISIBLE(c) || c->isfloating); c = c->next);
 | 
			
		||||
		if(!c)
 | 
			
		||||
			for(c = selmon->clients; c && (!ISVISIBLE(c) || c->isfloating); c = c->next);
 | 
			
		||||
 | 
			
		||||
	}
 | 
			
		||||
	else {
 | 
			
		||||
		/* find the client before selmon->sel */
 | 
			
		||||
		for(i = selmon->clients; i != selmon->sel; i = i->next)
 | 
			
		||||
			if(ISVISIBLE(i) && !i->isfloating)
 | 
			
		||||
				c = i;
 | 
			
		||||
		if(!c)
 | 
			
		||||
			for(; i; i = i->next)
 | 
			
		||||
				if(ISVISIBLE(i) && !i->isfloating)
 | 
			
		||||
					c = i;
 | 
			
		||||
	}
 | 
			
		||||
	/* find the client before selmon->sel and c */
 | 
			
		||||
	for(i = selmon->clients; i && (!p || !pc); i = i->next) {
 | 
			
		||||
		if(i->next == selmon->sel)
 | 
			
		||||
			p = i;
 | 
			
		||||
		if(i->next == c)
 | 
			
		||||
			pc = i;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/* swap c and selmon->sel selmon->clients in the selmon->clients list */
 | 
			
		||||
	if(c && c != selmon->sel) {
 | 
			
		||||
		Client *temp = selmon->sel->next==c?selmon->sel:selmon->sel->next;
 | 
			
		||||
		selmon->sel->next = c->next==selmon->sel?c:c->next;
 | 
			
		||||
		c->next = temp;
 | 
			
		||||
 | 
			
		||||
		if(p && p != c)
 | 
			
		||||
			p->next = c;
 | 
			
		||||
		if(pc && pc != selmon->sel)
 | 
			
		||||
			pc->next = selmon->sel;
 | 
			
		||||
 | 
			
		||||
		if(selmon->sel == selmon->clients)
 | 
			
		||||
			selmon->clients = c;
 | 
			
		||||
		else if(c == selmon->clients)
 | 
			
		||||
			selmon->clients = selmon->sel;
 | 
			
		||||
 | 
			
		||||
		arrange(selmon);
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user