Compare commits

...

43 Commits

Author SHA1 Message Date
Sravan Balaji
af632efafb Parameter Adjustments
- Increase gap between windows to 15 pixels
- Decrease snap pixel to 10
- Make inactive window border color darker so active window is easier to distinguish
- Remove rules for GIMP and Firefox
2020-11-19 09:20:12 -05:00
Sravan Balaji
5130e64014 Replace deadd with xfce notifications
- Replace autostart and quit commands
- Remove deadd notification center script & keybinding
- Update man page
2020-11-06 21:02:41 -05:00
Sravan Balaji
48b71050ab Origin Floating Window
- Add rule to make origin open in a floating window
2020-11-06 21:02:41 -05:00
Sravan Balaji
c959e1cb58 Redshift Restart Fix
- Add redshift reset mode to autostart
- Move redshift-gtk to system tray application section of autoquit
- Add kill redshift background process to autoquit
2020-11-06 21:02:41 -05:00
Sravan Balaji
10b140adff Backlight Control
- Add support for brightness buttons to control screen brightness
- Update readme with link to acpilight
2020-11-06 21:02:41 -05:00
Sravan Balaji
fde880858a NVIDIA Optimus Manager
- Add optimus-manager-qt to autostart and autoquit scripts
2020-11-06 21:02:41 -05:00
Sravan Balaji
e896c3107e restartsig patch
- Apply restartsig patch
- Add keybinding for restarting dwm
- Update man page with keybinding
- Update README with patch link
2020-11-06 21:02:41 -05:00
Sravan Balaji
e7ece2aaba Autoquit Script & Autostart Consolidation
- Create autoquit script to end all autostarted processes on quit
- Move process from autostart_blocking to autostart
- Fix missing "\" in autostart
- Add runautoquit function to dwm.c
- Call runautoquit after run exits in dwm.c main
2020-11-06 21:02:41 -05:00
Sravan Balaji
7d5b1b38a2 cyclelayouts patch
- Apply cyclelayouts patch
- Add patch link to README
- Add new layout cycling keybindings to man page
2020-11-06 21:02:41 -05:00
Sravan Balaji
bfa185fac4 gridmode patch
- Apply gridmode patch
- Add patch link to README
- Add new layout keybinding to man page
2020-11-06 21:02:41 -05:00
Sravan Balaji
36e11cc61c centeredmaster patch
- Apply centeredmaster patch
- Add patch link to README
- Add new layout keybindings to man page
2020-11-06 21:02:41 -05:00
Sravan Balaji
3047114a1f ru_gaps Patch
- Add ru_gaps patch
- Increase border size to 3 pixels
- Set default gap size to 10 pixels
- Update README to include ru_gaps patch link & modifications
- Update man page to include keybindings for ru_gaps
2020-11-06 21:02:41 -05:00
Sravan Balaji
81f908b5c6 Screen Layout & Rclone fix
- Add screen layout script to autostart_blocking
- Fix rclone command in autostart
2020-11-06 21:02:41 -05:00
Sravan Balaji
795f7d0011 Fix Picom Not Starting
- Fix picom config path in autostart
2020-11-06 21:02:41 -05:00
Sravan Balaji
99a906d9e3 Flameshot Autostart & Shortcut
- Add flameshot to autostart script
- Bind print screen button to open flameshot gui
2020-11-06 21:02:41 -05:00
Sravan Balaji
8fe17768f7 Nerd Font, Icons, & Size Changes
- Change font to NotoSans Nerd Font
- Change font size to 10
- Change tag icons and add subscript numbers
2020-11-06 21:02:40 -05:00
Sravan Balaji
bd69540724 Switch from slock to LightDM
- Add background process for light-locker
- lockcmd uses light-locker-command
- sleepcmd uses systemctl suspend
2020-11-06 21:02:40 -05:00
Sravan Balaji
e4457dd31e Media Control
- Bind media track keys to control playerctl for play/pause, next, prev
- Update README with volume and media control
2020-11-06 21:02:40 -05:00
Sravan Balaji
5e3c442a2f Volume Control
- Bind volume control keys to control PuseAudio volume
2020-11-06 21:02:40 -05:00
Sravan Balaji
b788a08745 README Update
- Add list of personal modifications
2020-11-06 21:02:40 -05:00
Sravan Balaji
e9c7ebcddc slstatus
- Add slstatus to background processes to autostart
2020-11-06 21:02:40 -05:00
Sravan Balaji
699c83b6ff GNOME Polkit Authentication Agent
- Add startup background process for polkit agent
2020-11-06 21:02:40 -05:00
Sravan Balaji
5015cfc93b Merge All Autostart Applications & Blocking Processes into Master
- Ignore applications if they don't exist rather than having separate branches for desktop and laptop
- Re-organize scripts to define arrays and run applications with for loops
2020-11-06 21:02:40 -05:00
Sravan Balaji
485c40d5f9 Lock Screen & Sleep Shortcuts
- Add keybinding to lock screen with slock
- Add keybinding to lock screen and go to sleep with slock
2020-11-06 21:02:40 -05:00
Sravan Balaji
41958715d4 Apply movestack patch
- Add keybinds to switch window between master and slaves
- Add movestack.c
2020-11-06 21:02:40 -05:00
Sravan Balaji
5ac75bb689 deadd notification center shortcut
- Add shorcut for opening deadd notification center via bash script
2020-11-06 21:02:40 -05:00
Sravan Balaji
a60b1c5d2f Rofi Launcher w/ Greenclip Manager
- Add greenclip daemon to autostart
- Add background processes section to autostart
- Remove references to dmenu
- Add rofi run and clipboard shortcuts
- Update man page to reference rofi instead of dmenu
2020-11-06 21:02:40 -05:00
Sravan Balaji
0f49dbddfb Combo Tag & View Patches
- Add combo tag & view patch
- Change tag and view functions to combotag and comboview in config.h
2020-11-06 21:02:40 -05:00
Sravan Balaji
d194f2c726 KDE Connect
- Add KDE Connect system tray indicator to autostart
2020-11-06 21:02:40 -05:00
Sravan Balaji
2769ef11ad Redshift Tray Icon
- Move redshift from autostart_blocking to autostart
- Use redshift-gtk instead of redshift to get a tray icon
2020-11-06 21:02:40 -05:00
Sravan Balaji
8faf64215e Add Deadd Autostart
- Add deadd notification center to autostart
2020-11-06 21:02:40 -05:00
Sravan Balaji
c2fa943e86 Add Network Manager Autostart
- Add network manager applet to autostart
2020-11-06 21:02:40 -05:00
Sravan Balaji
eaf997ee88 Add Blueman Autostart
- Add Blueman tray application to autostart
2020-11-06 21:02:40 -05:00
Sravan Balaji
d0b1d46ed4 Autostart Background Fix
- Run autostart programs in background
- Add Nyrna to autostart
- Move system tray startup applications to top of autostart script
2020-11-06 21:02:40 -05:00
Sravan Balaji
4134edfc38 Startup Application
- Remove extra empty line from autostart_blocking.sh
- Add PulseAudio volume control as startup application
2020-11-06 21:02:40 -05:00
Sravan Balaji
5315d6ae96 Systemtray Patch
- Add system tray patch
2020-11-06 21:02:38 -05:00
Sravan Balaji
0a4ab3b407 Move rclone out of autostart_blocking
- Put rclone sync in autostart so dwm isn't prevented from starting
2020-11-06 21:01:45 -05:00
Sravan Balaji
cc1f6ffbc2 Specify Autostart Location, README & LICENSE updates, and Add config.h
- Remove config.h from gitignore
- Move config.def.h modifications to config.h
- Restore config.def.h to original version
- Specify location of autostart instead of searching certain locations
- Rename autostart.sh to autostart_blocking.sh
- Add myself to license
- Change README to markdown and add personal changes
2020-11-06 21:01:45 -05:00
Sravan Balaji
8531dc3158 Autostart Patch w/ Modifications
- Add autostart patch
- Include config directory in autostart search dirs
- Sync cloud drives
- Start compositor
- Restore wallpaper
- Start redshift for blue light filtering
2020-11-06 21:01:45 -05:00
Sravan Balaji
ab1c6e3d00 Increase Font & Replace Icons
- Change font size to 12
- Replace music icon with podcast and spotify icons
- Remove infinity icon
2020-11-06 21:01:45 -05:00
Sravan Balaji
84d1b45060 Font Size & Color Changes
- Change font sizes to 10
- Change active font color to background for contrast with accent color
2020-11-06 21:01:45 -05:00
Sravan Balaji
96163849d6 Dracula Theme & Icons
- Change border size to 2 pixels
- Add font awesome
- Change colors to follow dracula theme
- Add unicode icons for tags
2020-11-06 21:01:45 -05:00
Sravan Balaji
cbf3a73d72 gitignore & config changes
- Add gitignore for vscode folder, dwm executable, output files, and config.h
- Change mod key to super key
- Change terminal from st to alacritty
2020-11-06 21:01:45 -05:00
11 changed files with 1219 additions and 91 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
.vscode/
*.o
dwm

View File

@ -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
View File

@ -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
View 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
View 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
View 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
View 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
View File

@ -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

752
dwm.c

File diff suppressed because it is too large Load Diff

27
layouts.c Normal file
View 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
View 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);
}
}