LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (https://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   [XFCE][GTK] Get rid of padding in panel plugin? (https://www.linuxquestions.org/questions/linux-desktop-74/%5Bxfce%5D%5Bgtk%5D-get-rid-of-padding-in-panel-plugin-4175608467/)

Weapon S 06-23-2017 11:08 AM

[XFCE][GTK] Get rid of padding in panel plugin?
 
Picture of what my problem is.
Going from Debian Jessie to Stretch there seems to be padding added to the datetime-plugin (clock + date shown in taskbar). I like my panel tiny, and the introduced padding pushes the date out of bounds.

I am not familiar with it, but I thought maybe I could get rid of the padding via an override in my gtkrc file? I already use that file to get my desktop icons closer together.
Some resources I have found:
https://wiki.gnome.org/Attic/GnomeAr...ials/GtkThemes
https://developer.gnome.org/gtk3/stable/ch02.html
https://www.gtk.org/tutorial1.2/gtk_tut-21.html

Most sources talk about applying a global theme; that is the opposite of what I want to do. I want to override the style of a single element of a single application. So I need to get a specific GTK path?
I would like to add something like this my gtkrc-2.0:
Code:

style "my-clock-is-broken" {
        padding =  0
}
widget "Datetime.*" style "my-clock-is-broken"

So I would need the name of the "window" the datetime plugin runs in? When I run "xwininfo -root -children" it seems the datetime plugin runs in an anonymous window?
Code:

xwininfo: Window id: 0x1dc (the root window) (has no name)

  Root window id: 0x1dc (the root window) (has no name)
  Parent window id: 0x0 (none)
    101 children:
    0x2c059f8 "Firefox": ("Popup" "Firefox-esr")  313x188+369+259  +369+259
    0x2c01eae "Firefox": ("Popup" "Firefox-esr")  1920x312+0+124  +0+124
    0x2c01e84 "Firefox": ("Popup" "Firefox-esr")  266x188+676+334  +676+334
    0x2c01efa "The “padding” child property": ("Popup" "Firefox-esr")  211x44+701+637  +701+637
    0x2c01eec "Close tab": ("Popup" "Firefox-esr")  88x44+1255+91  +1255+91
    0x1a0aa30 "wrapper-2.0": ("wrapper-2.0" "Wrapper-2.0")  131x139+1776+10  +1776+10
    0x2c01e6c "Firefox": ("Popup" "Firefox-esr")  1920x42+0+124  +0+124
    0x36055c0 "SciTE": ("SciTE" "SciTE")  133x211+586+407  +586+407
    0x2c059fc "Wrap [CODE] tags around selected text": ("Popup" "Firefox-esr")  278x44+1092+557  +1092+557
    0x1a11413 "wrapper-2.0": ()  10x10+-100+-100  +-100+-100
    0x1a0aa8f "wrapper-2.0": ("wrapper-2.0" "Wrapper-2.0")  192x138+1563+111  +1563+111
    0x2e00c38 "SciTE": ()  10x10+-100+-100  +-100+-100
    0x2c01ef2 "Open a new tab (Ctrl+T)": ("Popup" "Firefox-esr")  182x44+438+87  +438+87
    0x2c01ee4 "Open a new tab (Ctrl+T)": ("Popup" "Firefox-esr")  182x44+446+92  +446+92
    0x2c01eb6 "Firefox": ("Popup" "Firefox-esr")  200x200+0+0  +0+0
    0x2e00023 (has no name): ()  1x1+-1+-1  +-1+-1
    0x2e00018 "SciTE": ("SciTE" "SciTE")  200x200+0+0  +0+0
    0x2e00010 "SciTE": ("SciTE" "SciTE")  200x200+0+0  +0+0
    0x2e00001 "SciTE": ("SciTE" "SciTE")  10x10+10+10  +10+10
    0x2c01e74 "Firefox": ("Popup" "Firefox-esr")  200x200+0+0  +0+0
    0x3601385 "SciTE": ("SciTE" "SciTE")  276x354+661+152  +661+152
    0x3602f5b "SciTE": ("SciTE" "SciTE")  288x329+600+152  +600+152
    0x3600851 "SciTE": ()  10x10+-100+-100  +-100+-100
    0x360062a "SciTE": ("SciTE" "SciTE")  1x1+-99+-99  +-99+-99
    0x3600023 (has no name): ()  1x1+-1+-1  +-1+-1
    0x3600018 "SciTE": ("SciTE" "SciTE")  200x200+0+0  +0+0
    0x3600010 "SciTE": ("SciTE" "SciTE")  200x200+0+0  +0+0
    0x3600001 "SciTE": ("SciTE" "SciTE")  10x10+10+10  +10+10
    0xc0803c "About xfce4-panel": ("xfce4-panel" "Xfce4-panel")  308x214+803+404  +803+404
    0xc00351 "xfce4-panel": ("xfce4-panel" "Xfce4-panel")  173x393+0+20  +0+20
    0x300ef04 "pcmanfm": ("pcmanfm" "Pcmanfm")  170x35+1921+1081  +1921+1081
    0x3a00310 "Mousepad": ()  10x10+-100+-100  +-100+-100
    0xe004fc "xfdesktop": ()  10x10+-100+-100  +-100+-100
    0x30004a8 "pcmanfm": ("pcmanfm" "Pcmanfm")  170x35+1921+1081  +1921+1081
    0x3a0002e (has no name): ()  1x1+-1+-1  +-1+-1
    0x3a00001 "Mousepad": ("mousepad" "Mousepad")  10x10+10+10  +10+10
    0x30062fa "pcmanfm": ("pcmanfm" "Pcmanfm")  1605x991+278+81  +278+81
    0x3006247 "pcmanfm": ()  10x10+-100+-100  +-100+-100
    0x2c00160 "Firefox": ("firefox-esr" "Firefox-esr")  1x1+-99+-99  +-99+-99
    0x3003a01 "pcmanfm": ("pcmanfm" "Pcmanfm")  1x1+-100+-100  +-100+-100
    0x30039ec "pcmanfm": ("pcmanfm" "Pcmanfm")  1x1+-100+-100  +-100+-100
    0x38000e2 "xscreensaver-demo": ("xscreensaver-demo" "Xscreensaver-demo")  166x107+585+345  +585+345
    0x38000d0 "xscreensaver-demo": ("xscreensaver-demo" "Xscreensaver-demo")  160x42+619+345  +619+345
    0x3800041 (has no name): ()  1x1+-1+-1  +-1+-1
    0x3800003 "xscreensaver-demo": ("xscreensaver-demo" "Xscreensaver-demo")  197x69+0+0  +0+0
    0x3800001 "xscreensaver-demo": ("xscreensaver-demo" "Xscreensaver-demo")  10x10+10+10  +10+10
    0xc020e9 "xfce4-panel": ("xfce4-panel" "Xfce4-panel")  274x621+171+141  +171+141
    0xe00300 "xfdesktop": ("xfdesktop" "Xfdesktop")  1x1+-100+-100  +-100+-100
    0x260011c "xfce4-appfinder": ()  10x10+-100+-100  +-100+-100
    0x2000001 "/usr/lib/firefox-esr/plugin-container": ("/usr/lib/firefox-esr/plugin-container" "/usr/lib/firefox-esr/plugin-container")  10x10+10+10  +10+10
    0x300012d (has no name): ()  1x1+-1+-1  +-1+-1
    0x3000001 "pcmanfm": ("pcmanfm" "Pcmanfm")  10x10+10+10  +10+10
    0x3200001 "/usr/lib/firefox-esr/plugin-container": ("/usr/lib/firefox-esr/plugin-container" "/usr/lib/firefox-esr/plugin-container")  10x10+10+10  +10+10
    0x2c0001e "Firefox": ()  10x10+-100+-100  +-100+-100
    0x2c0001b "Firefox": ()  10x10+-100+-100  +-100+-100
    0x2c00003 (has no name): ("Toplevel" "Firefox-esr")  100x100+0+0  +0+0
    0x2c00001 "Firefox": ("firefox-esr" "Firefox-esr")  10x10+10+10  +10+10
    0x260002c (has no name): ()  1x1+-1+-1  +-1+-1
    0x2600001 "xfce4-appfinder": ("xfce4-appfinder" "Xfce4-appfinder")  10x10+10+10  +10+10
    0xe00019 (has no name): ()  1x1+-1+-1  +-1+-1
    0x1a00008 (has no name): ()  1x1+-1+-1  +-1+-1
    0x1000004 (has no name): ()  10x10+0+0  +0+0
    0x2400021 "wrapper-1.0": ()  10x10+-100+-100  +-100+-100
    0x240001b (has no name): ()  1x1+-1+-1  +-1+-1
    0x1a00001 "wrapper-2.0": ("wrapper-2.0" "Wrapper-2.0")  10x10+10+10  +10+10
    0x2400001 "wrapper-1.0": ("wrapper-1.0" "Wrapper-1.0")  10x10+10+10  +10+10
    0x220001b (has no name): ()  1x1+-1+-1  +-1+-1
    0x1600001 "polkit-gnome-authentication-agent-1": ("polkit-gnome-authentication-agent-1" "Polkit-gnome-authentication-agent-1")  10x10+10+10  +10+10
    0xc0002f (has no name): ()  1x1+-1+-1  +-1+-1
    0x2200001 "wrapper-1.0": ("wrapper-1.0" "Wrapper-1.0")  10x10+10+10  +10+10
    0xc0002a (has no name): ()  10x10+0+0  +0+0
    0x1c00001 "xfce4-volumed": ("xfce4-volumed" "Xfce4-volumed")  10x10+10+10  +10+10
    0x1200001 "xfce4-power-manager": ("xfce4-power-manager" "Xfce4-power-manager")  10x10+10+10  +10+10
    0x8007ad (has no name): ()  1920x1080+0+0  +0+0
    0xe00001 "xfdesktop": ("xfdesktop" "Xfdesktop")  10x10+10+10  +10+10
    0x1000003 (has no name): ()  1x1+-1+-1  +-1+-1
    0x1000001 "xfsettingsd": ("xfsettingsd" "Xfsettingsd")  10x10+10+10  +10+10
    0xc00001 "xfce4-panel": ("xfce4-panel" "Xfce4-panel")  10x10+10+10  +10+10
    0xa00001 "Thunar": ("Thunar" "Thunar")  10x10+10+10  +10+10
    0x800311 (has no name): ()  1x1+-1+-1  +-1+-1
    0x800122 "Xfwm4": ("xfwm4" "Xfwm4")  5x5+-1000+-1000  +-1000+-1000
    0x800121 (has no name): ()  10x10+-100+-100  +-100+-100
    0x800001 "xfwm4": ("xfwm4" "Xfwm4")  10x10+10+10  +10+10
    0x400001 "xfce4-session": ("xfce4-session" "Xfce4-session")  10x10+10+10  +10+10
    0x80013d (has no name): ()  1x1080+-1+0  +-1+0
    0x80013e (has no name): ()  1x1080+1920+0  +1920+0
    0x80013f (has no name): ()  1920x1+0+-1  +0+-1
    0x800140 (has no name): ()  1920x1+0+1080  +0+1080
    0x8007bc (has no name): ()  1920x21+-9999+-9999  +-9999+-9999
    0x800788 (has no name): ()  1920x3+0+0  +0+0
    0x894add (has no name): ()  1920x1080+0+0  +0+0
    0x8e64ab (has no name): ()  1920x1080+0+0  +0+0
    0x8d1a12 (has no name): ()  1920x1080+0+0  +0+0
    0x8d4b7e (has no name): ()  624x772+805+292  +805+292
    0x8b40c0 (has no name): ()  1040x886+660+158  +660+158
    0x807155 (has no name): ()  1820x478+0+538  +0+538
    0x884002 (has no name): ()  1820x478+100+0  +100+0
    0x8a075d (has no name): ()  1820x478+149+166  +149+166
    0x887f22 (has no name): ()  1124x512+637+284  +637+284
    0x85078a (has no name): ()  758x490+581+295  +581+295
    0x800816 (has no name): ()  1920x1080+0+0  +0+0

Here is some relevant source code of the datetime plugin:
Code:

/*
 * create the gtk-part of the datetime plugin
 */
static void datetime_create_widget(t_datetime * datetime)
{
  GtkOrientation orientation;
  orientation = xfce_panel_plugin_get_orientation(datetime->plugin);

  /* create button */
  datetime->button = xfce_create_panel_toggle_button();
  gtk_widget_show(datetime->button);

  /* create a box which can be easily adapted to the panel orientation */
  datetime->box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);

  gtk_widget_show(datetime->box);
  gtk_container_add(GTK_CONTAINER(datetime->button), datetime->box);

  /* create time and date lines */
  datetime->time_label = gtk_label_new("");
  datetime->date_label = gtk_label_new("");
  gtk_label_set_justify(GTK_LABEL(datetime->time_label), GTK_JUSTIFY_CENTER);
  gtk_label_set_justify(GTK_LABEL(datetime->date_label), GTK_JUSTIFY_CENTER);

  /* add time and date lines to the box */
  gtk_box_pack_start(GTK_BOX(datetime->box),
      datetime->time_label, TRUE, FALSE, 0);
  gtk_box_pack_start(GTK_BOX(datetime->box),
      datetime->date_label, TRUE, FALSE, 0);

  /* connect widget signals to functions */
  g_signal_connect(datetime->button, "button-press-event",
      G_CALLBACK(datetime_clicked), datetime);

  /* set orientation according to the panel orientation */
  datetime_set_mode(datetime->plugin, orientation, datetime);
}

But I guess my effort ends when there is no window name associated with the plugin? Anybody who wants to chime in is welcome. I guess I could compile an altered version of the plugin... after learning GTK and preparing a build environment for XFCE... I don't think I'm that desperate yet.


All times are GMT -5. The time now is 06:37 AM.