Dwmac is an dwm-like tiling window manager for macOS
Project homepage: https://github.com/hillyu/Dwmac
![]()
Do you have a cool automatization, Dwmac integration, or workflow?
Feel free to open an issue or pull request to add it to this list!
The source code of the page can be found in the ./docs directory.
1. Move windows by dragging any part of the window
defaults write -g NSWindowShouldDragOnGesture -bool true
Now, you can move windows by holding ctrl + cmd and dragging any part of the window (not necessarily the window title)
2. Non-native fullscreen in Firefox
Change the following settings in about:config:
// Disable macOS native fullscreen in Firefox full-screen-api.macos-native-full-screen = false // Disable fullscreen transition animations full-screen-api.transition-duration.enter = 0 0 full-screen-api.transition-duration.leave = 0 0
full-screen-api.ignore-widgets is also an interesting config knob that might be of your preference.
3. Highlight focused windows with colored borders
To highlight the focused window with colored border you can use JankyBorders.
You can also use after-startup-command to start JankyBorders together with Dwmac
after-startup-command = [
# JankyBorders has a built-in detection of already running process,
# so it won't be run twice on Dwmac restart
'exec-and-forget borders active_color=0xffe1e3e4 inactive_color=0xff494d64 width=5.0'
]
4. Disable windows opening animations
Observable in Google Chrome
defaults write -g NSAutomaticWindowAnimationsEnabled -bool false
5. Show Dwmac workspaces in Sketchybar
You can integrate Dwmac workspace indicators with Sketchybar. Use these snippets as a starting point.
# Run Sketchybar together with Dwmac
# sketchybar has a built-in detection of already running process,
# so it won't be run twice on Dwmac restart
after-startup-command = ['exec-and-forget sketchybar']
# Notify Sketchybar about workspace change
exec-on-workspace-change = ['/bin/bash', '-c',
'sketchybar --trigger dwmac_workspace_change FOCUSED_WORKSPACE=$DWMAC_FOCUSED_WORKSPACE'
]
sketchybar --add event dwmac_workspace_change
for sid in $(dwmac list-workspaces --all); do
sketchybar --add item space.$sid left \
--subscribe space.$sid dwmac_workspace_change \
--set space.$sid \
background.color=0x44ffffff \
background.corner_radius=5 \
background.height=20 \
background.drawing=off \
label="$sid" \
click_script="dwmac workspace $sid" \
script="$CONFIG_DIR/plugins/dwmac.sh $sid"
done
#!/usr/bin/env bash
# make sure it's executable with:
# chmod +x ~/.config/sketchybar/plugins/dwmac.sh
if [ "$1" = "$FOCUSED_WORKSPACE" ]; then
sketchybar --set $NAME background.drawing=on
else
sketchybar --set $NAME background.drawing=off
fi
6. Show Dwmac workspaces in simple-bar
simple-bar can be used to display Dwmac workspaces.
In order to sync simple-bar with Dwmac, add these lines to your Dwmac config file:
# Notify simple-bar about window focus change
on-focus-changed = [
"exec-and-forget osascript -e 'tell application id \"tracesOf.Uebersicht\" to refresh widget id \"simple-bar-index-jsx\"'",
]
# Notify simple-bar about workspace change
exec-on-workspace-change = [
'/bin/zsh',
'-c',
'/usr/bin/osascript -e "tell application id \"tracesOf.Uebersicht\" to refresh widget id \"simple-bar-index-jsx\""',
]
7. Open a new window with AppleScript
Invoking Safari/Terminal with a command the obvious way (exec-and-forget open -a Safari) results in an outcome that is probably not the intended one.
Namely, that any workspace already containing an instance of Safari/Terminal is brought in focus.
Opening a new window of a program that can support multiple windows (such as Safari or Terminal.app) can be accomplished with an AppleScript inlined in dwmac.toml as follows:
-
Safari
ctrl-g = '''exec-and-forget osascript -e ' tell application "Safari" make new document at end of documents activate end tell' ''' -
Terminal
ctrl-g = '''exec-and-forget osascript -e ' tell application "Terminal" do script activate end tell' '''
8. Disable annoying and useless "hide application" shortcut
If automatically-unhide-macos-hidden-apps isn’t enough, you can disable cmd-h altogether (which will make this hotkey unavailable for apps that might use it for other purposes)
[mode.main.binding]
cmd-h = [] # Disable "hide application"
cmd-alt-h = [] # Disable "hide others"
9. Take screenshots to clipboard using keyboard shortcut
You can configure a custom shortcut to take a screenshot.
screencapture is a built-in macOS command.
alt-shift-s = 'exec-and-forget screencapture -i -c'
10. List of Apple application IDs
The list is useful to compose custom on-window-detected callback.
| Application name | Application ID |
|---|---|
Activity Monitor |
|
AirPort Utility |
|
App Store |
|
Audio MIDI Setup |
|
Automator |
|
Books |
|
Calculator |
|
Calendar |
|
Chess |
|
Clock |
|
ColorSync Utility |
|
Console |
|
Contacts |
|
Dictionary |
|
Disk Utility |
|
FaceTime |
|
Find My |
|
Finder |
|
Freeform |
|
Grapher |
|
Home |
|
iMovie |
|
Keychain Access |
|
Keynote |
|
|
|
Maps |
|
Messages |
|
Music |
|
Notes |
|
Pages |
|
Photo Booth |
|
Photos |
|
Podcasts |
|
Preview |
|
QuickTime Player |
|
Reminders |
|
Safari |
|
Shortcuts |
|
Stocks |
|
System Settings |
|
Terminal |
|
TextEdit |
|
Time Machine |
|
TV |
|
VoiceMemos |
|
VoiceOver Utility |
|
Weather |
|
Xcode |
|