Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Khaled Nassar
Khaled Nassar

Posted on

     

the best way to configure your dwm

hello everyone, dwm is the best window manager you can use it's fast and minimalism and this the best thing i love ofsuckless philosophy , in this post i'll show you how to configure your dwm, we will configure keybinds & color schema & some tasks can help you for make an awesome WM
for configure your dwm (or any suckless programs) you need to change somethings inconfig.h

first let's start with keybinds, dwm works withALT key if you wan't to change it fromALT toSUPER key, changeconfig.h from#define MODKEY Mod1Mask to#define MODKEY Mod4Mask for add/remove keybinds for dwm go tokeys list fromconfig.h

staticKeykeys[]={/* modifier                     key        function        argument */{MODKEY,XK_d,spawn,{.v=dmenucmd}},{MODKEY,XK_Return,spawn,{.v=termcmd}},.....etc........
Enter fullscreen modeExit fullscreen mode

dwm default keys for kill programs isSUPER + c , i'll change it toq

keys[] =... ..+ { MODKEY,                     XK_q,      killclient,     {0} },...
Enter fullscreen modeExit fullscreen mode

if you wan't to add more keybinds add a varible with your command you wan't to run with your keybind for example i need to run$ pamixer --allow-boost -i 10 for up the audio

static const char *audioup[] = { "pamixer --allow-boost -i 10",NULL };// EXAMPLE{ MODKEY,                       XK_{KEY},      spawn,          {.v = {COMMAND} } }// REAL{ MODKEY,           XK_p,      spawn,      {.v = audioup}},// SUPER + p = audioup command
Enter fullscreen modeExit fullscreen mode

take the idea and make your own keybinds or if you hate to configure your keybind fromC code you can usesxhkd with simple config file :)


for change the terminal fromST to your fav terminal go toconfig.h and search fortermcmd[] and change the value fromst toterminator for example


for change the font of dwm go to yourconfig.h file and search forfonts[] and change the value to your fav font name & size for example

staticconstchar*fonts[]={"monospace:size=13"};
Enter fullscreen modeExit fullscreen mode

for change your colorschema search forstatic const char col_gray and change what you wan't with color picker, or you can usePywal to generate colorschema with your wallpaper
$ wal -i wallpaper.png

and add this line#include "/home/${your username}/.cache/wal/colors-wal-dwm.h" for yourconfig.h and remove this lines fromconfig.h

static const char *colors[][3]      = {    /*               fg         bg         border   */    [SchemeNorm] = { col_gray3, col_gray1, col_gray2 },    [SchemeSel]  = { col_gray4, col_cyan,  col_cyan  },};
Enter fullscreen modeExit fullscreen mode

and remove[SchemeUrg] = { urg_fg, urg_bg, urg_border }, from~/.cache/wal/colors-wal-dwm.h, now your colorschema will generate with your wallpaper.png

Alt Text

if you want to add auto start function for your dwm you can usecool autostart patch , after patch with$ git apply cool-autostart.diff you need to add this line forconfig.h with your commands

static const char *const autostart[] = {    "compton", NULL,    "sxhkd",NULL,    "wal -R",NULL,    NULL};
Enter fullscreen modeExit fullscreen mode

after that run$ sudo make clean install and enjoy :)

Top comments(0)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

I use Arch btw -
  • Joined

Trending onDEV CommunityHot

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp