You are not logged in.

#226 2019-07-04 21:43:01

DeepDayze
Member
From: In Linux Land
Registered: 2017-05-28
Posts: 760

Re: jgmenu

Wow misko...that looks like some great work and Malm has to be amazed!


Real Men Use Linux

Offline

#227 2019-07-05 09:45:21

misko_2083
Member
Registered: 2016-05-24
Posts: 242

Re: jgmenu

^ https://www.youtube.com/watch?v=pYL6g_Dw_4U

I'm hoping when there are ways to integrate jgmenu into mainsteam panels, more people will contribute to this menu. Who knows, some future GUI to easily configure jgmenu would be very usefull and would work across the DE's and panels.
Useful for those distros that offer several DEs.
One menu to rule them all. devil

Jgmenu has advantages comparing to other menus in those panels.
Hope it will have an option to follow gtk/qt theming some day.

Offline

#228 2019-07-05 15:53:08

malm
jgmenu developer
Registered: 2016-10-13
Posts: 528
Website

Re: jgmenu

@misko awesome! I’ll be installing panels tonight to check this out.

Offline

#229 2019-07-05 15:58:10

DeepDayze
Member
From: In Linux Land
Registered: 2017-05-28
Posts: 760

Re: jgmenu

misko_2083 wrote:

^ https://www.youtube.com/watch?v=pYL6g_Dw_4U

I'm hoping when there are ways to integrate jgmenu into mainsteam panels, more people will contribute to this menu. Who knows, some future GUI to easily configure jgmenu would be very usefull and would work across the DE's and panels.
Useful for those distros that offer several DEs.
One menu to rule them all. devil

Jgmenu has advantages comparing to other menus in those panels.
Hope it will have an option to follow gtk/qt theming some day.

Yup, with such features jgmenu will be the biggest killer app  cool


Real Men Use Linux

Offline

#230 2019-07-14 11:29:52

malm
jgmenu developer
Registered: 2016-10-13
Posts: 528
Website

Re: jgmenu

@misko

The plugins seem to work fine provided:

  - we set "at_pointer = 1" in jgmenurc
  - launch using jgmenu_run

Let me attempt to explain how it works. For the purposes of terminology, I'll assumem we're using a horizontal panel.

  - Vertically we align to the edge of the panel by reading _NET_WORKAREA (a freedesktop EWMH root window property).
  - Horizontally we use the pointer X co-ordinate, which is why the menu is not aligned to the left/right hand edge of the button.

During early development of jgmenu, @o9000 and I wanted jgmenu to be able to behave as a native tint2 menu, but without tint2 having to do the hard work. To achieve this, we let tint2 set some environment variables on exec including TINT2_BUTTON_ALIGNED_{X1,X2,Y1,Y2}.

If 'tint2_look=1' in jgmenurc, jgmenu_run reads these environment variables and passes them via a unix socket to the long-running instance of jgmenu. On 'wake up' (=show menu), jgmenu aligns the menu to these variables.

The above method allows jgmenu to correctly position itself even in complex situations such as 'panel_shrink=1' in tint2rc (where the panel will shrink to a compact size dynamically)

In order to make this features avaialble to other panels, we would need to re-factor the code a bit to cut the dependence on other tint2 variables. This is not a big deal, but I'm reluctant to go hacking around too much until lithium is out. jgmenu is having a cool-off period smile

Going forward I suggest the following:

Add new config option

position_mode = ( ptr | ipc | fixed )

ptr - launch at pointer
ipc - use inter-process communication to read variables set by panel
fixed - based on margin_x, etc in jgmenurc

I suggest that ptr and fixed should respect _NET_WORKAREA, which is what generally makes jgmenu aligh accurately out-of-the-box with EWMH compliant WMs/panels.

We can be backward compatible by setting postition_mode=ptr if at_pointer==1

For the time being, I have added the xfce4-panel-plugin to contrib/ in the jgmenu repo.
I'll do the same with the mate-panel plugin shortly.

Re gtk/qt theming - we're part way there. The following works for many gtk themes.

jgmenu init --apply-obtheme

To parse actual gtk3 themes looks tricky. I haven't explored how gtk apps do it, but prefer not to make the whole gtk stack a dependency of jgmenu.
Appreciate any help in this area...

Offline

#231 2019-07-14 11:37:42

malm
jgmenu developer
Registered: 2016-10-13
Posts: 528
Website

Re: jgmenu

misko_2083 wrote:

One menu to rule them all

Can we change @misko_2083's Title to Chief Promoter. I just like to write code angel

Offline

#232 2019-07-15 03:47:31

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 6,019
Website

Re: jgmenu

^@misko OK? Easily done.


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Online

#233 2019-07-19 04:07:47

misko_2083
Member
Registered: 2016-05-24
Posts: 242

Re: jgmenu

^Thank you. No need for a title.

@malm Thank's for all the info.
Xfce panel sets the panel strut which changes _NET_WORKAREA.
But there is a setting to turn that behavior off.

Those TINT2 variables are pretty handy.
https://i.imgur.com/OoTbFTR.mp4
Xfce-panel has floating panel positions, I'm still figuring out where to position the menu in those cases.

For now tint2rc has to be edited manually to inform the jgmenu where the panel is positioned.

Parsing gtk3 themes looks tricky.
I have a py script that parses entire css (from the internet, no idea who the author is).

#!/usr/bin/env python3

import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk

gset = Gtk.Settings.get_default ()
themename = gset.get_property ("gtk-theme-name")
prefdark = gset.get_property ("gtk-application-prefer-dark-theme") # it's a boolean
cprov = Gtk.CssProvider.get_named (themename)
print (cprov.to_string())

It a pitty that color-hash property is deprecated. https://lazka.github.io/pgi-docs/Gtk-3. … tings.html
Hope the only way to get the color isn't in digging through the CSS.

Offline

#234 2019-07-22 20:48:21

malm
jgmenu developer
Registered: 2016-10-13
Posts: 528
Website

Re: jgmenu

@misko That CSS script looks interesting. I think that could be the beginning of something smile

Offline

#235 2019-07-23 00:25:48

misko_2083
Member
Registered: 2016-05-24
Posts: 242

Re: jgmenu

@malm The begining of parsing CSS? smile

Finally figured out floating panel positioning in the xfce.
Had to get the screen width and height.
If the panel is in the top half of the screen, positions jgmenu down from the panel.
Bottom half - positions jgmenu up from the panel.
What I look forward to is some simple way to notify jgmenu of the panel orientation.
Other than changing tint2rc, of course.
https://youtu.be/8QD_Pgl-Jvk

In the second part of the video: added about dialog and popup event.
The second one is useful for keyboard shortcuts.

# Launch jgmenu --at-pointer
xfce4-panel --plugin-event=jgmenu-applet:popup:bool:true
# Launch jgmenu at jgmenu-applet-x where x is plugin ID
xfce4-panel --plugin-event=jgmenu-applet-4:popup:bool:false

The ID has to be found in the panel preferences->Items.
When hovering over jgmenu plugin in the list, tooltip displays the internal name "jgmenu-applet-x".
It would be perfect with just:

xfce4-panel --plugin-event=jgmenu-applet:popup:bool:true

like the whisker menu, but no idea how.

Last edited by misko_2083 (2019-07-23 00:27:53)

Offline

#236 2019-07-23 19:41:06

malm
jgmenu developer
Registered: 2016-10-13
Posts: 528
Website

Re: jgmenu

misko_2083 wrote:

@malm The begining of parsing CSS? smile

Yes, the next step would be to decide which 'key' in the CSS file we should use to update jgmenurc.
A bit like we do in process_line() in src/jgmenu-obtheme.c

What I look forward to is some simple way to notify jgmenu of the panel orientation. Other than changing tint2rc, of course.

Could we use `jgmenu_run config` for this and set "menu_valign"

jgmenu_run config -s ~/.config/jgmenu/jgmenurc -k menu_valign -v bottom

I think we'll have to refactor jgmenu.c a bit around tint2_align() to separate the IPC from the t2conf_* functions. That would be cleaner anyway. I'm happy to invest some time in this and think we can do it in a backward compatible way.

Cool.

It would be perfect with just:

xfce4-panel --plugin-event=jgmenu-applet:popup:bool:true

like the whisker menu, but no idea how.

I don't understand how the ID works, but happy to have a look if you want me to.

Offline

#237 2019-07-24 15:18:21

Uooops
Member
Registered: 2019-07-08
Posts: 7

Re: jgmenu

Hello!

I'm trying to install jgmenu trough terminal but I can't

I type sudo apt-get install jgmenu but package can't be found

Any idea how to solve it? Am I doing something wrong? I'm a bit lost...

Offline

#238 2019-07-24 16:19:18

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 1,909
Website

Re: jgmenu

Should work If you are running Bunsen, otherwise check https://github.com/johanmalm/jgmenu/blo … INSTALL.md.

Offline

#239 2019-07-24 17:24:57

malm
jgmenu developer
Registered: 2016-10-13
Posts: 528
Website

Re: jgmenu

Uooops wrote:

Hello!

I'm trying to install jgmenu trough terminal but I can't

I type sudo apt-get install jgmenu but package can't be found

Any idea how to solve it? Am I doing something wrong? I'm a bit lost...

You need to enable the backports

Offline

#240 2019-07-25 14:18:48

Uooops
Member
Registered: 2019-07-08
Posts: 7

Re: jgmenu

Thank you both. It was because of the backports.

Great job with this menu, It's really useful!

Offline

#241 2019-07-25 21:54:57

misko_2083
Member
Registered: 2016-05-24
Posts: 242

Re: jgmenu

malm wrote:

Could we use `jgmenu_run config` for this and set "menu_valign"

jgmenu_run config -s ~/.config/jgmenu/jgmenurc -k menu_valign -v bottom

I think we'll have to refactor jgmenu.c a bit around tint2_align() to separate the IPC from the t2conf_* functions. That would be cleaner anyway. I'm happy to invest some time in this and think we can do it in a backward compatible way.

Cool.

It would be perfect with just:

xfce4-panel --plugin-event=jgmenu-applet:popup:bool:true

like the whisker menu, but no idea how.

I don't understand how the ID works, but happy to have a look if you want me to.

It seems to work with debian 10 and xfce 4.12.2. The issue is only with 4.10.

@malm This line here -> https://github.com/johanmalm/jgmenu/blo … nu_run#L33
test -z returns true when the variable is set and prevents setting the new panel coordinates when the button is moved.

#!/bin/sh
TINT2_BUTTON_ALIGNED_X1=55
test -z ${TINT2_BUTTON_ALIGNED_X+x} && echo "zero"
unset TINT2_BUTTON_ALIGNED_X1
test -z ${TINT2_BUTTON_ALIGNED_X+x} && echo "zero"

so far I've used stay_alive=0 in jgmenurc and it worked but starts slower.
Disabled https://github.com/johanmalm/jgmenu/blo … nu_run#L33 line for now. Don't worry about that, I could have a script like jgmenu_run script for running jgmenu in the xfce panel plugin.

jgmenu-applet.h

/*
* Copyright © 2019
*
* Distributed under terms of the GPL2 license.
*/

#ifndef SRC_HEADERS_JGMENU_H_
#define SRC_HEADERS_JGMENU_H_

G_BEGIN_DECLS

#define DEFAULT_ICON_NAME "jgmenu"
#define DEFAULT_TOOLTIP_MESSAGE "Applications Menu"
#define DEFAULT_TITLE "jgmenu"
#define DEFAULT_RUN_COMMAND "jgmenu_run"
#define DEFAULT_RUN_COMMAND_AT_POINTER "jgmenu --at-pointer"
#define VERSION "0.1"

typedef struct _JgmenuPlugin {
    XfcePanelPlugin *plugin;

    GtkWidget       *button;
    GtkWidget       *icon;

    gchar           *icon_name;
}
JgmenuPlugin;


G_END_DECLS


#endif /* SRC_HEADERS_JGMENU_H_ */

jgmenu-applet.c

/*
* Copyright © 2019
*
* Distributed under terms of the GPL2 license.
*/

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif


#include <gtk/gtk.h>
#include <libxfce4util/libxfce4util.h>
#include <libxfce4panel/xfce-panel-plugin.h>
#include "jgmenu-applet.h"


static void jgmenu_about (XfcePanelPlugin *plugin)
{ 
  GdkPixbuf *icon;

  const gchar *auth[] =
    {
      "Miloš Pavlović",
      NULL
    };

  icon = xfce_panel_pixbuf_from_source ("jgmenu", NULL, 32);
  gtk_show_about_dialog (NULL,
                         "logo",         icon,
                         "license",      xfce_get_license_text (XFCE_LICENSE_TEXT_GPL),
                         "version",      VERSION,
                         "program-name", "jgmenu-applet",
                         "comments",     _("Starts Jgmenu"),
                         "website",      "https://github.com/johanmalm/jgmenu",
                         "copyright",    _("Copyright \xc2\xa9 2019 Miloš Pavlović\n\nJgmenu Copyright \xc2\xa9 Johan Malm\n"),
                         "authors",      auth,
                         NULL);

  if (icon)
    g_object_unref (G_OBJECT (icon));
}


static char **extend_env (int           coordinate,
                            char          *variable,
                            char          **envp)
{
    envp = g_environ_setenv (envp, variable, g_strdup_printf ("%" G_GINT16_FORMAT, coordinate), FALSE);
    return envp;
}


static void button_clicked(GtkWidget *button, XfcePanelPlugin *plugin)
{

    gint  x, y, panel_w, panel_h, button_width, button_height;
    gint panel_x1, panel_x2, panel_y1, panel_y2, button_x1, button_x2, button_y1, button_y2;
    GdkRectangle    extents;
    GdkWindow       *window;
    GtkAllocation allocation;
    GdkScreen *screen;
    gint screen_width, screen_height;

    if ((screen = gdk_screen_get_default()) != NULL) {
        screen_width = gdk_screen_get_width(screen);
        screen_height = gdk_screen_get_height(screen);
        }

    screen_width = screen_width / 2;
    screen_height = screen_height / 2;

    /* get parent window */
    window = gtk_widget_get_parent_window(button);

    /* parent's top-left screen coordinates */
    gdk_window_get_root_origin(window, &x,&y);

    /* parent's width and height */
    panel_w = gdk_window_get_width(window);
    panel_h = gdk_window_get_height(window);

    /* parent's extents (including decorations) */
    gdk_window_get_frame_extents(window, &extents);

    gtk_widget_get_allocation(button, &allocation);

    /* calculating x (assuming: left border size == right border size) */
    x = x + (extents.width-panel_w)/2 + allocation.x;

    /* calculating y (assuming: left border size == right border size == bottom border size) */
    y = y + (extents.height-panel_h)-(extents.width-panel_w)/2 + allocation.y;

    button_width = allocation.width;
    button_height = allocation.height;

    /* Panel Position */
    XfceScreenPosition position;

    position = xfce_panel_plugin_get_screen_position (plugin); 
    if (xfce_screen_position_is_horizontal(position)){
        /* horizontal */
        if (xfce_screen_position_is_top(position)){
            /* top panel position */
            panel_x1 = extents.x;
            panel_x2 = extents.x + panel_w;
            panel_y1 = extents.y + panel_h;
            panel_y2 = panel_y1;
            button_x1 = x;
            button_x2 = x + button_width;
            button_y1 = y + button_height;
            button_y2 = y + button_height;
        }
        if (xfce_screen_position_is_bottom(position)){
            /* bottom */
            panel_x1 = extents.x;
            panel_x2 = extents.x + panel_w;
            panel_y1 = extents.y;
            panel_y2 = extents.y;
            button_x1 = x;
            button_x2 = x + button_width;
            button_y1 = y;
            button_y2 = y;
        }
        if (xfce_screen_position_is_floating(position)){
           /* floating */

            if (extents.y > screen_height)
                {
                /* bottom */
                panel_x1 = extents.x;
                panel_x2 = extents.x + panel_w;
                panel_y1 = extents.y;
                panel_y2 = extents.y;
                button_x1 = x;
                button_x2 = x + button_width;
                button_y1 = y;
                button_y2 = y;
                }
            else
                {
                /* top */
                panel_x1 = extents.x;
                panel_x2 = extents.x + panel_w;
                panel_y1 = extents.y + panel_h;
                panel_y2 = panel_y1;
                button_x1 = x;
                button_x2 = x + button_width;
                button_y1 = y + button_height;
                button_y2 = y + button_height;
                }
        }
    } else {
        /* vertical */
        if (xfce_screen_position_is_left(position)){
            /* left */
            panel_x1 = extents.x + panel_w;
            panel_x2 = extents.x + panel_w;
            panel_y1 = extents.y;
            panel_y2 = extents.y + panel_h;
            button_x1 = x + button_width;
            button_x2 = button_x1;
            button_y1 = y;
            button_y2 = y + button_height;
        }
        if (xfce_screen_position_is_right(position)){
            /* right */
            panel_x1 = extents.x;
            panel_x2 = extents.x;
            panel_y1 = extents.y;
            panel_y2 = extents.y + panel_h;
            button_x1 = x;
            button_x2 = x;
            button_y1 = y;
            button_y2 = y + button_height;
        }
        if (xfce_screen_position_is_floating(position)){
            /* floating */
            if (extents.x > screen_width)
                {
                /* right */
                panel_x1 = extents.x;
                panel_x2 = extents.x;
                panel_y1 = extents.y;
                panel_y2 = extents.y + panel_h;
                button_x1 = x;
                button_x2 = x;
                button_y1 = y;
                button_y2 = y + button_height;
                }
            else
                {
                /* left */
                panel_x1 = extents.x + panel_w;
                panel_x2 = extents.x + panel_w;
                panel_y1 = extents.y;
                panel_y2 = extents.y + panel_h;
                button_x1 = x + button_width;
                button_x2 = button_x1;
                button_y1 = y;
                button_y2 = y + button_height;
                }
        }
    }

    gchar      *command[] = { DEFAULT_RUN_COMMAND,NULL };

    gchar **envp = g_get_environ();


    envp = g_environ_unsetenv(envp, "TINT2_BUTTON_ALIGNED_X1");
    envp = g_environ_unsetenv(envp, "TINT2_BUTTON_ALIGNED_X2");
    envp = g_environ_unsetenv(envp, "TINT2_BUTTON_ALIGNED_Y1");
    envp = g_environ_unsetenv(envp, "TINT2_BUTTON_ALIGNED_Y2");
    envp = g_environ_unsetenv(envp, "TINT2_BUTTON_PANEL_X1");
    envp = g_environ_unsetenv(envp, "TINT2_BUTTON_PANEL_X2");
    envp = g_environ_unsetenv(envp, "TINT2_BUTTON_PANEL_Y1");
    envp = g_environ_unsetenv(envp, "TINT2_BUTTON_PANEL_Y2");
    if (button_x1 >= 0)
        {
        envp = extend_env (button_x1 , "TINT2_BUTTON_ALIGNED_X1", envp);
        envp = extend_env (button_x2 , "TINT2_BUTTON_ALIGNED_X2", envp);
        envp = extend_env (button_y1 , "TINT2_BUTTON_ALIGNED_Y1", envp);
        envp = extend_env (button_y2 , "TINT2_BUTTON_ALIGNED_Y2", envp);
        envp = extend_env (panel_x1 , "TINT2_BUTTON_PANEL_X1", envp);
        envp = extend_env (panel_x2 , "TINT2_BUTTON_PANEL_X2", envp);
        envp = extend_env (panel_y1 , "TINT2_BUTTON_PANEL_Y1", envp);
        envp = extend_env (panel_y2 , "TINT2_BUTTON_PANEL_Y2", envp);
        }

    GError      *error = NULL;

    g_spawn_async (".", command, envp,
		      G_SPAWN_SEARCH_PATH,
		      NULL, NULL, NULL, &error);
    if (error != NULL) {
        g_warning("unable to launch: %s", error->message);
        }

    g_strfreev (envp);
}


static JgmenuPlugin *
jgmenu_init(XfcePanelPlugin *plugin)
{
    JgmenuPlugin *jgmenu = g_slice_new0(JgmenuPlugin);
    jgmenu->plugin = plugin;
    jgmenu->icon_name = g_strdup(DEFAULT_ICON_NAME);
    jgmenu->button = xfce_panel_create_button();
    gtk_widget_show(jgmenu->button);
    g_signal_connect(G_OBJECT(jgmenu->button),
                     "clicked", G_CALLBACK(button_clicked), plugin);
    gtk_widget_set_tooltip_text(GTK_WIDGET(jgmenu->button),
                                DEFAULT_TOOLTIP_MESSAGE);
    jgmenu->icon = xfce_panel_image_new_from_source(jgmenu->icon_name);
    gtk_widget_show(jgmenu->icon);
    gtk_container_add(GTK_CONTAINER(jgmenu->button), jgmenu->icon);
    return jgmenu;
}


static void jgmenu_free(XfcePanelPlugin *plugin, JgmenuPlugin *jgmenu)
{
    gtk_widget_destroy(jgmenu->button);
    gtk_widget_destroy(jgmenu->icon);
    g_slice_free(JgmenuPlugin, jgmenu);
}


static gboolean jgmenu_size_changed (XfcePanelPlugin *plugin,
                     gint             size,
                     JgmenuPlugin    *jgmenu)
{
    size = size / xfce_panel_plugin_get_nrows(plugin);
    gtk_widget_set_size_request (GTK_WIDGET (plugin), size, size);
    return TRUE;
}


static gboolean jgmenu_remote (XfcePanelPlugin *plugin,
                             gchar           *name,
                             GValue          *value,
                             JgmenuPlugin    *jgmenu)
{
    g_return_val_if_fail (value == NULL || G_IS_VALUE (value), FALSE);
    if (strcmp (name, "popup") == 0)
        {
        if (value != NULL
            && G_VALUE_HOLDS_BOOLEAN (value)
            && g_value_get_boolean (value)
            && gtk_widget_get_visible (GTK_WIDGET (plugin)) )
            {
                /* popup here at mouse pointer */
                GError *error = NULL;
                g_spawn_command_line_async(DEFAULT_RUN_COMMAND_AT_POINTER, &error);
                if (error != NULL) {
                    g_warning("unable to launch: %s", error->message);
                    }
            }
        else
            {
                /* popup here, where X is an internal id
                 * xfce4-panel --plugin-event=jgmenu-applet-X:popup:bool:false
                 */
                button_clicked(jgmenu->button, plugin);
            }
        return TRUE;
        }
    return FALSE;
}


static void jgmenu_construct(XfcePanelPlugin *plugin)
{
    JgmenuPlugin *jgmenu;
    jgmenu = jgmenu_init(plugin);
    gtk_container_add(GTK_CONTAINER(plugin), jgmenu->button);
    xfce_panel_plugin_add_action_widget(plugin, jgmenu->button);
    xfce_panel_plugin_menu_show_about(plugin);
    g_signal_connect(G_OBJECT(plugin),
                     "free-data", G_CALLBACK(jgmenu_free), jgmenu);
    g_signal_connect(G_OBJECT(plugin),
                     "size-changed", G_CALLBACK(jgmenu_size_changed), jgmenu);
    g_signal_connect(G_OBJECT (plugin), "remote-event",
                    G_CALLBACK(jgmenu_remote), jgmenu);
    g_signal_connect (G_OBJECT (plugin), "about",
                    G_CALLBACK (jgmenu_about), jgmenu);
}

XFCE_PANEL_PLUGIN_REGISTER(jgmenu_construct);

The same line for compiling.

Important-> After adding the jgmenu plugin to the panel the correct panel orientation needs to be set in tin2rc so that jgmenu pops at the right position and not (possibly) off screen. Use the text editor or tint2conf.

command in terminal:
xfce4-panel --plugin-event=jgmenu-applet:popup:bool:false
Pops up jgmenu at the button position.

I have to rework the code for poping jgmenu at mouse pointer.
xfce4-panel --plugin-event=jgmenu-applet:popup:bool:true
It will not run jgmenu --at-pointer if jgmenu is already running. smile

Totally abused tint2 variables.

edit:
Noticed if there are two panels on the opposite sides of the screen, and jgmenu is launched  from the panel that is floating near the top, menu will go in the opposite direction, partially out of screen. The bottom panel sets the strut which shrinks _NET_WORKAREA at the bottom of the screen. The menu is logically positioned away from the bottom, with the button coordinates from the floating top panel.
The same thing happens if the top panel is set not to preserve space on screen border.
Taking notes for now, something to think about in the future.

Last edited by misko_2083 (2019-07-26 09:43:19)

Offline

#242 2019-08-09 15:44:50

crn
Member
Registered: 2019-08-09
Posts: 7

Re: jgmenu

Hi, is there any way to have shadows with jgmenu ? I'm using Gala(mutter) as window manager

Offline

#243 2019-08-09 15:56:06

malm
jgmenu developer
Registered: 2016-10-13
Posts: 528
Website

Re: jgmenu

I don’t know mutter well.

Are we talking X11 or wayland?

Does the question refer to client-side or server-side shadows?

If server, no idea, but happy to help work it out.

If client, currently no support, but could implement with widgets.

Offline

#244 2019-08-09 17:13:06

crn
Member
Registered: 2019-08-09
Posts: 7

Re: jgmenu

It's x11 and shadows are working but not on jgmenu so I was wondering if there is something I need to do to enable them ? Also wm has no options to include/exclude shadows (or any other effects) per app base.

Offline

#245 2019-08-09 17:19:16

malm
jgmenu developer
Registered: 2016-10-13
Posts: 528
Website

Re: jgmenu

Do you get shadows on popup windows and gtk menus?

Offline

#246 2019-08-09 17:31:11

crn
Member
Registered: 2019-08-09
Posts: 7

Re: jgmenu

yes shadows are working fine... if it helps polybar also does not have shadow

Offline

#247 2019-08-09 17:41:16

crn
Member
Registered: 2019-08-09
Posts: 7

Re: jgmenu

On unrelated thing I noticed bug in launching apps. I have this in .desktop file

Exec=env GTK_THEME=deepin-dark nautilus --new-window %U

and when launching app nautilus opens with deepin-dark theme but not from jgmenu. jgmenu seems to ignore this and running app by default.
Same thing goes for this:

Exec=firefox -P youtube https://www.youtube.com/ %u --class Firefox-youtube

This opens new instance of firefox with new class but jgmenu is ignoring this and simply opens new firefox tab

Offline

#248 2019-08-09 20:05:33

malm
jgmenu developer
Registered: 2016-10-13
Posts: 528
Website

Re: jgmenu

^ Great feedback. Thanks. It is on my TODO-list. In fact it is right at the top smile

Currently, we wrap in `sh -c` - as do dmenu and others. This is not strictly XDG compliant.

^^ Regarding the shadow, I suspect it's due to one of the settings in ui_create_window().
Do you get a shadow with dmenu or rofi?

The X11 properties WM_NAME and WM_CLASS are set for jgmenu windows. In compton we can make use of these for setting shadows https://jgmenu.github.io/integration.html#compton. Would that help?
I've had a quick look at the mutter source code, but it's not obvious to me how window type affects shadow; or indeed how we could set shadow depending on WM_CLASS or WM_NAME (or something else).

Offline

#249 2019-08-10 01:06:46

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 6,019
Website

Re: jgmenu

Shadow: just check ~/.config/compton.conf line 46. Make sure the shadow-exclude for jgmenu is commented out:

shadow-exclude = [
#    "! name~=''",
#    "name = 'jgmenu'",
    "name = 'Notification'",
...etc...

John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Online

#250 2019-08-10 14:26:12

crn
Member
Registered: 2019-08-09
Posts: 7

Re: jgmenu

johnraff wrote:

Shadow: just check ~/.config/compton.conf line 46. Make sure the shadow-exclude for jgmenu is commented out:

shadow-exclude = [
#    "! name~=''",
#    "name = 'jgmenu'",
    "name = 'Notification'",
...etc...

thing is I do not use compton and mutter does not have config file options to exclude/include effects per app. Basically shadows are on for all by default but not in jgmenu

Offline

Board footer

Powered by FluxBB