You are not logged in.

#1 2015-08-09 22:18:53

Halcyon522
Member
Registered: 2015-04-09
Posts: 13

dwm is not keeping changes made to config.h file [SOLVED]

So, I had this all working just fine on a previous setup, and decided to try out dwm again. Using ABS, I copied the dwm folder from /var/abs/community/ to ~/bin and ran makepkg -i from inside it. After dwm installed, I edited the config.h file to change Mod1Mask to Mod4Mask, and recompiled using makepkg -g >> PKGBUILD && makepkg -efi. Everything appeared to recompile fine, but after restarting dwm, the change didn't go through. I tried making some other changes in config.h and recompiling again, and once again everything is default. I know I'm overlooking some simple step, but I can't for the life of me figure it out. Am I editing the wrong config.h or something?

Last edited by Halcyon522 (2015-08-11 11:49:29)

Offline

#2 2015-08-09 22:57:16

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,534
Website

Re: dwm is not keeping changes made to config.h file [SOLVED]

Are you modifying ~/bin/dwm/config.h or ~/bin/dwb/src/dwm-6.0/config.h?  If you are using the PKGBUILD from the abs, you should only modify the former as the latter gets overwritten on every build.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2015-08-09 23:26:41

Halcyon522
Member
Registered: 2015-04-09
Posts: 13

Re: dwm is not keeping changes made to config.h file [SOLVED]

The former, but I've even tried modifying the latter. And I should note that the changes I make to config.h persist after recompiling. They just don't seem to have any effect.

Offline

#4 2015-08-09 23:59:59

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: dwm is not keeping changes made to config.h file [SOLVED]

Please paste your config.h and the output of a build.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#5 2015-08-10 01:38:11

Halcyon522
Member
Registered: 2015-04-09
Posts: 13

Re: dwm is not keeping changes made to config.h file [SOLVED]

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

/* appearance */
static const char font[]            = "-*-terminus-medium-r-*-*-16-*-*-*-*-*-*-*";
static const char normbordercolor[] = "#444444";
static const char normbgcolor[]     = "#222222";
static const char normfgcolor[]     = "#bbbbbb";
static const char selbordercolor[]  = "#005577";
static const char selbgcolor[]      = "#005577";
static const char selfgcolor[]      = "#eeeeee";
static const unsigned int borderpx  = 1;        /* border pixel of windows */
static const unsigned int snap      = 32;       /* snap pixel */
static const Bool showbar           = True;     /* False means no bar */
static const Bool topbar            = False;     /* False means bottom bar */

/* tagging */
static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };

static const Rule rules[] = {
	/* class      instance    title       tags mask     isfloating   monitor */
	{ "Gimp",     NULL,       NULL,       0,            True,        -1 },
	{ "Firefox",  NULL,       NULL,       1 << 8,       False,       -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 Bool resizehints = True; /* True means respect size hints in tiled resizals */

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 Mod4Mask
#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 const char *dmenucmd[] = { "dmenu_run", "-fn", font, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL };
static const char *termcmd[]  = { "uxterm", 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} },
};
makepkg -g >> PKGBUILD && makepkg -efi output:
==> Retrieving sources...
  -> Found dwm-6.0.tar.gz
  -> Found config.h
  -> Found dwm.desktop
==> Generating checksums for source files...
==> Making package: dwm 6.0-2 (Sun Aug  9 20:34:32 CDT 2015)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> WARNING: Using existing $srcdir/ tree
==> Removing existing $pkgdir/ directory...
==> Starting build()...
dwm build options:
CFLAGS   = -std=c99 -pedantic -Wall -Os -I. -I/usr/include -I/usr/include/X11 -D_FORTIFY_SOURCE=2 -DVERSION="6.0" -DXINERAMA
LDFLAGS  = -s -L/usr/lib -lc -L/usr/lib/X11 -lX11 -L/usr/lib/X11 -lXinerama
CC       = cc
CC dwm.c
dwm.c: In function ‘keypress’:
dwm.c:1087:2: warning: ‘XKeycodeToKeysym’ is deprecated [-Wdeprecated-declarations]
  keysym = XKeycodeToKeysym(dpy, (KeyCode)ev->keycode, 0);
  ^
In file included from dwm.c:36:0:
/usr/include/X11/Xlib.h:1687:15: note: declared here
 extern KeySym XKeycodeToKeysym(
               ^
CC -o dwm
==> Entering fakeroot environment...
==> Starting package()...
dwm build options:
CFLAGS   = -std=c99 -pedantic -Wall -Os -I. -I/usr/include -I/usr/X11R6/include -D_FORTIFY_SOURCE=2 -DVERSION="6.0" -DXINERAMA
LDFLAGS  = -s -L/usr/lib -lc -L/usr/X11R6/lib -lX11 -L/usr/X11R6/lib -lXinerama
CC       = cc
installing executable file to /home/halcyon/bin/dwm/pkg/dwm/usr/bin
installing manual page to /home/halcyon/bin/dwm/pkg/dwm/usr/share/man/man1
==> Tidying install...
  -> Purging unwanted files...
  -> Removing libtool files...
  -> Removing static library files...
  -> Compressing man and info pages...
  -> Stripping unneeded symbols from binaries and libraries...
==> Creating package "dwm"...
  -> Generating .PKGINFO file...
  -> Adding install file...
  -> Generating .MTREE file...
  -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: dwm 6.0-2 (Sun Aug  9 20:34:33 CDT 2015)
==> Installing package dwm with pacman -U...
[sudo] password for halcyon: 
loading packages...
warning: dwm-6.0-2 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (1) dwm-6.0-2

Total Installed Size:  0.08 MiB
Net Upgrade Size:      0.00 MiB

:: Proceed with installation? [Y/n] 
(1/1) checking keys in keyring                     [######################] 100%
(1/1) checking package integrity                   [######################] 100%
(1/1) loading package files                        [######################] 100%
(1/1) checking for file conflicts                  [######################] 100%
(1/1) checking available disk space                [######################] 100%
(1/1) reinstalling dwm                             [######################] 100%

Offline

#6 2015-08-10 10:50:38

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: dwm is not keeping changes made to config.h file [SOLVED]

Post the PKGBUILD you're using.

Offline

#7 2015-08-10 13:25:55

Halcyon522
Member
Registered: 2015-04-09
Posts: 13

Re: dwm is not keeping changes made to config.h file [SOLVED]

# $Id: PKGBUILD 113973 2014-07-01 10:51:04Z spupykin $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Dag Odenhall <dag.odenhall@gmail.com>
# Contributor: Grigorios Bouzakis <grbzks@gmail.com>

pkgname=dwm
pkgver=6.0
pkgrel=2
pkgdesc="A dynamic window manager for X"
url="http://dwm.suckless.org"
arch=('i686' 'x86_64')
license=('MIT')
options=(zipman)
depends=('libx11' 'libxinerama')
install=dwm.install
source=(http://dl.suckless.org/dwm/dwm-$pkgver.tar.gz
	config.h
	dwm.desktop)
md5sums=('8bb00d4142259beb11e13473b81c0857'
         '2453e037f46449774ec8afab49b4f1a2'
         '939f403a71b6e85261d09fc3412269ee')

build() {
  cd $srcdir/$pkgname-$pkgver
  cp $srcdir/config.h config.h
  sed -i 's/CPPFLAGS =/CPPFLAGS +=/g' config.mk
  sed -i 's/^CFLAGS = -g/#CFLAGS += -g/g' config.mk
  sed -i 's/^#CFLAGS = -std/CFLAGS += -std/g' config.mk
  sed -i 's/^LDFLAGS = -g/#LDFLAGS += -g/g' config.mk
  sed -i 's/^#LDFLAGS = -s/LDFLAGS += -s/g' config.mk
  make X11INC=/usr/include/X11 X11LIB=/usr/lib/X11
}

package() {
  cd $srcdir/$pkgname-$pkgver
  make PREFIX=/usr DESTDIR=$pkgdir install
  install -m644 -D LICENSE $pkgdir/usr/share/licenses/$pkgname/LICENSE
  install -m644 -D README $pkgdir/usr/share/doc/$pkgname/README
  install -m644 -D $srcdir/dwm.desktop $pkgdir/usr/share/xsessions/dwm.desktop
}
md5sums=('8bb00d4142259beb11e13473b81c0857'
         'd9b8570b1ab70f3b70be8064c66fd84c'
         '939f403a71b6e85261d09fc3412269ee')
md5sums=('8bb00d4142259beb11e13473b81c0857'
         'd9b8570b1ab70f3b70be8064c66fd84c'
         '939f403a71b6e85261d09fc3412269ee')

Last edited by Halcyon522 (2015-08-10 13:32:13)

Offline

#8 2015-08-10 19:09:21

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: dwm is not keeping changes made to config.h file [SOLVED]

Edit your PKGBUILD to debug:

...
build() {
  cd $srcdir/$pkgname-$pkgver
  cp $srcdir/config.h config.h && printf "%s\n" "Using my config"
...

Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#9 2015-08-10 19:11:47

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: dwm is not keeping changes made to config.h file [SOLVED]

How did you restart dwm? If you're using e.g. ~/.xinitrc, post it.

Offline

#10 2015-08-10 19:25:57

Halcyon522
Member
Registered: 2015-04-09
Posts: 13

Re: dwm is not keeping changes made to config.h file [SOLVED]

With my previous setup, I was using xinitrc. This time, I'm using the xsessions file through gdm. I restarted dwm with shift-mod-q and logged back in from gdm.

I was afraid that I was using a previously pacman-installed default dwm, so I've tried

sudo pacman -Rsc dwm

before compiling.

Output after PKGBUILD debug:
==> Retrieving sources...
  -> Found dwm-6.0.tar.gz
  -> Found config.h
  -> Found dwm.desktop
==> Generating checksums for source files...
==> Making package: dwm 6.0-2 (Mon Aug 10 14:31:37 CDT 2015)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> WARNING: Using existing $srcdir/ tree
==> Removing existing $pkgdir/ directory...
==> Starting build()...
Using my config/ndwm build options:
CFLAGS   = -std=c99 -pedantic -Wall -Os -I. -I/usr/include -I/usr/include/X11 -D_FORTIFY_SOURCE=2 -DVERSION="6.0" -DXINERAMA
LDFLAGS  = -s -L/usr/lib -lc -L/usr/lib/X11 -lX11 -L/usr/lib/X11 -lXinerama
CC       = cc
CC dwm.c
dwm.c: In function ‘keypress’:
dwm.c:1087:2: warning: ‘XKeycodeToKeysym’ is deprecated [-Wdeprecated-declarations]
  keysym = XKeycodeToKeysym(dpy, (KeyCode)ev->keycode, 0);
  ^
In file included from dwm.c:36:0:
/usr/include/X11/Xlib.h:1687:15: note: declared here
 extern KeySym XKeycodeToKeysym(
               ^
CC -o dwm
==> Entering fakeroot environment...
==> Starting package()...
dwm build options:
CFLAGS   = -std=c99 -pedantic -Wall -Os -I. -I/usr/include -I/usr/X11R6/include -D_FORTIFY_SOURCE=2 -DVERSION="6.0" -DXINERAMA
LDFLAGS  = -s -L/usr/lib -lc -L/usr/X11R6/lib -lX11 -L/usr/X11R6/lib -lXinerama
CC       = cc
installing executable file to /home/halcyon/bin/dwm/pkg/dwm/usr/bin
installing manual page to /home/halcyon/bin/dwm/pkg/dwm/usr/share/man/man1
==> Tidying install...
  -> Purging unwanted files...
  -> Removing libtool files...
  -> Removing static library files...
  -> Compressing man and info pages...
  -> Stripping unneeded symbols from binaries and libraries...
==> Creating package "dwm"...
  -> Generating .PKGINFO file...
  -> Adding install file...
  -> Generating .MTREE file...
  -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: dwm 6.0-2 (Mon Aug 10 14:31:39 CDT 2015)
==> Installing package dwm with pacman -U...
[sudo] password for halcyon: 
loading packages...
warning: dwm-6.0-2 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (1) dwm-6.0-2

Total Installed Size:  0.08 MiB
Net Upgrade Size:      0.00 MiB

:: Proceed with installation? [Y/n] 
(1/1) checking keys in keyring                                                       [################################################] 100%
(1/1) checking package integrity                                                     [################################################] 100%
(1/1) loading package files                                                          [################################################] 100%
(1/1) checking for file conflicts                                                    [################################################] 100%
(1/1) checking available disk space                                                  [################################################] 100%
(1/1) reinstalling dwm                                                               [################################################] 100%

Could this be an ABS thing? Because I don't think I used it last time. I just downloaded the source from the suckless website and used xinitrc to start dwm.

Last edited by Halcyon522 (2015-08-10 19:40:18)

Offline

#11 2015-08-10 21:10:22

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: dwm is not keeping changes made to config.h file [SOLVED]

So it is copying your config.h across.

I have no idea why your change isn't being picked up. It has been a while since I used the ABS method, but those are the steps I used and I had no issues with changes.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#12 2015-08-10 21:17:35

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: dwm is not keeping changes made to config.h file [SOLVED]

It's not just the modmask, the bar is at the top, even you've set it to the bottom, right?
Is the config.h you edit overwritten or do the changes stay, but are not applied?

Offline

#13 2015-08-10 21:36:32

Halcyon522
Member
Registered: 2015-04-09
Posts: 13

Re: dwm is not keeping changes made to config.h file [SOLVED]

The changes stay, but are not applied.

I changed the bar placement just to change something else, and no, it's never moved from the top.

It's almost as if it's pulling the default config down from the url, but I'm using - efi and it seems to acknowledge that in the output. Plus, my changes persist to config.h. It must be using some other config somehow.

I might try going without ABS and installing from a download package. Should I remove the ABS directory tree? If so, how is that done?

Offline

#14 2015-08-10 21:39:59

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: dwm is not keeping changes made to config.h file [SOLVED]

Just 'sudo rm -rf', but I don't see the point. You can use dwm-git from the AUR, if you want.

Offline

#15 2015-08-10 21:41:19

mauritiusdadd
Member
From: Benevento, Italy
Registered: 2013-10-27
Posts: 776

Re: dwm is not keeping changes made to config.h file [SOLVED]

Halcyon522 wrote:

Could this be an ABS thing? Because I don't think I used it last time. I just downloaded the source from the suckless website and used xinitrc to start dwm.

So, by any chance did you use make install the last time? If so, make sure to start /usr/bin/dwm and not just dwm. What is the output of the following command?

which dwm

About me - github

-- When you have eliminated the impossible, whatever remains, however improbable, must be the truth -- Spock | Sherlock Holmes

Offline

#16 2015-08-10 21:58:56

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,534
Website

Re: dwm is not keeping changes made to config.h file [SOLVED]

mauritiusdadd is on the right track.  I'm pretty sure the problem here is that the dwm you are starting from xsession simply isnt the same one you are building with the PKGBUILD.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#17 2015-08-11 01:48:31

Halcyon522
Member
Registered: 2015-04-09
Posts: 13

Re: dwm is not keeping changes made to config.h file [SOLVED]

Success! mauritiusdadd was right on the money. Output of

which dwm

was

/usr/local/bin/dwm

so I updated the script I was calling with the xsessions file to

~/.fehbg &
/usr/bin/dwm

and instantly all those changes were present. I suppose I should have changed the path in PKGBUILD. Thanks everyone for helping me figure out this conundrum. It's been bugging me to no end.

Last edited by Halcyon522 (2015-08-11 01:50:17)

Offline

#18 2015-08-11 05:55:43

mauritiusdadd
Member
From: Benevento, Italy
Registered: 2013-10-27
Posts: 776

Re: dwm is not keeping changes made to config.h file [SOLVED]

Halcyon522 wrote:

I suppose I should have changed the path in PKGBUILD.

Glad to hear that the problem has been solved. Personally, i think the path in the PKGBUILD is fine, you should instead remove the old binary in /usr/local/bin.

Btw, remember to mark the thread as [SOLVED] https://bbs.archlinux.org/viewtopic.php?id=130309 wink


About me - github

-- When you have eliminated the impossible, whatever remains, however improbable, must be the truth -- Spock | Sherlock Holmes

Offline

Board footer

Powered by FluxBB