nnoell / neurowm

An extremely configurable, fast, dynamic tiling window manager for X

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NeuroWM fails to map to resolution on my moniter.

opened this issue · comments

Hello,

I compiled NeuroWM on Arch Linux successfully follow the instructions, and I was able to execute it as a window manger correctly as well.

However, when I tried to use NeuroWM as I have used AwesomeWM or Xmonad, NeuroWM does not map to my full resolution of my monitor. I have tried using both the default and custom configurations given, both yielding the same results. I am unable to take a screenshot of the issue as most keybinds fail to work for me. I have however created a, replica of how it looks like.

neurowm_error_replica

Please note, unlike the replica NeuroWM has no functionality for me. (e.g. I cannot open a terminal, or a web browser, etc.)

Peace.

Hi KamiIntelligence! nnoell here,

The issue you are having is quite interesting because I have tryied neurowm in many monitors with different screen resolutions and it works without problems.

Maybe I am missing something but, could you please tell me if you were able to launch the default terminal (xterm) with Mod+Shift+Return? bear in mind that "Mod" key is actually "Alt" key if you are using the default configuration (which is recomended if you are using neurowm for the first time). If you were able to launch xterm in neurowm, was xterm using the full screen resulution?

Other than that, how do you know that the window manager is not mapping the full screen? If you load my personal configuration, the status bars will be displayed with a fixed resolution of 1366x768 because it is specified in the config file, maybe that is why you think neurowm is not mapping the full screen resolution. If you want to use the panels with a higher resultion, you should change the settings in the configuration file. However, forget about my configuration file for now and use the default one which does not have pannels.

Try to do the following:

  • Exit X
  • Make sure xterm is installed in "/usr/bin/xterm"
  • Copy the default configuration file in ~/.neurowm directory
  • Compile it with "neurowm --recompile"
  • Launch neurowm
  • Try to launch xterm with Alt+Shift+Return.

If nothing comes up, I will upload a debugging version of neurowm that logs everything in a file in order to see what is wrong.

Hi nnoell, thank you for reply.

Perhaps I may have used the incorrect term to describe my problem, my apologies. I had no idea that the mod key was 'alt'. I tried again, under your instructions and did Mod + Shift + Return, using the default settings. Xterm did not launch, and I made sure xterm was installed.

Sorry, my mistake. I could not see any settings that specifically tied to resolutions in neurowm.c so I assumed it was dynamic. As you have ask, I have reverted to the default configuration file for now.

I tried your steps provided, and I still am unable to lunch any programs. Not sure if this is related or not, but my keyboard is not Qwerty styled, rather Colemak styled.

I appreciate the lengths you are going to find the cause of the issue. 👍

Thank you.

Hi KamiIntelligence, you are welcome!

It could be an issue with the Colemak layout, maybe the Mod Key code for that layout is different. However, before getting into this, It would be nice to make sure the window manager is working. I would suggest to try running neurowm inside another window manager and launch xterm externally into neurowm to see if neurowm works. In order to do that, you need to install "xorg-server-xephyr" package from extra. Once installed, you can open an X session inside your current X session. Here is an example of launching an X session with display ":1" and 1366x768 resultution (note the capital X):

$ Xephyr :1 -screen 1366x768

If there is no problem, A new window should come up with the new xorg session ready to be used. In order to run neurowm within ":1" session, you need to execute it changing the DISPLAY environment variable, like so:

$ DISPLAY=:1 /usr/bin/neurowm

Now neurowm should be running inside Xephyr. You can execute any kind of command by changing the DISPLAY variable as before. For example, to open xterm in :1 do:

$ DISPLAY=:1 /usr/bin/xterm

Now, can you see xterm in the new :1 xorg session managed by neurowm? if so, try to launch several xterm inside neurowm to see if it is managing the windows. If it is working, it is definitely a problem with the keyboard.

I think the you are not able to launch xterm with Mod-Shift-Return because the key codes for the Colemak layout are different to the UK layout. I have uploaded simple neurowm.c configuration file so you can change the keybinding of the window manager here: https://dl.dropboxusercontent.com/u/43104750/neurowm.c

Try to use this configuration file. As you can see the key binding for xterm terminal is now Alt+a, line 27:

static const Key key00[] = { { myModMask, XK_a, spawnN, {.com = termcmd} } };

myModMask is defined at the top of the file, line 9:

#define myModMask Mod1Mask

Mod1Mask is usually the "Alt" key and "Mod4Mask" is usually the windows key. If it does not work, try changing myModMask to Mod2Mask, Mod3Mask and Mod5Mask by uncomenting 10,11 and 13 lines individually. Dont forget to recompile when you make a change :P

Hello, sorry for the late reply, I am swamped with school work.

Using the configuration file you gave me; I am able to get neurowm to launch xterm.

Thank you.

(I hope it is not too much trouble to ask, but how do I set status bars to my resolution? I could not find anything in the Wiki on how to do this.)

Hi there,

You are welcome! I am really sorry for the lack of documentation, I am still working on that, it should be finished by the end of the year, I promisse :)

Before telling you how to change the resolution of the status bars, I will explain to you how the configuration file works so you can understand everything better.

Neurowm configuration file is similar to xmonad's, it is a source file where you must code the configuration and compile it to generate the binary that allows you to run the window manager. Strictly speaking, neurowm is a library to program your own window manager easily (like xmonad) but using C language instead of Haskell.

If you have a look at conf/nnoell_neurowm.c, you will see that the whole configuration is declared in "myWMConfig" structure (line 230). This structure has 13 fields:

  • defNormBorderColor //border color for normal windows
  • defCurrBorderColor //border color for the current windows
  • defPrevBorderColor //border color for the previous focused window
  • defFreeBorderColor //border color for free windows
  • myBorderWidth //border with for all windows
  • myBorderGap //border gap for all windows
  • myWorkspaceSet //workspace configuration
  • myRuleSet //rule configuration
  • myDzenPanelSet //dzen panel configuration
  • myKeys //key binding configuration
  • myButtons //mouse binding configuration
  • myStartUpHook //autostart configuration
  • myEndUpHook //autoend configuration

I use "my" prefix for my own configuration fields and "def" prefix for the default configuration fields (defined in neurowm/config.h). As you can see, the 4 border colors are loaded from the default configuration module. As an example, you can change the current border color by removing "defCurrBorderColor" and creating your own "myCurrBorderColor", like so:

#define myCurrBorderColor "#ffffff"

This will change the current border color to white. Bear in mind that C does not have string types so you must use macros (#define...) to asign a string literal to a pointer to char (char *). Just to let you know, the default colors are these:

#define defNormBorderColor "#1c1c1c"
#define defCurrBorderColor "#44aacc"
#define defPrevBorderColor "#444444"
#define defFreeBorderColor "#f7a16e"

And you can check them if you open neuro/config.c.

Regarding the status bars, neurowm uses a dzen module to draw the panels (like xmonad's DynamicLoc module) which is located in neuro/dzenpanel.c.

In order to configure the panels, you must code your own "myDzenPanelSet" in "myWMConfig" structure because the default configuration for that field is NULL (neuro/config.c line 65), which means no panels at all:

const DzenPanel *defDzenPanelSet[] = { NULL };

But wait! we have an example in conf/nnoell_neurowm.c that will show us how to configure the panels. The main structure (myWMConfig) has "myDzenPanelSet" which is declared in line 135:

static const DzenPanel *myDzenPanelSet[] = { topLeftPanel, topRightPanel, botLeftPanel, botRightPanel, NULL };

As you can see "myDzenPanelSet" is an array of panels; 4 panels in this example: top left panel, top right panel, bottom left panel and bottom right panel. You can add more panels if you want to by filling in the array. Bear in mind that the array must be NULL terminated so that neurowm can know when to stop reading.

Lets go to the definition of "topLeftPanel" (line 129):

static const DzenPanel topLeftPanel[] = { { topLeftDzenFlags, topLeftLoggers, " ", XEvDP } };

In neurowm, a panel is another structure which has 4 fields: flags, loggers, separator and refresh rate. This specific panel has the flags declared in "topLeftDzenFlags", the loggers in "topLeftLoggers", the separator set to " " and the refresh rate set to XEvDP.

  • The separator is a string that is printed between the loggers (date, time, cpu usage, etc...)
  • The refresh rate is an integer representing the number of seconds you want the panel to be updated. If it is 3, the panel will be updated every 3 seconds, if it is 1, the panel will be updated every second and so on. Also, you can use XEvDP to tell neurowm to update the panel each time an X event occurrs (ie, when you change from one workspace to another, when you open a window... ) which is very useful for panels that only display window manager info like current layout, window title, current workspace, etc....
  • The loggers are the "things" you want the panel to display. In this particular case, if you look at the definition of topLeftLoggers (line 114), you will see that the top left panel has 4 loggers:

static const Logger topLeftLoggers[] = { nnoellCurrLayoutLoggerP, nnoellCurrLayoutModLoggerP, nnoellCurrWSLoggerP, nnoellCurrTitleLoggerP, NULL };

  • nnoellCurrLayoutLoggerP prints the current layout in a "nnoell" format
  • nnoellCurrLayoutModLoggerP prints the current layout mod in a "nnoell" format
  • nnoellCurrWSLoggerP prints the current worspace in a "nnoell" format
  • nnoellCurrtitleLoggerP prints the title of the current window in a "nnoell" format

You can even create your own loggers (that is the advantage of having a configuration file writen in a programming language). You can check examples in neuro/personal.c if you feel like coding your own loggers :P

Finally, the last field of the panel is the dzen flags (topLeftDzenFlags), which is used to tell dzen what flags it should use when it is launched. Lets check the declaration of topLeftDzenFlags (line 113):

static const DzenFlags topLeftDzenFlags[] = { { 0, 0, 950, 16, NNOELL_colorWhiteAltP, NNOELL_colorBlackP, 'l', DZENPANELFONT, "onstart=lower", "-p" } };

As you can see, it is another structure with 10 fields: X position, Y position, width heigh, font color, background color, alignment, font, event and extras. Just to let you know, all structure definitions are defined in neuro/general.c and the definition for that one is:

typedef struct DzenFlags DzenFlags;
struct DzenFlags {
int x, y, w, h;
char *fgColor;
char *bgColor;
char align;
char *font;
char *event;
char *extras;
};

This panel is located at the top left corner of the screen because the X position is 0 and the Y position is 0. The width of the panel is 950 pixels, the height of the panel is 16px and it has left alignment because the alignment is set to 'l'.

As you can see, the 4 panels are configured for a 1366x768 screen resolution:

  • top left panel: X=0 Y=0 W=950 H=16
  • top right panel: X=950 Y=0 W=416 H=16
  • bottom left panel: X=0 Y=752 W=683 H=16
  • bottom right panel: X=683 Y= 752 W=683 H=16

because:

top-left-width + top-right-width = 950 + 416 = 1366
bot-left-width + bot-right-width = 683 + 683 = 1366
bot-left-Y + bot-left-height = 752 + 16 = 768
bot-right-Y + bot-right-height = 752 + 16 = 768

If you want to set the panels for a different resolution, you must change these values so that they fit your resolution.

Let me know if you are not able to set the position and dimension of the 4 panels for your resolution, and please, do not hesitate to contact me if you need further help.

Kind regards,

I got it to work, thank you. 👍