System - bakkeby/dusk GitHub Wiki

There are a few topics that fall outside of window management which are often left to alternative software to handle.

In this section we are looking at options like auto starting programs, application launchers, context menus, desktop icons, dock applications, screen locking, exiting or restarting the window manager and more.

Startup

It can be desirable to launch certain programs automatically alongside the window manager when it starts up.

Scripts and programs can be started in the background by adding them to your ~/.xinitrc file if you use startx to initialise your window manager.

If you use a login manager then you can start such programs in your ~/.xsession or ~/.xprofile file.

Note that starting a compositor this way can interfere with desktop environments that provide their own compositor, for example Gnome or KDE. If you are using a login manager and want to keep such desktop environments as a login option then avoid starting a compositor in these files.

Alternatively programs can also be configured to start automatically with the window manager via the autostart configuration options.

Launcher

The default launcher for the window manager is dmenu which needs to be cloned, compiled and installed separately.

The default keybinding to launch dmenu is Super+d.

rofi is an alternative to dmenu.

Terminal

The default terminal for the window manager is st which needs to be cloned, compiled and installed separately.

The default keybinding to launch a terminal is Super+enter (return).

The default terminal can be changed by altering this spawn command in config.h.

static const char *termcmd[]  = { NULL, "st", NULL };

Context Menus

The window manager does not come with any special integration with regards to context menus like the awesome window manager is known for.

External context menu tools can be used, however, and xmenu is one option.

xmenu.jpg

Opening a context menu when clicking on the desktop (i.e the root window) can be done in two ways.

1) via xclickroot

Clone, compile and install then run:

$ xclickroot -3 /path/to/rootmenu.sh

or

2) by adding keybindings within the window manager configuration

This is done by registering button bindings for clicks on the root window.

static const char *rootmenu[] = { NULL, "/path/to/rootmenu.sh", NULL };

static Button buttons[] = {
	/* click                     event mask               button          function          argument */
	...
	{ ClkRootWin,                0,                       Button3,        spawn,            {.v = rootmenu } },
	...

You may also want to have a look at pmenu which provides a pie-chart like menu.

Example context menu scripts can be found under the dusk.resources repository.

Desktop Icons

It is possible to have icons on the desktop like some desktop environments do. In practice this is just an application that runs beneath all other windows.

Programs that indicate the window type of "desktop" are by default not managed by the window manager.

Dock

If you want to run a dock like Docky, Plank Dock or Cairo Dock then you are free to do so. Programs that indicate the window type of "dock" are by default not managed by the window manager.

If you do run a dock then you may want to change the bar rules to not draw a second bar on the monitor.

While it is possible to run external bars such as polybar or lemonbar there is no special integration in dusk to make these work properly. If you prefer an external bar over the integrated one then consider looking into building your own dwm from scratch using the IPC and anybar patches.

Systray

The window manager comes with a built-in systray which can be disabled if need be.

It is also possible to use standalone systray applications like stalonetray if that is preferable.

Screen Locking

The window manager does not come with any built-in screen locking integration or features.

There are several standalone options out there to handle this and slock is one of them.

This can either be triggered manually or automatically using tools like xautolock.

Here is an example invocation that can be added to ~/.xinitrc, ~/.xsession or ~/xprofile depending on how you start your window manager:

if [ $(command -v slock) ] && [ $(command -v xautolock) ]; then
    xautolock -time 10 -locker slock &
fi

If a blurred background is desirable for the screen locking then this is best left for a compositor to handle.

Here is an example screenshot of slock running with picom utilising dual kawase blur:

slock_kawase.jpg

Alternatively if using slock with the dwm logo patch then here are two optional rectangle arrays to draw "DUSK", one being wider than the other.

Narrow:

static XRectangle rectangles[] = {
   /* x   y   w   h */
   {  0,  0,  1,  5 }, // D
   {  1,  0,  1,  1 }, // D
   {  1,  4,  1,  1 }, // D
   {  2,  1,  1,  3 }, // D
   {  4,  0,  1,  5 }, // U
   {  5,  4,  1,  1 }, // U
   {  6,  0,  1,  5 }, // U
   {  8,  0,  3,  1 }, // S
   {  8,  0,  1,  2 }, // S
   {  8,  2,  3,  1 }, // S
   { 10,  2,  1,  2 }, // S
   {  8,  4,  3,  1 }, // S
   { 12,  0,  1,  5 }, // K
   { 13,  2,  1,  1 }, // K
   { 14,  3,  1,  2 }, // K
   { 14,  0,  1,  2 }, // K
};

Wide:

static XRectangle rectangles[] = {
   /* x   y   w   h */
   {  0,  0,  1,  5 }, // D
   {  1,  0,  2,  1 }, // D
   {  1,  4,  2,  1 }, // D
   {  3,  1,  1,  3 }, // D
   {  5,  0,  1,  4 }, // U
   {  6,  4,  2,  1 }, // U
   {  8,  0,  1,  4 }, // U
   { 10,  0,  4,  1 }, // S
   { 13,  3,  1,  1 }, // S
   { 10,  1,  1,  2 }, // S
   { 11,  2,  3,  1 }, // S
   { 10,  4,  4,  1 }, // S
   { 15,  0,  1,  5 }, // K
   { 16,  2,  1,  1 }, // K
   { 17,  1,  1,  1 }, // K
   { 18,  0,  1,  1 }, // K
   { 17,  3,  1,  1 }, // K
   { 18,  4,  1,  1 }, // K
};

Also see:

Auto-hiding of mouse cursor

Similar to what xban and xbanish offers dusk can also auto-hide the mouse cursor when the keyboard is used.

Refer to the BanishMouseCursor functionality for more details.

Compositor

A compositor handles transparency of windows and other effects like shadows.

Typical options include:

Compositor Description
xcompmgr A basic, light weight and stable compositor
compton Predecessor to picom, no longer maintained
picom A feature rich compositor with many configuration options

The use of a compositor is not necessary and is entirely optional.

Shutdown

dusk comes with system functions to log out of or to restart the window manager.

Function Description
restart Seamlessly restarts the window manager
quit Exits the window manager

Back to Features > Functions.

⚠️ **GitHub.com Fallback** ⚠️