You are not logged in.
:MonsterWM is great. and bar is great and should be default
Offline
Here are some stats for monsterwm.c
535 core
580 master
607 xinerama-core
655 xinerama-master
I'm thinking on merging the two core and master branches, so that I dont
have to maintain both non-xinerama and xinerama-enabled versions.
The merge would add a XINERAMA flag in the Makefile, so that:
- If one sets XINERAMA and has extra monitors, then xinerama
will be up and working (like xinerama-* with many monitors).
- If one sets XINERAMA and has no extra monitors, then xinerama will be
up and working with only one monitor (xinerama-* with one monitor)
- If one unsets XINERAMA and has extra monitors, then all monitors are treated as one big
screen (xinerama knows the borders of each screen) (core/master with many monitors).
- If one unsets XINERAMA and has no extra monitors, then monsterwm
works like current core/master with one monitor.
After the merge, core and master will be xinerama-enabled by default. The stats with the XINERAMA flag will be:
615 core (with xinerama flag) +80 from old core
663 master (with xinerama flag) +83 from old master
748 total - master (with xinerama flag) monsterwm.c + config.def.h
750sloc with 4 layouts and xinerama is pretty good I'd say
------------------------
anyway, I wont do it non-xinerama enabled core might be usefull for screens other than PCs (ie small boards etc).
here's the patch to have XINERAMA flag on Makefile.
applied to xinerama-{core,master} will make the code work even if Xinerama is not there.
the anonymous struct (info var) makes the whole trick for initialization.
diff --git a/Makefile b/Makefile
index 3c5f25e..87a3e5c 100644
--- a/Makefile
+++ b/Makefile
@@ -10,11 +10,12 @@ MANPREFIX = ${PREFIX}/share/man
X11INC = -I/usr/X11R6/include
X11LIB = -L/usr/X11R6/lib -lX11
XINERAMALIB = -lXinerama
+XINERAMAFLAG = -DXINERAMA
INCS = -I. -I/usr/include ${X11INC}
LIBS = -L/usr/lib -lc ${X11LIB} ${XINERAMALIB}
-CFLAGS = -std=c99 -pedantic -Wall -Wextra ${INCS} -DVERSION=\"${VERSION}\"
+CFLAGS = -std=c99 -pedantic -Wall -Wextra ${INCS} -DVERSION=\"${VERSION}\" ${XINERAMAFLAG}
LDFLAGS = ${LIBS}
CC = cc
diff --git a/monsterwm.c b/monsterwm.c
index d9c7ea8..eb94421 100644
--- a/monsterwm.c
+++ b/monsterwm.c
@@ -12,7 +12,9 @@
#include <X11/XKBlib.h>
#include <X11/Xproto.h>
#include <X11/Xatom.h>
+#ifdef XINERAMA
#include <X11/extensions/Xinerama.h>
+#endif
#define LENGTH(x) (sizeof(x)/sizeof(*x))
#define CLEANMASK(mask) (mask & ~(numlockmask | LockMask))
@@ -1119,13 +1121,16 @@ void setup(void) {
root = RootWindow(dis, screen);
/* initialize monitors and desktops */
+#ifdef XINERAMA
XineramaScreenInfo *info = XineramaQueryScreens(dis, &nmonitors);
+ if (!nmonitors || !info) errx(EXIT_FAILURE, "Xinerama is not active");
+#else
+ struct { int x_org, y_org, width, height; } info[(nmonitors = 1)];
+ info[0] = { 0, 0, DisplayWidth(dis, screen), DisplayHeight(dis, screen) };
+#endif
- if (!nmonitors || !info)
- errx(EXIT_FAILURE, "Xinerama is not active");
if (!(monitors = calloc(nmonitors, sizeof(Monitor))))
err(EXIT_FAILURE, "cannot allocate monitors");
-
for (int m = 0; m < nmonitors; m++) {
monitors[m] = (Monitor){ .next = (m+1 < nmonitors) ? &monitors[m+1]:NULL,
.x = info[m].x_org, .y = info[m].y_org,
@@ -1133,7 +1138,10 @@ void setup(void) {
for (unsigned int d = 0; d < DESKTOPS; d++)
monitors[m].desktops[d] = (Desktop){ .mode = DEFAULT_MODE, .sbar = SHOW_PANEL };
}
+
+#ifdef XINERAMA
XFree(info);
+#endif
/* get color for focused and unfocused client borders */
win_focus = getcolor(FOCUS, screen);
maybe I should include that to xinerama-*, dunno ..
Last edited by c00kiemon5ter (2012-07-24 10:01:43)
.:[ git me! ] :.
Offline
Hi there,
Downloaded the initlayouts branch sources today. I modified configs by copying config.def.h to config.h.
But there is something I don't understand. I'm french and my keyboard layout is a bit strange (azerty).
I try to modify the keys for DESKTOPCHANGE as I do on dwm ( https://github.com/Ypnose/Madfiles/blob … frkey.diff ) but it doesn't work.
Even tried with xev, but it changes nothing.
Could you help me?
I'm not sure I can tell why that works with dwm and not monsterwm.
Looking at the dwm source, the keysyms are read the same way.
With my kbd layout (qwerty/greek), if I replace XK_b with 0x7e2 or XK_Greek_beta, neither monsterwm nor dwm works with it.
.:[ git me! ] :.
Offline
:MonsterWM is great. and bar is great and should be default
That's against the philosophy behind monsterwm.
Offline
I'm not sure I can tell why that works with dwm and not monsterwm.
Looking at the dwm source, the keysyms are read the same way.With my kbd layout (qwerty/greek), if I replace XK_b with 0x7e2 or XK_Greek_beta, neither monsterwm nor dwm works with it.
Hum that's weird.
I would like to bind this keys (with ALT):
If I press "1 / &" keys, xev says 'ampersand', I write XK_ampersand in config.h as below:
DESKTOPCHANGE( XK_ampersand, 0)
but it doesn't work.
Offline
alright, '&' here is 'Shift+7', so trying out different combinations:
{ MOD1|SHIFT, XK_ampersand, togglepanel, {NULL}}, /* failed */
{ MOD1, XK_ampersand, togglepanel, {NULL}}, /* failed */
{ MOD1|SHIFT, XK_7, togglepanel, {NULL}}, /* works! */
can you try with different such combinations ? I suspect it has to do with how modifiers are treated.
simon.swe wrote::MonsterWM is great. and bar is great and should be default
That's against the philosophy behind monsterwm.
I mostly stand behind the idea of do one thing, and do it well.
A window manager should manage windows; not draw text or icons, present menus etc.
Having no builtin panel, gives you the ability to choose what software you want to use to get things done.
Last edited by c00kiemon5ter (2012-07-24 14:48:07)
.:[ git me! ] :.
Offline
Offline
Ok but is there a way I can just use ALT + another key for DESKTOPCHANGE?
About patch I posted, codes like 0x26 are in the keysymdef.h.
#define XK_ampersand 0x0026
If I use these codes + ALT in my config.h, I don't get why it doesn't work.
Example:
{ MOD1, 0x26, togglepanel, {NULL}},
Added line #include "X11/keysymdef.h" in config.h, it failed too.
Last edited by Ypnose (2012-07-24 17:26:00)
Offline
alright, '&' here is 'Shift+7', so trying out different combinations:
{ MOD1|SHIFT, XK_ampersand, togglepanel, {NULL}}, /* failed */ { MOD1, XK_ampersand, togglepanel, {NULL}}, /* failed */ { MOD1|SHIFT, XK_7, togglepanel, {NULL}}, /* works! */
can you try with different such combinations ? I suspect it has to do with how modifiers are treated.
kalle97 wrote:simon.swe wrote::MonsterWM is great. and bar is great and should be default
That's against the philosophy behind monsterwm.
I mostly stand behind the idea of do one thing, and do it well.
A window manager should manage windows; not draw text or icons, present menus etc.
Having no builtin panel, gives you the ability to choose what software you want to use to get things done.
You are right
Offline
How about the systray?
Do everybody use it? I can't use fbpanel with monsterwm. It doesn't show. I also can't find any patch (like systray patch in dwm) for this.
Any suggestion?
P/s Sorry if this post is in wrong place and my bad english.
Just come from dwm.
[github]
Offline
No, _everybody_ certantly dosen't use a systray!
There's no patches for monsterwm, but there's however different branches with different functionality... Check out the arch wiki article about monsterwm + of course it' github readme page.
If you want a systray, then i've seen others recommending stalonetray
Offline
No, _everybody_ certantly dosen't use a systray!
There's no patches for monsterwm, but there's however different branches with different functionality... Check out the arch wiki article about monsterwm + of course it' github readme page.
If you want a systray, then i've seen others recommending stalonetray
I got it. I have read about branches when i started with monsterwm. I thought it like a patch. Sorry for my mistake.
Thanks, I haven't use systray for a long time. Today I just want to try monsterwm with tray because my friend ask me about that .
[github]
Offline
I got it. I have read about branches when i started with monsterwm. I thought it like a patch. Sorry for my mistake.
Thanks, I haven't use systray for a long time. Today I just want to try monsterwm with tray because my friend ask me about that .
I did systray code for Pandora, when I forked monsterwm for it.
I don't have any patches or so now, but the code is here https://gist.github.com/2400943.
I think it's possible to use application like trayer or so as well, but I don't like them much.
Offline
I remember that it was possible to run subtle on top of xmonad. So I tried to run subtle in monsterwm. And it worked. So.. it must be possible to use the subtle statusbar(it is but not so functional to monsterwm).
Offline
I'm having a problem. In monocle mode with 3 or more windows open, when I go to switch windows, it starts flickering and I lose control. It's firefox and two terminals or three terminals. It doesn't happen with two windows. I hacked up my config.h quite a bit and rather quickly, so maybe it's something here on my part. Anybody else experiencing this? Thanks
edit: actually it only happens when I use next_win, which is MOD4+k for me (I have MOD4+j for prev_win). Backwards, I know.
Last edited by stlarch (2012-07-27 20:16:47)
Offline
I'm having a problem. In monocle mode with 3 or more windows open, when I go to switch windows, it starts flickering and I lose control. It's firefox and two terminals or three terminals. It doesn't happen with two windows. I hacked up my config.h quite a bit and rather quickly, so maybe it's something here on my part. Anybody else experiencing this? Thanks
edit: actually it only happens when I use next_win, which is MOD4+k for me (I have MOD4+j for prev_win). Backwards, I know.
Your problem sounds pretty weird. I can't seem to re-produce your problem with MOD4 + j/k. I opened firefox and 2 terminals (urxvts) in monocle mode in another desktop.
Here's my config.def.h if it helps you to trace the issue:
/* see LICENSE for copyright and license */
#ifndef CONFIG_H
#define CONFIG_H
/** buttons **/
#define MOD1 Mod1Mask /* ALT key */
#define MOD4 Mod4Mask /* Super key */
#define CTRL ControlMask /* Control key */
#define SHIFT ShiftMask /* Shift key */
/** generic settings **/
#define MASTER_SIZE 0.56
#define SHOW_PANEL True
#define TOP_PANEL True
#define PANEL_HEIGHT 15
#define DEFAULT_MODE TILE
#define ATTACH_ASIDE True
#define FOLLOW_MOUSE False
#define FOLLOW_WINDOW False
#define CLICK_TO_FOCUS False
#define BORDER_WIDTH 1
#define FOCUS "#dc7802"
#define UNFOCUS "#141414"
#define DESKTOPS 4
#define DEFAULT_DESKTOP 0
#define MINWSZ 25
/* open applications to specified desktop with specified mode.
* if desktop is negative, then current is assumed */
static const AppRule rules[] = { \
/* class desktop follow float */
{ "Pidgin", 1, False, True },
{ "Gimp", 2, False, False},
{ "thunar", -1, True, True },
{ "medit", -1, True, True },
{ "dwb", -1, True, True },
{ "mplayer2", -1, True, False },
{ "feh", -1, True, True },
{ "URXvt", -1, True, False },
{ "fbpanel", -1, True, True },
{ "PSX", -1, True, True },
{ "lxappearance", -1, True, True },
{ "Deadbeef", -1, True, True },
{ "nitrogen", -1, True, True },
{ "Snes9x-gtk", -1, True, True },
{ "file-roller", -1, True, True },
{ "7zFM", -1, True, True },
{ "wine", -1, True, True },
{ "winecfg", -1, True, True },
{ "Gpicview", -1, True, True },
{ "Transmission-gtk", -1, True, True },
};
/* helper for spawning shell commands */
#define SHCMD(cmd) {.com = (const char*[]){"/bin/sh", "-c", cmd, NULL}}
/** commands **/
static const char *menucmd[] = { "dmenu_run", "-fn", "Terminus 12", NULL};
static const char *filecmd[] = { "thunar", NULL };
static const char *termcmd[] = { "urxvtc", NULL };
static const char *webcmd[] = { "dwb", NULL };
static const char *lolicmd[] = { "lolictrl", NULL };
static const char *gtkmenucmd[] = { "mygtkmenu", "/home/shn/.menu", NULL };
#define DESKTOPCHANGE(K,N) \
{ MOD1, K, change_desktop, {.i = N}}, \
{ MOD1|ShiftMask, K, client_to_desktop, {.i = N}},
/** Shortcuts **/
static Key keys[] = {
/* modifier key function argument */
{ MOD1, XK_p, spawn, {.com = menucmd}},
{ CTRL, XK_p, spawn, {.com = gtkmenucmd}},
{ MOD1, XK_1, spawn, {.com = webcmd}},
{ MOD1, XK_3, spawn, {.com = filecmd}},
{ MOD1|SHIFT, XK_Return, spawn, {.com = termcmd}},
{ MOD1, XK_b, togglepanel, {NULL}},
{ MOD1, XK_BackSpace, focusurgent, {NULL}},
{ MOD1|SHIFT, XK_c, killclient, {NULL}},
{ MOD1, XK_j, next_win, {NULL}},
{ MOD1, XK_k, prev_win, {NULL}},
{ MOD1, XK_h, resize_master, {.i = -5}}, /* decrease */
{ MOD1, XK_l, resize_master, {.i = +5}}, /* increase */
{ MOD1, XK_i, resize_stack, {.i = -10}}, /* shrink */
{ MOD1, XK_o, resize_stack, {.i = +10}}, /* grow */
{ MOD1|CTRL, XK_h, rotate, {.i = -1}},
{ MOD1|CTRL, XK_l, rotate, {.i = +1}},
{ MOD1|SHIFT, XK_h, rotate_filled, {.i = -1}},
{ MOD1|SHIFT, XK_l, rotate_filled, {.i = +1}},
{ MOD1, XK_Tab, last_desktop, {NULL}},
{ MOD1, XK_m, swap_master, {NULL}},
{ MOD1|SHIFT, XK_j, move_down, {NULL}},
{ MOD1|SHIFT, XK_k, move_up, {NULL}},
{ MOD1|SHIFT, XK_t, switch_mode, {.i = TILE}},
{ MOD1|SHIFT, XK_m, switch_mode, {.i = MONOCLE}},
{ MOD1|SHIFT, XK_b, switch_mode, {.i = BSTACK}},
{ MOD1|SHIFT, XK_g, switch_mode, {.i = GRID}},
{ MOD1|SHIFT, XK_f, switch_mode, {.i = FLOAT}},
{ MOD1|CTRL, XK_r, quit, {.i = 0}}, /* quit with exit value 0 */
{ MOD1|CTRL, XK_q, quit, {.i = 1}}, /* quit with exit value 1 */
{ CTRL, XK_Down, moveresize, {.v = (int []){ 0, 20, 0, 0 }}}, /* move up */
{ CTRL, XK_Up, moveresize, {.v = (int []){ 0, -20, 0, 0 }}}, /* move down */
{ CTRL, XK_Right, moveresize, {.v = (int []){ 20, 0, 0, 0 }}}, /* move right */
{ CTRL, XK_Left, moveresize, {.v = (int []){ -20, 0, 0, 0 }}}, /* move left */
{ CTRL|SHIFT, XK_Down, moveresize, {.v = (int []){ 0, 0, 0, 20 }}}, /* height grow */
{ CTRL|SHIFT, XK_Up, moveresize, {.v = (int []){ 0, 0, 0, -20 }}}, /* height shrink */
{ CTRL|SHIFT, XK_Right, moveresize, {.v = (int []){ 0, 0, 20, 0 }}}, /* width grow */
{ CTRL|SHIFT, XK_Left, moveresize, {.v = (int []){ 0, 0, -20, 0 }}}, /* width shrink */
DESKTOPCHANGE( XK_F1, 0)
DESKTOPCHANGE( XK_F2, 1)
DESKTOPCHANGE( XK_F3, 2)
DESKTOPCHANGE( XK_F4, 3)
};
static Button buttons[] = {
{ MOD1, Button1, mousemotion, {.i = MOVE}},
{ MOD1, Button3, mousemotion, {.i = RESIZE}},
{ CTRL, Button3, spawn, {.com = gtkmenucmd}},
};
#endif
EDIT. Your problem feels similiar to my problem I had before with CLICK_TO_FOCUS or FOLLOW_MOUSE.
Last edited by Shinryuu (2012-07-27 20:23:18)
Offline
Thanks Shinryuu, it was FOLLOW_MOUSE. I've set it to False for now.
Last edited by stlarch (2012-07-27 20:33:55)
Offline
Probably more of a urxvt issue than a monsterwm one but is anyone having problems with the focus / unfocus border rendering with urxvt? Every single other program works fine with it.. Anyone have a solution for this (aside from switch terminals ) ?
borders being displayed correctly (green & grey)
urxvt only renders blue and slightly lighter blue borders
the compositor isn't causing the problem, I disabled it here
Here are my configs..
.Xresources
.config.h
Offline
I have no problems with urxvt here. The only difference I can spot is that you are using true transparency with depth option. Try without them or without depth option and see it it affects the border coloring
Here's my urxvt settings
# Shinryuu's config
# Colors
*foreground: #ebebeb
*background: #121212
!black
*color0: #1C1C1C
*color8: #4d4d4d
!red
*color1: #D81860
*color9: #F00060
!green
*color2: #B7CE42
*color10: #BDE077
!yellow
*color3: #FEA63C
*color11: #FFE863
!blue
*color4: #66AABB
*color12: #AACCBB
!magenta
*color5: #B7416E
*color13: #BB4466
!cyan
*color6: #5E7175
*color14: #A3BABF
!white
*color7: #DDEEDD
*color15: #6C887A
urxvt.colorBD: #857672
urxvt.colorIT: #bbbbbb
urxvt.colorUL: #999999
# Settings
urxvt*termName: screen-256color
urxvt*scrollBar: false
urxvt.font: -*-terminusmodx-medium-r-*-*-12-*-*-*-*-*-*-*
urxvt*boldFont: -*-terminusmod-bold-r-*-*-12-*-*-*-*-*-*-*
# Clickable URLs
urxvt.perl-ext-common: default,matcher
urxvt.urlLauncher: dwb
urxvt.matcher.button: 1
urxvt.underlineURLs: true
Last edited by Shinryuu (2012-07-28 09:50:25)
Offline
Thanks Shinryuu, it was FOLLOW_MOUSE. I've set it to False for now.
For the reference, this was the problem I had before https://bbs.archlinux.org/viewtopic.php … 5#p1077355 scroll a bit down to see cookieboys answer
Offline
I have no problems with urxvt here. The only difference I can spot is that you are using true transparency with depth option. Try without them or without depth option and see it it affects the border coloring
Here's my urxvt settings
# Shinryuu's config # Colors *foreground: #ebebeb *background: #121212 !black *color0: #1C1C1C *color8: #4d4d4d !red *color1: #D81860 *color9: #F00060 !green *color2: #B7CE42 *color10: #BDE077 !yellow *color3: #FEA63C *color11: #FFE863 !blue *color4: #66AABB *color12: #AACCBB !magenta *color5: #B7416E *color13: #BB4466 !cyan *color6: #5E7175 *color14: #A3BABF !white *color7: #DDEEDD *color15: #6C887A urxvt.colorBD: #857672 urxvt.colorIT: #bbbbbb urxvt.colorUL: #999999 # Settings urxvt*termName: screen-256color urxvt*scrollBar: false urxvt.font: -*-terminusmodx-medium-r-*-*-12-*-*-*-*-*-*-* urxvt*boldFont: -*-terminusmod-bold-r-*-*-12-*-*-*-*-*-*-* # Clickable URLs urxvt.perl-ext-common: default,matcher urxvt.urlLauncher: dwb urxvt.matcher.button: 1 urxvt.underlineURLs: true
You were right thanks. I should have tried that... Sucks that I won't be able to use true transparency oh well thanks though.
Offline
For the reference, this was the problem I had before https://bbs.archlinux.org/viewtopic.php … 5#p1077355 scroll a bit down to see cookieboys answer
Thanks. It seems I vaguely remember this from before. My memory is about as short as my you know what these days. I think it's the onset of oldtimers. I shouldn't even joke about that. Anyway, I can't remember why I wanted that enabled either. (probably something with firefox?) It works great with it set to false though and solved a couple other things I was noticing too so I'll just leave it disabled.
There are a couple other things I noticed. When I have a terminal open in say monocle and switch to floating, part of the border goes slightly off the screen and when switching from floating to any other layout requires me to hit the key combo a second time for the change to take effect. Neither are a big deal at all to me since i rarely use floating mode (other than for screenshots).
Offline
When you are in a monocle mode, you have no borders and when you switch back to anything else like floating mode, you get borders That's explains the behaviour you are experiencing so it should be normal.
But.. I also experience the thing that you have to press the button two times when you want to change your layout mode. I'm not sure but I feel there might be an answer for that in this thread. For some reason I feel it's most likely normal to have that behaviour.
Offline