You are not logged in.

#676 2015-10-17 13:58:33

frash23
Member
From: Denmark
Registered: 2014-03-26
Posts: 49
Website

Re: dminiwm snapwm & bipolarbar

Hey, me again.

When I launch some Java programs, they seem to just kind of hang. Nothing in the terminal or anything.
The best I can trace this down to is whatever is going on in this thread.

Logging out and launching LXDE just to run IntelliJ is annoying (and using a floating WM really doesn't sit well with me).
Do you know if there's an easy fix for this?

Thanks,
frash23


Amateur web developer & Linux enthusiast

Offline

#677 2015-10-17 20:14:39

moetunes
Member
From: A comfortable couch
Registered: 2010-10-09
Posts: 1,033

Re: dminiwm snapwm & bipolarbar

Hi frash23

I don't use any java apps so I haven't had to sort this out.
This thread seems to get to the point of the issue
I'll paraphrase it:
Your java programs work in LXDE because openbox is a reparenting wm(has titlebars,close button etc) which java expects.

With programs that use openjdk setting /etc/profile/jre.sh to include:

export _JAVA_AWT_WM_NONREPARENTING=1

helps with tilers apparently.

You also need to set the window manager name to LG3D for some reason...
Evidently there can be issues when using the wmname program from [community] to do this so there's this script to do that job.
Have it run from .xinitrc and you should be ok with the java programs.

Cheers


You're just jealous because the voices only talk to me.

Offline

#678 2015-10-17 21:24:49

frash23
Member
From: Denmark
Registered: 2014-03-26
Posts: 49
Website

Re: dminiwm snapwm & bipolarbar

That seems to fix it, thanks a lot!


Amateur web developer & Linux enthusiast

Offline

#679 2015-11-15 21:11:46

moetunes
Member
From: A comfortable couch
Registered: 2010-10-09
Posts: 1,033

Re: dminiwm snapwm & bipolarbar

Some snapwm news.

I've made a man page for snapwm which forced me to tidy a couple of things up. The one that could cause frustration is the change to a modifying key in key.conf. For consistency ALTSuper is now AltSuper.

Cheers


You're just jealous because the voices only talk to me.

Offline

#680 2015-11-21 09:01:06

moetunes
Member
From: A comfortable couch
Registered: 2010-10-09
Posts: 1,033

Re: dminiwm snapwm & bipolarbar

Some snapwm news.

Making the man page has given me a couple of ideas.
Apologies for that.

A right click on the bar can now run a command set in key.conf.

sample.key.conf wrote:

# Right click on the bar to run a command
# "barrtclickcmd" is hardcoded so case matters e.g.
#    CMD barrtclickcmd;dmenu;NULL;

barrtclickcmd can also be run from a keyboard shortcut with spawn as the function.
I was thinking something like a menu but there's no restrictions on it.
If you don't need it don't set it.

Cheers

Last edited by moetunes (2015-11-21 09:13:52)


You're just jealous because the voices only talk to me.

Offline

#681 2015-11-23 12:16:32

moetunes
Member
From: A comfortable couch
Registered: 2010-10-09
Posts: 1,033

Re: dminiwm snapwm & bipolarbar

Some snapwm news.

Some bugfixes:
Using Alt with snapwm-stable wasn't working.
The window wasn't unmapping with client_to_desktop.
In fullscreen mode with the only open window popped the wm crashed sometimes unpopping it.

Cheers


You're just jealous because the voices only talk to me.

Offline

#682 2015-11-24 05:29:23

moetunes
Member
From: A comfortable couch
Registered: 2010-10-09
Posts: 1,033

Re: dminiwm snapwm & bipolarbar

Some snapwm news.

Windows can now be stickied on multiple desktops with a keyboard shortcut.

sample.key.conf wrote:

#
KEY CtrlSuper;1;sticky_win;1;
KEY CtrlSuper;2;sticky_win;2;
KEY CtrlSuper;3;sticky_win;3;
KEY CtrlSuper;4;sticky_win;4;
KEY CtrlSuper;5;sticky_win;5;
KEY CtrlSuper;6;sticky_win;6;
KEY CtrlSuper;7;sticky_win;7;
KEY CtrlSuper;8;sticky_win;8;
KEY CtrlSuper;9;sticky_win;9;
KEY CtrlSuper;0;sticky_win;10;
#
KEY CtrlSuper;q;unsticky_win;
#

If the window only needs to be removed from the current desktop unsticky it rather then closing it.

Cheers

Last edited by moetunes (2015-11-24 17:37:06)


You're just jealous because the voices only talk to me.

Offline

#683 2015-12-10 10:25:05

moetunes
Member
From: A comfortable couch
Registered: 2010-10-09
Posts: 1,033

Re: dminiwm snapwm & bipolarbar

Some snapwm news.

I had a few windows open in stacking mode and wanted an easy way to swap between two of them so there's now an option for a keyboard shortcut to focus the last focused window.

sample.key.conf wrote:

KEY Super;Tab;last_win;

Since there's only the next/previous windows that can be focused with the keyboard it needs a window to be focused with the mouse to be useful.
If you don't need it don't set it.

Cheers


You're just jealous because the voices only talk to me.

Offline

#684 2016-01-27 18:55:09

moetunes
Member
From: A comfortable couch
Registered: 2010-10-09
Posts: 1,033

Re: dminiwm snapwm & bipolarbar

Some snapwm news.

Fixed an issue where in fullscreen mode transient windows would show then disappear. It only happened on 1 out of 4 computers here so it was a bit of a funny one to sort out...

Cheers


You're just jealous because the voices only talk to me.

Offline

#685 2016-06-01 19:30:57

moetunes
Member
From: A comfortable couch
Registered: 2010-10-09
Posts: 1,033

Re: dminiwm snapwm & bipolarbar

snapwm-stable is up to date with snapwm now and I haven't come up with anything else to add to it for a while. it's been doing it's job well here.
Might be time to start trimming it a bit...

Cheers


You're just jealous because the voices only talk to me.

Offline

#686 2016-07-25 00:48:23

frash23
Member
From: Denmark
Registered: 2014-03-26
Posts: 49
Website

Re: dminiwm snapwm & bipolarbar

SnapWM seems to crash in some rare edge cases, usually involving programs that try to do something weird with how they create / handle windows (mostly Java and Wine stuff). I haven't really been able to find a good way to replicate the issue, it happens to me once per week or so.

This isn't a huge issue. I've made it so the X server stays up on a SnapWM crash which lets me close most of my applications gracefully, though I cannot reach the ones in other desktops.

Would it be possible for SnapWM to "reclaim" running windows from a previous, crashed session? That way running SnapWM in a loop would mostly solve the issue.

Other than that, I haven't had any real issues except for one little thing: In floating mode, some programs will start as a 1x1 window, which can be hard to get a hold of - would it be possible to add a configuration option to set minimum width/height of windows in floating mode?


Thanks,
frash23


Amateur web developer & Linux enthusiast

Offline

#687 2016-07-27 20:32:58

moetunes
Member
From: A comfortable couch
Registered: 2010-10-09
Posts: 1,033

Re: dminiwm snapwm & bipolarbar

Sorry for the slow reply.

I've been thinking for a little while now that I could make it easier to start applications from .xinitrc by having snapwm look for apps already running. That would help with your issue too.

I'd rather have it so the wm doesn't crash at all so if you get a batter idea of what causes it let me know.

Adding a minimum size for windows to open at shouldn't be too hard, testing it on my end will be an issue since I don't have a program that doesn't work properly in snapwm.... But I'll come up with something, give me a couple of days.

Cheers


You're just jealous because the voices only talk to me.

Offline

#688 2016-07-28 07:02:54

moetunes
Member
From: A comfortable couch
Registered: 2010-10-09
Posts: 1,033

Re: dminiwm snapwm & bipolarbar

That wasn't so hard....

There's are new options in rc.conf to set the minimum width and height for all windows in stacking mode

sample.rc.conf wrote:

...
#MINW_W 30
#MINW_H 30
...

If it's not needed don't set it.

snapwm should now find any open windows when it starts too.

It took a bit of work to sort out what windows were ok to map so if there's any programs that used to work and now don't let me know...

Cheers


You're just jealous because the voices only talk to me.

Offline

#689 2016-07-28 19:21:59

frash23
Member
From: Denmark
Registered: 2014-03-26
Posts: 49
Website

Re: dminiwm snapwm & bipolarbar

Minimum window size works like a charm! This'll save some time and frustration smile
I haven't run into any programs that no longer work.

The window recovery thing sort of work. It throws a segfault if there are any "odd" windows (i.e. Java AWT applications), and seems to create some sort of dummy window for each. Closing some of the dummy window crashes SnapWM.
Moving the dummy windows to a unused workspace sort of solves the issue, and makes recovering from a crash possible.


Amateur web developer & Linux enthusiast

Offline

#690 2016-08-01 00:37:34

moetunes
Member
From: A comfortable couch
Registered: 2010-10-09
Posts: 1,033

Re: dminiwm snapwm & bipolarbar

I didn't really think that would be the end of the story...
I used this win2.java program to test what happens with java awt windows:

import java.awt.*;
import java.awt.event.*;

public class win2 {

   private Frame mainFrame;
   private Label headerLabel;
   private Label statusLabel;
   private Panel controlPanel;

   public win2(){
      prepareGUI();
   }

   public static void main(String[] args){
      win2  win2_1 = new win2();
      win2_1.showEventDemo();
   }

   private void prepareGUI(){
      mainFrame = new Frame("WOOT");
      mainFrame.setSize(400,400);
      mainFrame.setLayout(new GridLayout(3, 1));
      mainFrame.addWindowListener(new WindowAdapter() {
         public void windowClosing(WindowEvent windowEvent){
            System.exit(0);
         }        
      });    
      headerLabel = new Label();
      headerLabel.setAlignment(Label.CENTER);
      statusLabel = new Label();        
      statusLabel.setAlignment(Label.CENTER);
      statusLabel.setSize(350,100);

      controlPanel = new Panel();
      controlPanel.setLayout(new FlowLayout());

      mainFrame.add(headerLabel);
      mainFrame.add(controlPanel);
      mainFrame.add(statusLabel);
      mainFrame.setVisible(true);  
   }

   private void showEventDemo(){
      headerLabel.setText("Control in action: Button"); 

      Button okButton = new Button("OK");
      Button submitButton = new Button("Submit");
      Button cancelButton = new Button("Cancel");

      okButton.setActionCommand("OK");
      submitButton.setActionCommand("Submit");
      cancelButton.setActionCommand("Cancel");

      okButton.addActionListener(new ButtonClickListener()); 
      submitButton.addActionListener(new ButtonClickListener()); 
      cancelButton.addActionListener(new ButtonClickListener()); 

      controlPanel.add(okButton);
      controlPanel.add(submitButton);
      controlPanel.add(cancelButton);       

      mainFrame.setVisible(true);  
   }

   private class ButtonClickListener implements ActionListener{
      public void actionPerformed(ActionEvent e) {
         String command = e.getActionCommand();  
         if( command.equals( "OK" ))  {
            statusLabel.setText("Ok Button clicked.");
         }
         else if( command.equals( "Submit" ) )  {
            statusLabel.setText("Submit Button clicked."); 
         }
         else  {
            statusLabel.setText("Cancel Button clicked.");
         }  	
      }		
   }
}

The extra window with java awt programs on start is an icon window. snapwm will ignore those now.
There is still a problem with gtk apps making an extra window on start. I'm using leafpad to check that.
I'm sure I'll have that sorted soon.

Cheers


You're just jealous because the voices only talk to me.

Offline

#691 2016-08-02 12:56:59

moetunes
Member
From: A comfortable couch
Registered: 2010-10-09
Posts: 1,033

Re: dminiwm snapwm & bipolarbar

That's all sorted now. snapwm finds windows ok on startup without any extra windows.
HTH

Cheers


You're just jealous because the voices only talk to me.

Offline

#692 2016-08-17 18:02:43

moetunes
Member
From: A comfortable couch
Registered: 2010-10-09
Posts: 1,033

Re: dminiwm snapwm & bipolarbar

Taking no news to be good news, I'll update snapwm-stable shortly to include the recent changes.

Cheers


You're just jealous because the voices only talk to me.

Offline

#693 2017-06-29 02:22:08

SolarAquarion
Member
Registered: 2014-05-18
Posts: 92

Re: dminiwm snapwm & bipolarbar

the pkgbuild was removed from the aur

Offline

#694 2017-06-29 19:20:32

moetunes
Member
From: A comfortable couch
Registered: 2010-10-09
Posts: 1,033

Re: dminiwm snapwm & bipolarbar

I'm pretty sure the pkgbuild has been gone for a while now.
I don't have a current arch install to make and test a new one.
If someone would like to make a new one that'd be great.

Cheers


You're just jealous because the voices only talk to me.

Offline

#695 2017-08-13 02:46:01

moetunes
Member
From: A comfortable couch
Registered: 2010-10-09
Posts: 1,033

Re: dminiwm snapwm & bipolarbar

Some snapwm news.

Fixed up the windows from the first desktop being shown when updating and tidied up some code.

Cheers


You're just jealous because the voices only talk to me.

Offline

#696 2017-08-15 09:26:00

chickenPie4tea
Member
Registered: 2012-08-21
Posts: 309

Re: dminiwm snapwm & bipolarbar

hi, still using snapwm,  I have a request but it's not a biggie and understand if you don't see the point of it smile
In rc.conf  the  STATUSTHEME  colors settings ;the text color of clock and unfocused desktop have to be set the same.  I would love it if I could have them different colours smile
Reason being I like to have the text colour of the unfocused desktops to be less visable, mid gray but would like to see the clock output easier.

Last edited by chickenPie4tea (2017-08-15 09:27:18)


You can like linux without becoming a fanatic!

Offline

#697 2017-08-15 19:32:34

moetunes
Member
From: A comfortable couch
Registered: 2010-10-09
Posts: 1,033

Re: dminiwm snapwm & bipolarbar

Hi,
snapwm doesn't have a clock so I guess the clock must be in a script you run to show info in the bar.
Nothing else is set to use the font colour for the unfocused desktop but you can use that colour in a script.
In your script before the clock there'll be a &2, change it to &3 (or something else) and see if that helps.

Cheers


You're just jealous because the voices only talk to me.

Offline

#698 2017-10-02 00:25:13

moetunes
Member
From: A comfortable couch
Registered: 2010-10-09
Posts: 1,033

Re: dminiwm snapwm & bipolarbar

Some snapwm news.

Fixed up the popped window still being visible after sending it to another desktop.

Cheers

Last edited by moetunes (2017-11-29 17:55:34)


You're just jealous because the voices only talk to me.

Offline

#699 2019-03-15 22:22:33

moetunes
Member
From: A comfortable couch
Registered: 2010-10-09
Posts: 1,033

Re: dminiwm snapwm & bipolarbar

A random thing.

The right click button on my laptop died and I couldn't find an existing solution for mapping a key to be the right click, so I wrote a little program and mapped it to keys in snapwm. Now Super+z is middle click and Super+x is right click.

/* Build with gcc button_click.c -o button_click -lX11
   Usage : button_click 1    for left click
           button_click 2    for middle click
           button_click 3    for right click
*/
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>

void button_click(int button) {
    Display *display = XOpenDisplay(NULL);
    if(display == NULL) {
        puts("Display Fail");
        exit(1);
    }

    XEvent event;
    memset(&event, 0x00, sizeof(event));

    event.type = ButtonPress;
    event.xbutton.button = button;
    event.xbutton.same_screen = True;
    event.xbutton.subwindow = DefaultRootWindow (display);
    while (event.xbutton.subwindow) {
        event.xbutton.window = event.xbutton.subwindow;
        XQueryPointer (display, event.xbutton.window,
        &event.xbutton.root, &event.xbutton.subwindow,
        &event.xbutton.x_root, &event.xbutton.y_root,
        &event.xbutton.x, &event.xbutton.y,
        &event.xbutton.state);
    }

    if(XSendEvent(display, PointerWindow, True, ButtonPressMask, &event) == 0)
        puts("Button Click Fail");

    //puts("Button Clicked");
    XFlush(display);

    event.type = ButtonRelease;
    event.xbutton.state = 0x100;

    if(XSendEvent(display, PointerWindow, True, ButtonReleaseMask, &event) == 0)
        puts("Button Release Fail");

    XFlush(display);
    XCloseDisplay(display);
}

int main(int argc, char **argv) {
    int button = 3;
    if(argc < 2) {
        puts("Value Needed : 1, 2 or 3");
        exit(1);
    } else button = atoi(argv[1]);
    button = (button > 0) ? button : 3;
    button = (button < 4) ? button : 3;
    //printf("%d\n", button);
    button_click(button);

    exit(0);
}

Thought it might be handy for someone.

Cheers

Last edited by moetunes (2019-03-15 22:38:53)


You're just jealous because the voices only talk to me.

Offline

#700 2020-05-20 01:53:33

moetunes
Member
From: A comfortable couch
Registered: 2010-10-09
Posts: 1,033

Re: dminiwm snapwm & bipolarbar

Some snapwm news

An issue was brought up on github about snapwm crashing once the number of keyboard shortcuts reached a point.
That's been fixed.

Cheers


You're just jealous because the voices only talk to me.

Offline

Board footer

Powered by FluxBB