You are not logged in.

#1 2020-12-16 13:23:15

picaso127
Member
Registered: 2020-12-15
Posts: 18

DWM load but keyboard does not respond [SOLVED]

Hi everybody,
I am trying to use DWM as my WM without any desktop environment.
I have successfully run DWM from my display manager (lightdm) but the keyboard does not respond.


suckless programs: dwm 6.2, dmenu, st
kernel: 5.4.83-1-lts

~/.xsession-errors:

warning: no locale support
X Error of failed request:  BadValue (integer parameter out of range for operat>
  Major opcode of failed request:  18 (X_ChangeProperty)
  Value in failed request:  0x1
  Serial number of failed request:  442
  Current serial number in output stream:  448
...
X Error of failed request:  BadValue (integer parameter out of range for operat>
  Major opcode of failed request:  18 (X_ChangeProperty)
  Value in failed request:  0x0
  Serial number of failed request:  442
  Current serial number in output stream:  448

thanks for the help

Last edited by picaso127 (2020-12-21 13:58:28)

Offline

#2 2020-12-16 16:49:26

seth
Member
Registered: 2012-09-03
Posts: 52,140

Re: DWM load but keyboard does not respond [SOLVED]

Does the keyboard work™ in lightdm?
How does it not respond (ie. what attempted input fails)?
Please post your xorg log.

Offline

#3 2020-12-16 18:14:29

tucuxi
Member
From: Switzerland
Registered: 2020-03-08
Posts: 291

Re: DWM load but keyboard does not respond [SOLVED]

Also show us your config.h.

Offline

#4 2020-12-16 21:21:07

picaso127
Member
Registered: 2020-12-15
Posts: 18

Re: DWM load but keyboard does not respond [SOLVED]

dwm/config.h

/* 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 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} }, \

/* 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[]  = { "st", 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 ClkTagBar, 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} },
};

Offline

#5 2020-12-16 21:28:08

picaso127
Member
Registered: 2020-12-15
Posts: 18

Re: DWM load but keyboard does not respond [SOLVED]

my keyboard responds when I am on lightdm, gnome, awesome WM, and when I am switching to another tty.

Xorg log file: http://ix.io/2Im0

I attempted to open ST with the default key binding

Last edited by picaso127 (2020-12-16 22:57:52)

Offline

#6 2020-12-16 21:47:34

seth
Member
Registered: 2012-09-03
Posts: 52,140

Re: DWM load but keyboard does not respond [SOLVED]

Please use code tags, not quote tags.

Xorg.0.log but it probably won't matter.

What do you think the "default key binding" is for st?
Can you launch "DISPLAY=:0 st" from another TTY? Does the keyboard work in that window?

Offline

#7 2020-12-16 23:07:35

picaso127
Member
Registered: 2020-12-15
Posts: 18

Re: DWM load but keyboard does not respond [SOLVED]

seth wrote:

Please use code tags, not quote tags.

Xorg.0.log but it probably won't matter.

What do you think the "default key binding" is for st?
Can you launch "DISPLAY=:0 st" from another TTY? Does the keyboard work in that window?

the default key binding is [Shift]+[Alt]+[Enter] according to the suckless website

the result of "DISPLAY=:0 st" on another tty:

Invalid MIT-MAGIC-COOKIE-1 keycan't open display

the result of "DISPLAY=:0 st" on Gnome-wayland:

X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  18 (X_ChangeProperty)
  Value in failed request:  0x1
  Serial number of failed request:  442
  Current serial number in output stream:  448

Offline

#8 2020-12-16 23:43:40

picaso127
Member
Registered: 2020-12-15
Posts: 18

Re: DWM load but keyboard does not respond [SOLVED]

I tried the key binding for exiting DWM: Shift+Alt+q and it worked!

it seems that the problem is related to ST and no DWM keyboard-configuration

Offline

#9 2020-12-17 00:48:48

picaso127
Member
Registered: 2020-12-15
Posts: 18

Re: DWM load but keyboard does not respond [SOLVED]

As a new member, what is the right way to upload my problem with SimpleTerminal?

  1. Do I need to create a new thread and mark this thread as solved

  2. Or do I need to change the name of this thread?

Thanks for the help smile

Last edited by picaso127 (2020-12-21 13:58:53)

Offline

#10 2020-12-17 04:47:24

seth
Member
Registered: 2012-09-03
Posts: 52,140

Re: DWM load but keyboard does not respond [SOLVED]

Please don't bump, just edit your previous post unless somebody has responded.


It's also (and more importantly) the shortcut according to

        { MODKEY|ShiftMask,             XK_Return, spawn,          {.v = termcmd } },

Invalid MIT-MAGIC-COOKIE-1 keycan't open display

Was dwm running as the same user on the other tty at this time?

What do do with this thread depends on whether the problem is to start st at all or to start it via the dwm shortcut.
Can you run dmenu (and st from there)?
Can you run st in a an Xorg (not wayland) session other than dwm?

Offline

#11 2020-12-18 01:36:55

picaso127
Member
Registered: 2020-12-15
Posts: 18

Re: DWM load but keyboard does not respond [SOLVED]

seth wrote:

Was DWM running as the same user on the other tty at this time?

I'm always running my graphical interface on the default tty (tty7) including DWM.

Offline

#12 2020-12-18 07:33:52

seth
Member
Registered: 2012-09-03
Posts: 52,140

Re: DWM load but keyboard does not respond [SOLVED]

What?
The idea was to run X11/DWM (on whatever TTY you like, doesn't matter), then switch to a different TTY, log into that console (as the same user that runs the X11 session) and try to run st from there.

Also

seth wrote:

Can you run dmenu (and st from there)?
Can you run st in a an Xorg (not wayland) session other than dwm?

Offline

#13 2020-12-18 12:48:54

picaso127
Member
Registered: 2020-12-15
Posts: 18

Re: DWM load but keyboard does not respond [SOLVED]

I ran X11/dwm on my default user and logged in to him from another tty at the same time.
Results:

  1.  st 
     -> can't open display
  2.  DISPLAY=:0 st
     -> 
    X Error of failed request:  BadValue (integer parameter out of range for operat>
      Major opcode of failed request:  18 (X_ChangeProperty)
      Value in failed request:  0x0
      Serial number of failed request:  442
      Current serial number in output stream:  448
  3. dmenu_run 
     ->
    warning: no locale support
    cannot open display
  4. DISPLAY=:0 dmenu_run 
     -> 
    warning: no locale support
    XOpenIM failed: could not open input device

Offline

#14 2020-12-18 12:50:54

picaso127
Member
Registered: 2020-12-15
Posts: 18

Re: DWM load but keyboard does not respond [SOLVED]

seth wrote:

Can you run st in a a Xorg (not wayland) session other than dwm?

running  st on Gnome/Xorg:

X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  18 (X_ChangeProperty)
  Value in failed request:  0x0
  Serial number of failed request:  442
  Current serial number in output stream:  448

I have tried to look for a reference on X11 website/google for this error but failed to find any information.
Can you explain to me (if you know) what every line in this error means?

Thanks for the help BTW smile

Last edited by picaso127 (2020-12-18 12:55:41)

Offline

#15 2020-12-18 15:04:05

seth
Member
Registered: 2012-09-03
Posts: 52,140

Re: DWM load but keyboard does not respond [SOLVED]

https://tronche.com/gui/x/xlib/window-i … perty.html

st calls that funtion twice or selection and once at its init. The latter wants to set the _NET_WM_PID and the PID is probably garbage because st is dying.
It's not the cause of the failure, run st in gdb and see where it fails.
https://wiki.archlinux.org/index.php/De … _the_trace

Offline

#16 2020-12-18 17:23:46

tucuxi
Member
From: Switzerland
Registered: 2020-03-08
Posts: 291

Re: DWM load but keyboard does not respond [SOLVED]

Can you run any other terminal in X, e.g. xterm?

Offline

#17 2020-12-18 19:58:32

picaso127
Member
Registered: 2020-12-15
Posts: 18

Re: DWM load but keyboard does not respond [SOLVED]

tucuxi wrote:

Can you run any other terminal in X, e.g. xterm?

Xterm runs without any error

Offline

#18 2020-12-18 20:02:58

picaso127
Member
Registered: 2020-12-15
Posts: 18

Re: DWM load but keyboard does not respond [SOLVED]

seth wrote:

https://tronche.com/gui/x/xlib/window-i … perty.html

st calls that funtion twice or selection and once at its init. The latter wants to set the _NET_WM_PID and the PID is probably garbage because st is dying.
It's not the cause of the failure, run st in gdb and see where it fails.
https://wiki.archlinux.org/index.php/De … _the_trace

Results:

(gdb) exec st
(gdb) run
Starting program: /usr/local/bin/st st
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7a92310 in free () from /usr/lib/libc.so.6

Offline

#19 2020-12-18 20:05:44

tucuxi
Member
From: Switzerland
Registered: 2020-03-08
Posts: 291

Re: DWM load but keyboard does not respond [SOLVED]

Did you see anything unusual when you built st?

Offline

#20 2020-12-18 20:26:44

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

Re: DWM load but keyboard does not respond [SOLVED]

Starting program: /usr/local/bin/st st

Ah, yeah, what's that?


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

Offline

#21 2020-12-18 22:45:42

seth
Member
Registered: 2012-09-03
Posts: 52,140

Re: DWM load but keyboard does not respond [SOLVED]

If the answer to Trilbys question is "a typo", you wanted to enter "bt" in gdb after the segfault ;-)

Otherwise check

strace st

Offline

#22 2020-12-19 00:15:12

picaso127
Member
Registered: 2020-12-15
Posts: 18

Re: DWM load but keyboard does not respond [SOLVED]

Trilby wrote:

Starting program: /usr/local/bin/st st

Ah, yeah, what's that?

Sorry, typo.
Just remove the st from the end of the line and you will get my result.

Offline

#23 2020-12-19 00:42:47

picaso127
Member
Registered: 2020-12-15
Posts: 18

Re: DWM load but keyboard does not respond [SOLVED]

seth wrote:

If the answer to Trilbys question is "a typo", you wanted to enter "bt" in gdb after the segfault ;-)

Otherwise check

strace st

The result of running bt was:

 No stack. 

And the result of running strace st was

http://ix.io/2ICG

How do I find the cause of the error in the last line?

Offline

#24 2020-12-19 00:52:56

picaso127
Member
Registered: 2020-12-15
Posts: 18

Re: DWM load but keyboard does not respond [SOLVED]

tucuxi wrote:

Did you see anything unusual when you built st?

I didn't see anything suspicious.

build output:

CFLAGS  = -I/usr/X11R6/include  -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include   -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include  -DVERSION="0.8.4" -D_XOPEN_SOURCE=600  -O1
LDFLAGS = -L/usr/X11R6/lib -lm -lrt -lX11 -lutil -lXft  -lfontconfig -lfreetype   -lfreetype  
CC      = c99
c99 -I/usr/X11R6/include  `pkg-config --cflags fontconfig`  `pkg-config --cflags freetype2` -DVERSION=\"0.8.4\" -D_XOPEN_SOURCE=600  -O1 -c st.c
c99 -I/usr/X11R6/include  `pkg-config --cflags fontconfig`  `pkg-config --cflags freetype2` -DVERSION=\"0.8.4\" -D_XOPEN_SOURCE=600  -O1 -c x.c
c99 -o st st.o x.o -L/usr/X11R6/lib -lm -lrt -lX11 -lutil -lXft  `pkg-config --libs fontconfig`  `pkg-config --libs freetype2`

install output:

mkdir -p /usr/local/bin
cp -f st /usr/local/bin
chmod 755 /usr/local/bin/st
mkdir -p /usr/local/share/man/man1
sed "s/VERSION/0.8.4/g" < st.1 > /usr/local/share/man/man1/st.1
chmod 644 /usr/local/share/man/man1/st.1
tic -sx st.info
7 entries written to /usr/share/terminfo
Please see the README file regarding the terminfo entry of st.

Offline

#25 2020-12-19 02:18:05

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

Re: DWM load but keyboard does not respond [SOLVED]

picaso127 wrote:
Trilby wrote:

Starting program: /usr/local/bin/st st

Ah, yeah, what's that?

Sorry, typo.
Just remove the st from the end of the line and you will get my result.

That doesn't address the problem.  /usr/bin/st can come from the AUR package.  /usr/local/bin/st is something else entirely.  What is it?  Where does it come from?  How was it built?  Why was it built?

It seems you are building st and installing it manually.  Is there a reason for this?  Why not use a PKGBUILD?  This is a bit tangential in hindsight as /usr/local/bin/st does seem to be a valid / actual build of st, but I wanted to rule out some odd wrapper higher in PATH than an actual /usr/bin/st - that's not the case, which is good, but still a curiosity why you don't use a PKGBUILD to make a proper package.

Last edited by Trilby (2020-12-19 02:20:38)


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

Offline

Board footer

Powered by FluxBB