LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 10-06-2017, 05:25 PM   #1
mind_exploit
Member
 
Registered: Feb 2011
Location: Bulgaria
Distribution: Slackware & Mint
Posts: 46

Rep: Reputation: 0
Question DWM broke after pathcing and can't make it work again


Hey, guys,

I want to try `dwm` so I downloaded the source, compiled, logged out, chose it on `lightdm` and logged in again - it worked.

Then I applied my first patch - `uselessgap` - and after I logged in - none of the shortcuts worked. I can't open terminal even. The only think that worked - thanks god - is `Alt-Shift-q`, so I was able to exit

After that I tried several things - like recompiling, extract the source into new folder and install from there, no patches, nothing. But it still behaves the same way.

What could be the reason? ... And also - is there any `log` file I can take a look into? ... cause I found nothing in `/var/log` or in the folder where I'm compiling it.

Regards,
Petar
 
Old 10-07-2017, 12:59 AM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
you need to show us how you did it, every step with commands issued and output received.
also where you got that patch from and what it's function is.
 
Old 10-08-2017, 04:24 AM   #3
mind_exploit
Member
 
Registered: Feb 2011
Location: Bulgaria
Distribution: Slackware & Mint
Posts: 46

Original Poster
Rep: Reputation: 0
Cool What I did

Hey, guys,

I tried several things already, and basically here they are:

1. Got the source code - I directly downloaded it from here: https://dl.suckless.org/dwm/ and also - cloned it from git - git clone https://git.suckless.org/dwm.

2. Then compiled the package with this: `sudo make clean install`. The output in both cases is this one:

Code:
cleaning
dwm build options:
CFLAGS   = -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os -I/usr/X11R6/include -I/usr/include/freetype2 -D_BSD_SOURCE -D_POSIX_C_SOURCE=2 -DVERSION="6.1" -DXINERAMA
LDFLAGS  = -s -L/usr/X11R6/lib -lX11 -lXinerama -lfontconfig -lXft
CC       = cc
CC drw.c
CC dwm.c
CC util.c
CC -o dwm
installing executable file to /usr/local/bin
installing manual page to /usr/local/share/man/man1
In `/usr/share/xsessions` I have `dwm.desktop` with this content:

Code:
[Desktop Entry]
Encoding=UTF-8
Name=Dwm
Comment=Dynamic window manager
Exec=/usr/local/bin/dwm
Icon=dwm
Type=XSession
3. I tried also to install directly - `sudo apt-get install dwm` and then I have `dwm.desktop` in `/usr/share/xsessions` one difference: `Exec=dwm`

In all cases:

1. I am able to login in `dwm`
2. The shortcut for quit - Alt+Shift+Q - works. Also the shortcut for changing layout and toggling task bar also works.
3. No other shortcut works, like Alt+Shift+Enter for terminal or Alt+P to start application.

=============

I'm on Debian and for now I'm using openbox and i3.

It was working at the beginning, and then I tried to apply this patch: https://dwm.suckless.org/patches/uselessgap

Since then it's broken.
I tried to remove it - `apt-get remove dwm` and also `apt-get purge dwm`. And then compiled again, but still the same broken behavior.

Regards,
Petar
 
Old 10-08-2017, 09:20 AM   #4
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
so there's no patch?

i seem to remember there was a config.h file that the user is supposed to edit.
is it there, did you edit?
 
Old 10-09-2017, 02:30 AM   #5
mind_exploit
Member
 
Registered: Feb 2011
Location: Bulgaria
Distribution: Slackware & Mint
Posts: 46

Original Poster
Rep: Reputation: 0
Question

Hey,

About `config.h` file - I made it, by copying the default one, like this:

Code:
cp config.def.h config.h
So whenever I compile it - the `config.h` is there. I haven't made any changes in it though.

========

Regarding the patch - now, even without it, I still face the same issue(s).

But the way I patched `DWM` is this one:

Code:
patch < dwm-uselessgap-6.1.diff
and the output was

Code:
patching file dwm.c
Then added the line in the config file:

Code:
static const unsigned int gappx = 6; /* gap pixel between windows */
and compiled again:

Code:
> sudo make clean install
cleaning
dwm build options:
CFLAGS   = -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os -I/usr/X11R6/include -I/usr/include/freetype2 -D_BSD_SOURCE -D_POSIX_C_SOURCE=2 -DVERSION="6.1" -DXINERAMA
LDFLAGS  = -s -L/usr/X11R6/lib -lX11 -lXinerama -lfontconfig -lXft
CC       = cc
CC drw.c
CC dwm.c
CC util.c
CC -o dwm
installing executable file to /usr/local/bin
installing manual page to /usr/local/share/man/man1
But when I logged out and logged in `DWM` - I still have the same issue.
 
Old 10-09-2017, 03:39 PM   #6
Myk267
Member
 
Registered: Apr 2012
Location: California
Posts: 422
Blog Entries: 16

Rep: Reputation: Disabled
Quote:
Originally Posted by mind_exploit View Post
Hey, guys,

I tried several things already, and basically here they are:

1. Got the source code - I directly downloaded it from here: https://dl.suckless.org/dwm/ and also - cloned it from git - git clone https://git.suckless.org/dwm.

2. Then compiled the package with this: `sudo make clean install`. The output in both cases is this one:

Code:
cleaning
dwm build options:
CFLAGS   = -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os -I/usr/X11R6/include -I/usr/include/freetype2 -D_BSD_SOURCE -D_POSIX_C_SOURCE=2 -DVERSION="6.1" -DXINERAMA
LDFLAGS  = -s -L/usr/X11R6/lib -lX11 -lXinerama -lfontconfig -lXft
CC       = cc
CC drw.c
CC dwm.c
CC util.c
CC -o dwm
installing executable file to /usr/local/bin
installing manual page to /usr/local/share/man/man1
In `/usr/share/xsessions` I have `dwm.desktop` with this content:

Code:
[Desktop Entry]
Encoding=UTF-8
Name=Dwm
Comment=Dynamic window manager
Exec=/usr/local/bin/dwm
Icon=dwm
Type=XSession
3. I tried also to install directly - `sudo apt-get install dwm` and then I have `dwm.desktop` in `/usr/share/xsessions` one difference: `Exec=dwm`

In all cases:

1. I am able to login in `dwm`
2. The shortcut for quit - Alt+Shift+Q - works. Also the shortcut for changing layout and toggling task bar also works.
3. No other shortcut works, like Alt+Shift+Enter for terminal or Alt+P to start application.

=============

I'm on Debian and for now I'm using openbox and i3.

It was working at the beginning, and then I tried to apply this patch: https://dwm.suckless.org/patches/uselessgap

Since then it's broken.
I tried to remove it - `apt-get remove dwm` and also `apt-get purge dwm`. And then compiled again, but still the same broken behavior.

Regards,
Petar
Do you have 'st' and 'dmenu' the programs installed which are called when you use the shortcuts to start a terminal or start the application launcher? I remember that Debian renames their version of 'st' to 'stterm', so you'll have to either hard code the right name into your dwm config or come up with your own fix.
 
Old 10-10-2017, 01:37 AM   #7
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
^ oh yeah, that's likely! you're supposed to edit config.h.

Quote:
Originally Posted by mind_exploit View Post
But the way I patched `DWM` is this one:

Code:
patch < dwm-uselessgap-6.1.diff
we now know the name of the file.
not very helpful.
you should have more for us.

Last edited by ondoho; 10-10-2017 at 01:39 AM.
 
Old 10-10-2017, 11:51 AM   #8
mind_exploit
Member
 
Registered: Feb 2011
Location: Bulgaria
Distribution: Slackware & Mint
Posts: 46

Original Poster
Rep: Reputation: 0
Smile We have some progress :)

Hey, guys,

Well, the missing "st" program was the problem. Once I installed it - now I'm able to run terminal
Thanks for the guides

(However, I prefer "terminator" so I just edited the config.h file and now I have terminator ... I had to do it earlier though ...)

Also - applied the patch and it's working too

=====

However, the "dmenu" doesn't run. I'm using "i3" usually, which also uses "dmenu" and "dmenu" is working there.

I tried (in dwm) to run "dmenu_run" from terminal - and it worked. But the shortcut doesn't work.

This is my confg.h file:

Code:
/* See LICENSE file for copyright and license details. */

/* appearance */
static const unsigned int borderpx  = 1;        /* border pixel of windows */
static const unsigned int snap      = 32;       /* snap pixel */
static const int showbar            = 1;        /* 0 means no bar */
static const int topbar             = 1;        /* 0 means bottom bar */
static const char *fonts[]          = { "monospace:size=10" };
static const char dmenufont[]       = "monospace:size=10";
static const char col_gray1[]       = "#222222";
static const char col_gray2[]       = "#444444";
static const char col_gray3[]       = "#bbbbbb";
static const char col_gray4[]       = "#eeeeee";
static const char col_cyan[]        = "#005577";
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[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };

static const Rule rules[] = {
	/* xprop(1):
	 *	WM_CLASS(STRING) = instance, class
	 *	WM_NAME(STRING) = title
	 */
	/* class      instance    title       tags mask     isfloating   monitor */
	{ "Gimp",     NULL,       NULL,       0,            1,           -1 },
	{ "Firefox",  NULL,       NULL,       1 << 8,       0,           -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 */

static const unsigned int gappx = 12; /* gap pixel between windows */

static const Layout layouts[] = {
	/* symbol     arrange function */
	{ "[]=",      tile },    /* first entry is default */
	{ "><>",      NULL },    /* no layout function means floating behavior */
	{ "[M]",      monocle },
};

/* key definitions */
#define MODKEY Mod1Mask
#define TAGKEYS(KEY,TAG) \
	{ MODKEY,                       KEY,      view,           {.ui = 1 << TAG} }, \
	{ MODKEY|ControlMask,           KEY,      toggleview,     {.ui = 1 << TAG} }, \
	{ MODKEY|ShiftMask,             KEY,      tag,            {.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 } }

/* commands */
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
static const char *termcmd[]  = { "terminator", NULL };

static Key keys[] = {
	/* modifier                     key        function        argument */
	{ MODKEY,                       XK_p,      spawn,          {.v = dmenucmd } },
	{ 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,                       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_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 } },
	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} },
};

/* button definitions */
/* click can be 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} },
};
 
Old 10-10-2017, 12:23 PM   #9
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
try to reduce this line:
Code:
static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
to this:
Code:
static const char *dmenucmd[] = { "dmenu_run", NULL };
 
Old 10-11-2017, 02:53 AM   #10
mind_exploit
Member
 
Registered: Feb 2011
Location: Bulgaria
Distribution: Slackware & Mint
Posts: 46

Original Poster
Rep: Reputation: 0
Smile It finally worked :)

Thanks, guys
With the last change - I have the `dmenu` running as well, so now I can use `dwm` with no major issues

Thank you
 
  


Reply

Tags
dwm



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Please, help!!! I broke a box and can't get apache2 to work again danast Linux - Newbie 2 11-22-2012 08:07 PM
broke rt3572 driver for wusb600n v2 while trying to make it better seamuscristo Linux - Newbie 2 02-09-2011 01:28 PM
[SOLVED] Solution - Installing FreeNX broke kernel 'make xconfig' sloMoses Slackware 1 05-08-2010 06:53 PM
make Xconfig doesn't work, make menuconfig does work Debian/KDE bucovaina78 Linux - Kernel 1 10-15-2008 01:26 PM
I broke the make command how do I fix it PTG Linux - Software 4 04-04-2006 02:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 12:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration