LBCrion / sfwbar

S* Floating Window Bar
GNU General Public License v3.0
266 stars 17 forks source link

Freebsd sfwbar dies #52

Closed devosalain closed 3 months ago

devosalain commented 1 year ago

Errors given,

(sfwbar:86264): GLib-CRITICAL **: 15:55:41.193: g_unix_signal_source_new: assertion 'signum == SIGHUP || signum == SIGINT || signum == SIGTERM || signum == SIGUSR1 || signum == SIGUSR2 || signum == SIGWINCH' failed
(sfwbar:86264): GLib-CRITICAL **: 15:55:41.193: g_source_set_callback: assertion 'source != NULL' failed
(sfwbar:86264): GLib-CRITICAL **: 15:55:41.193: g_source_attach: assertion 'source != NULL' failed
(sfwbar:86264): GLib-CRITICAL **: 15:55:41.193: g_source_unref: assertion 'source != NULL' failed
(sfwbar:86264): GLib-CRITICAL **: 15:55:41.193: g_unix_signal_source_new: assertion 'signum == SIGHUP || signum == SIGINT || signum == SIGTERM || signum == SIGUSR1 || signum == SIGUSR2 || signum == SIGWINCH' failed
(sfwbar:86264): GLib-CRITICAL **: 15:55:41.193: g_source_set_callback: assertion 'source != NULL' failed
(sfwbar:86264): GLib-CRITICAL **: 15:55:41.193: g_source_attach: assertion 'source != NULL' failed
(sfwbar:86264): GLib-CRITICAL **: 15:55:41.193: g_source_unref: assertion 'source != NULL' failed
LBCrion commented 1 year ago

What version of sfwbar and glib are you using please? Can you run sfwbar in gdb and get a stacktrace on this?

devosalain commented 1 year ago

I'm sorry i'm lacking the technical skills. I'll check glib version. In FreeBSD launching sfwbar does nothing , shows nothing. like it is in an endless loop. I use also Gentoo-Linux. And there sfwbar works just fine.

LBCrion commented 1 year ago

Is this with your config with mpd widget removed? I recall that was causing trouble on bsd system.

Did the error in the first message still appear, or does the program just go into infinite loop now?

LBCrion commented 1 year ago

Can you try the latest git please? I have a suspicion, I may have found the source of the errors above.

devosalain commented 1 year ago

I'm currently in the process of compiling glib to a newer version. I'm come back when the process is finished.

devosalain commented 1 year ago

.

devosalain commented 1 year ago

After removing the mpd items, t2.config works, nice. vertical.config does not work (shows nothing)

LBCrion commented 1 year ago

Do you still get the error messages you mentioned in the first post with the latest git?

Can you try running sfwbar -d -f vertical.config and post the output?

devosalain commented 1 year ago

sfwbar -d -f ./vertical.config

22:09:35,01 foreign toplevel state for 0x858f22050: 
22:09:35,01 app_id: 'org.kde.falkon', title 'Freebsd sfwbar dies · Issue #52 · LBCrion/sfwbar - Falkon'
22:09:35,01 foreign toplevel state for 0x84b729bb0: Minimized, 
22:09:35,01 app_id: 'gtk-mixer', title 'Audio Mixer - IDT 92HD73E1 (Analog 7.1+HP/2.0)'
22:09:35,01 foreign toplevel state for 0x84b729b60: Activated, 
22:09:35,01 app_id: 'xfce4-terminal', title 'Terminal - '
22:09:35,01 foreign toplevel state for 0x84b729b10: Minimized, 
22:09:35,01 app_id: 'audacious', title 'rij3 - cd01_whitney_greatest_hits_1 - track03.cdda (4:46) - Audacious'
22:09:35,01 foreign toplevel state for 0x84b729ac0: 
22:09:35,01 app_id: 'Cairo-clock', title 'MacSlow's Cairo-klok'
22:09:35,01 foreign toplevel state for 0x84b729a70: 
22:09:35,01 app_id: 'Conky', title 'MYCONKY'
22:09:35,01 foreign toplevel state for 0x84b729a20: 
22:09:35,01 app_id: 'Conky', title 'MYCONKY'
22:09:35,01 include: ./vertical.config -> ./vertical.config
22:09:35,01 expr: ""firefox"" = "firefox"
22:09:35,02 image: firefox @ 2
22:09:35,02 expr: ""Alacritty"" = "Alacritty"
22:09:35,03 image: Alacritty @ 2
22:09:35,03 expr: ""frame"" = "frame"
22:09:35,13 image: Alacritty @ 2
22:09:35,13 image: firefox @ 2
22:09:35,13 widget action: (418) overlay
22:09:35,15 image: firefox @ 2
22:09:35,15 image: Alacritty @ 2
22:09:35,16 image: Alacritty @ 2
22:09:35,16 image: firefox @ 2
22:09:35,16 widget action: (417) eDP-1
22:09:35,16 sni host org.kde.StatusNotifierHost-92975: found watcher org.kde.StatusNotifierWatcher (:1.11)
22:09:35,16 sni host org.freedesktop.StatusNotifierHost-92975: found watcher org.freedesktop.StatusNotifierWatcher (:1.11)

and then nothing happens.

sfwbar -d -f ./t2.config works perfect however.

LBCrion commented 1 year ago

Would you mind posting a copy of your vertical.config? Looking at the log, the window should already be visible by the time the program stalls.

devosalain commented 1 year ago

cat vertical.config

function("SfwbarInit") {
  SetLayer "overlay"
  SetMonitor "eDP-1"
}

function("ToggleMinimize") {
  [!Minimized] Minimize
  [Minimized] UnMinimize
}

function("ToggleMaximize") {
  [!Maximized] Maximize
  [Maximized] UnMaximize
}

menu("winops") {
  item("focus", Focus );
  item("close", Close );
  item("(un)minimize", Function "ToggleMinimize" );
  item("(un)maximize", Function "ToggleMaximize" );
}

placer {
  xstep = 5    # step by 5% of desktop horizontally
  ystep = 5    # step by 5% of desktop vertically
  xorigin = 5
  yorigin = 5
  children = false
}

# Task Switcher

switcher {
  interval = 700
  icons = true
  labels = false
  cols = 5
}

# Panel layout

layout {

  # add a taskbar
  taskbar {
    css = "* { -GtkWidget-vexpand: false; }" # take up empty space, set icon size
    icons = true     # display icons
    labels = false   # don't display titles
    cols = 1        # stack window buttons across two rows
    action[3] = Menu "winops"
  }

  label {
    css = "* { -GtkWidget-vexpand: true; }"
  }

  # add a pager
  pager {
    preview = true
    cols = 2
    pins = "1","2","3","4"
  }

  # add a launcher
  button {
    action = "firefox"                        # launch firefox on click
    value = "firefox"                          # set icon on the button
    css = "* { min-height: 1.25cm; min-width: 1.25cm; }"   # set icon size
  }
 button {
    action = "alacritty"
    value = "Alacritty"
    css = "* { min-height: 1.25cm; min-width: 1.25cm; }"
  }

  tray

  grid {
    style = "frame"
  }

}

#CSS
window {
  -GtkWidget-direction: left;
}

#hidden {
  -GtkWidget-visible: false;
}

button#taskbar_normal *, button#taskbar_active *, button#taskbar_normal:hover * {
  min-height: 1.25cm;
  -GtkWidget-hexpand: true;
}

button#taskbar_normal label, button#taskbar_active label, button#taskbar_normal:hover label {
  min-height: 1.25cm;
  padding: 0px;
  font: 0.3cm Sans;
}

button#taskbar_normal , button#taskbar_active , button#taskbar_normal:hover {
  min-height: 1.25cm;
  padding: 0.5mm;
  background-image: none;
  border-radius: 0;
  border-image: none;
}

button#taskbar_active {
  background-color: #bbddff;
}

button#taskbar_normal:hover {
  background-color: #cccccc;
}

button#pager_normal , button#pager_visible , button#pager_focused {
  -GtkWidget-hexpand: true;
  padding-left: 1.25mm;
  padding-right: 1.25mm;
  padding-top: 0.5mm;
  padding-bottom: 0.5mm;
  background-image: none;
  border-radius: 0;
  border-image: none;
  font: 0.3cm Sans;
}

button#pager_focused {
  background-color: #bbddff;
}

button#pager_preview {
  background-image: none;
  border-radius: 0;
  border-image: none;
  border-color: #000000;
  border-width: 0.25mm;
  color: #777777;
  min-width: 5cm;
  min-height: 2.8125cm;
}

grid#pager {
  outline-color: #000000;
  outline-style: dashed;
  outline-width: 0.25mm;
}

grid#switcher_active *, grid#switcher_active, grid#switcher_active * * {
  min-width: 1.25cm;
  min-height: 1.25cm;
  background-color: #bbddff;
  border-image: none;
  border-radius: 1.25mm;
  padding: 1.25mm;
}

grid#switcher_normal *, grid#switcher_normal {
  min-width: 1.25cm;
  min-height: 1.25cm;
  border-image: none;
  padding: 1.25mm;
}

window#switcher {
  border-style: solid;
  border-width: 0.25mm;
  border-color: #000000;
  border-radius: 1.25mm;
  padding: 1.25mm;
}

grid#switcher {
  border-radius: 1.25mm;
  padding: 1.25mm;
}

button#tray_active,
button#tray_passive,
button#tray_attention {
  background-image: none;
  border: 0px;
  padding: 0px;
  margin: 0px;
  border-image: none;
  border-radius: 0px;
  outline-style: none;
  box-shadow: none;
  -GtkWidget-direction: bottom;
}

button#tray_active image,
button#tray_passive image,
button#tray_attention image {
  min-width: 7mm;
  min-height: 7mm;
  padding: 1mm;
}

progressbar {
  padding-left: 0.25mm;
  padding-right: 0.25mm;
  -GtkWidget-hexpand: true;
  -GtkWidget-direction: right;
}

progress, trough {
  border-radius: 0;
  border-color: #9c9c9c;
}

progress {
  border-style: outset;
  min-height: 2mm;
}

trough {
  background-color: #a1a1a1;
  border-style: inset;
  min-height: 2.5mm;
  min-width: 2.5mm;
}

grid#scales {
  -GtkWidget-direction: bottom;
}

grid#frame {
  -GtkWidget-direction: bottom;
  -GtkWidget-vexpand: false;
  min-height: 1.5cm;
  border-color: #9c9c9c;
  border-style: groove;
  border-width: 0.5mm;
  padding-top: 0.25mm;
}

grid#layout {
  padding: 0.25mm;
  -GtkWidget-direction: bottom;
}

label#value {
  -GtkWidget-hexpand: true;
  -GtkWidget-align: 1;
  padding-right: 2mm;
  padding-left: 2mm;
}

image#value_icon {
  min-width: 0.25cm;
  min-height: 0.25cm;
}

button#idle_inhibit {
  -GtkWidget-hexpand: true;
}

label {
  font: 0.27cm Sans;
  color: #000000;
}

tooltip label {
  color: #cccccc;
}

label#awesome {
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
}
LBCrion commented 1 year ago

This is odd, by all accounts this config should be working. But your log shows that images never get scaled to a visible size. Can you post your t2.config which works for comparison? (and output of sfwbar -d -f t2.config if possible)

devosalain commented 1 year ago

Below the good working and functional t2.config, HOST:x: /home/x/.config/sfwbar/configs >cat t2.config

# Window Placer
placer {
  xorigin = 5  # place the first window at X% from the left
  yorigin = 5  # place the first window at X% from the top
  xstep = 5    # step by X% of desktop horizontally
  ystep = 5    # step by X% of desktop vertically
  children = true
}

# Task Switcher
switcher {
  interval = 700
  icons = true
  labels = false
  cols = 5
}

function("SfwbarInit") {
  SetBarId "bar-0"
  SetLayer "top"
  SetExclusiveZone "-1"
  SetMonitor "eDP-1"
#  SetBarSize "bar1","800" 
}

function("ToggleMinimize") {
  [!Minimized] Minimize
  [Minimized] UnMinimize
}

function("ToggleMaximize") {
  [!Maximized] Maximize
  [Maximized] UnMaximize
}

function("ToggleValue") {
  [!UserState] UserState "on"
  [!UserState] SetValue "firefox"
  [UserState] UserState "off"
  [UserState] SetValue "alacritty"
}

menu("winops") {
  item("focus", Focus );
  item("close", Close );
  item("(un)minimize", Function "ToggleMinimize" );
  item("(un)maximize", Function "ToggleMaximize" );
}

# Panel layout

layout "tint2" {
    image {
      value = "firefox"
      action = "firefox"                        # launch firefox on click
      style = "launcher"
    }
    image {
      value = "Alacritty"
      action = "alacritty"
      style = "launcher"
    }

  pager {
    style = "pager"
    rows = 1
    preview = true
    numeric = true
  }

  taskbar {
    rows = 1
    css = "* { -GtkWidget-hexpand: true; }" # stretch horizontally
    icons = true
    labels = true
    filter_output = true
    action[3] = Menu "winops"
  }

  tray {
    rows = 1
  }

  grid {
    css = "* { padding-left: 5px; padding-right: 5px; }"
    label {
      value = Time("%k:%M")
      loc(1,1)
    }
    label {
      value = Time("%A %e %B")
      loc(1,2)
    }
  }
}

#CSS
window#tint2 {
  -GtkWidget-direction: bottom;
  background-color: rgba(0,0,0,0.6);
  border-color: rgba(0,0,0,0.3);
}

#hidden {
  -GtkWidget-visible: false;
}

button#taskbar_normal grid {
  -GtkWidget-hexpand: false;
  padding-right: 0px;
  margin-right: 0px;
}

button#taskbar_normal image, button#taskbar_active image, button#taskbar_normal:hover image {
  -GtkWidget-vexpand: true;
  box-shadow: none;
  border: none;
  border-image: none;
  background-image: none;
  background: none;
  min-width: 24px;
  min-height: 24px;
  -gtk-icon-shadow: none;
}

button#taskbar_normal label, button#taskbar_active label, button#taskbar_normal:hover label {
  -GtkWidget-vexpand: true;
  -GtkWidget-hexpand: false;
  padding-left: 0.75mm;
  padding-top: 0px;
  padding-bottom: 0px;
  font: 0.3cm Sans;
}

button#taskbar_normal , button#taskbar_active , button#taskbar_normal:hover {
  padding-left: 0.75mm;
  padding-top: 0.5mm;
  padding-bottom: 0.5mm;
  background-image: none;
  border-radius: 4px;
  border-image: none;
  -GtkWidget-hexpand: false;
  -GtkWidget-vexpand: true;
  background-color: rgba(119,119,119,0.2);
  border-color: rgba(119,119,119,0.3);
  box-shadow: none;
}

button#taskbar_active {
  background-color: rgba(119,119,119,0.2);
  border-color: rgba(255,255,255,0.4);
}

button#taskbar_normal:hover , button#taskbar_active:hover {
  background-color: rgba(176,176,176,0.22);
  border-color: rgba(234,234,234,0.44);
}

button#pager_normal , button#pager_visible , button#pager_focused {
  padding-left: 1.25mm;
  padding-right: 1.25mm;
  padding-top: 0.5mm;
  padding-bottom: 0.5mm;
  background-image: none;
  border-radius: 4px;
  border-image: none;
  font: 0.3cm Sans;
  background-color: rgba(119,119,119,0.0);
  border-color: rgba(119,119,119,0.0);
  box-shadow: none;
}

button#pager_focused {
  background-color: rgba(119,119,119,0.2);
  border-color: rgba(255,255,255,0.0);
}

button#pager_preview {
  background-image: none;
  border-radius: 0;
  border-image: none;
  border-color: #000000;
  border-width: 0.25mm;
  color: #777777;
  min-width: 5cm;
  min-height: 2.8125cm;
}

grid#pager {
  outline-color: #000000;
  outline-style: dashed;
  outline-width: 0.25mm;
}

grid#switcher_active image,
grid#switcher_active {
  min-width: 1.25cm;
  min-height: 1.25cm;
  border-image: none;
  padding: 1.25mm;
  background-color: #777777;
  border: 0px;
  box-shadow: none;
  border-radius: 1.25mm;
  -GtkWidget-hexpand: true;
}

grid#switcher_normal image,
grid#switcher_normal {
  min-width: 1.25cm;
  min-height: 1.25cm;
  border-image: none;
  padding: 1.25mm;
  -GtkWidget-direction: right;
  -GtkWidget-hexpand: true;
}

window#switcher { 
  border-style: solid;
  border-width: 0.25mm;
  border-color: #000000;
  border-radius: 1.25mm; 
  padding: 1.25mm; 
  -GtkWidget-hexpand: true;
}

grid#switcher { 
  border-radius: 1.25mm;
  padding: 1.25mm;
  background-color: rgba(0,0,0,0.8);
  border-color: rgba(119,119,119,0.8);
  box-shadow: none;
  -GtkWidget-hexpand: true;
}

image#tray_active, image#tray_passive, image#tray_attention {
  min-width: 1.25cm;
  min-height: 1.25cm;
}

grid#layout {
  padding: 0.25mm;
  -GtkWidget-direction: right;
  min-height: 30px;
}

image#launcher {
  -GtkWidget-hexpand: true;
  -GtkWidget-vexpand: true;
  min-width: 24px;
  min-height: 24px;
  padding-right: 2px;
}

menu {
  background-color: rgba(0,0,0,0.8);
  border-color: rgba(119,119,119,0.3);
  box-shadow: none;
}

menuitem {
color: #ffffff;
}

label {
  font: 0.27cm Sans;
  color: #ffffff;
  text-shadow: none;
}

* {
  -GtkWidget-vexpand: true;
}
devosalain commented 1 year ago

The log file of t2.config, sfwbar -d sfwbar -d -f ./.config/sfwbar/configs/t2.config

HOST:x: /home/x >sfwbar -d sfwbar -d -f ./.config/sfwbar/configs/t2.config 
21:00:56,74 foreign toplevel state for 0x859eff050: 
21:00:56,74 app_id: 'org.kde.falkon', title 'Freebsd sfwbar dies · Issue #52 · LBCrion/sfwbar - Falkon'
21:00:56,74 foreign toplevel state for 0x84c2a9c00: Minimized, 
21:00:56,74 app_id: 'gtk-mixer', title 'Audio Mixer - IDT 92HD73E1 (Analog 7.1+HP/2.0)'
21:00:56,74 foreign toplevel state for 0x84c2a9bb0: Activated, 
21:00:56,74 app_id: 'xfce4-terminal', title 'Terminal - '
21:00:56,74 foreign toplevel state for 0x84c2a9b60: Minimized, 
21:00:56,74 app_id: 'audacious', title 'rij1 - cd10_anne_clarck_word_processing - track02.cdda (6:23) - Audacious'
21:00:56,74 foreign toplevel state for 0x84c2a9b10: 
21:00:56,74 app_id: 'Cairo-clock', title 'MacSlow's Cairo-klok'
21:00:56,74 foreign toplevel state for 0x84c2a9ac0: 
21:00:56,74 app_id: 'Conky', title 'MYCONKY'
21:00:56,74 foreign toplevel state for 0x84c2a9a70: 
21:00:56,74 app_id: 'Conky', title 'MYCONKY'
21:00:56,74 include: ./.config/sfwbar/configs/t2.config -> ./.config/sfwbar/configs/t2.config
21:00:56,75 expr: ""firefox"" = "firefox"
21:00:56,80 image: firefox @ 2
21:00:56,80 expr: ""launcher"" = "launcher"
21:00:56,80 expr: ""Alacritty"" = "Alacritty"
21:00:56,85 image: Alacritty @ 2
21:00:56,85 expr: ""launcher"" = "launcher"
21:00:56,85 expr: ""pager"" = "pager"
21:00:56,85 expr: "Time("%k:%M")" = "21:00"
21:00:56,85 expr: "Time("%A %e %B")" = "woensdag 19 oktober"
21:00:57,21 image: Alacritty @ 2
21:00:57,21 image: firefox @ 2
21:00:57,21 widget action: (420) bar-0
21:00:57,21 widget action: (418) top
21:00:57,21 widget action: (432) -1
21:00:57,21 widget action: (417) eDP-1
21:00:57,21 expr: "Time("%k:%M")" = "21:00"
21:00:57,21 expr: "Time("%A %e %B")" = "woensdag 19 oktober"
21:00:57,21 image: firefox @ 2
21:00:57,21 image: Alacritty @ 2
21:00:57,29 image: firefox @ 24
21:00:57,29 image: Alacritty @ 24
21:00:57,30 sni host org.kde.StatusNotifierHost-62420: found watcher org.kde.StatusNotifierWatcher (:1.6)
21:00:57,30 sni host org.freedesktop.StatusNotifierHost-62420: found watcher org.freedesktop.StatusNotifierWatcher (:1.6)
21:00:57,30 image: Alacritty @ 30
21:00:57,31 image: firefox @ 30
21:00:57,31 image: audacious @ 2
21:00:57,32 image: xfce4-terminal @ 2
21:00:57,32 image: Cairo-clock @ 2
21:00:57,32 image: Conky @ 2
21:00:57,33 image: Conky @ 2
21:00:57,33 image: org.kde.falkon @ 2
21:00:57,33 image: gtk-mixer @ 2
21:00:57,33 image: gtk-mixer @ 24
21:00:57,34 image: org.kde.falkon @ 24
21:00:57,34 image: Conky @ 24
21:00:57,34 image: Conky @ 24
21:00:57,34 image: Cairo-clock @ 24
21:00:57,34 image: xfce4-terminal @ 24
21:00:57,35 image: audacious @ 24
21:00:57,35 image: audacious @ 24
21:00:57,35 image: xfce4-terminal @ 24
21:00:57,35 image: Cairo-clock @ 24
21:00:57,35 image: Conky @ 24
21:00:57,36 image: Conky @ 24
21:00:57,36 image: org.kde.falkon @ 24
21:00:57,36 image: gtk-mixer @ 24
21:00:57,36 image: Alacritty @ 24
21:00:57,36 image: firefox @ 24
21:00:57,37 expr: "Time("%k:%M")" = "21:00"
21:00:57,37 expr: "Time("%A %e %B")" = "woensdag 19 oktober"
21:00:58,37 expr: "Time("%k:%M")" = "21:00"
21:00:58,37 expr: "Time("%A %e %B")" = "woensdag 19 oktober"
21:00:59,38 expr: "Time("%k:%M")" = "21:00"
21:00:59,38 expr: "Time("%A %e %B")" = "woensdag 19 oktober"
21:01:00,37 expr: "Time("%k:%M")" = "21:01"
LBCrion commented 1 year ago

Can you try a couple of things with vertical config?

  1. Change SetLayer "overlay" to SetLayer "top" and see if that works
  2. in #CSS window { } section change -GtkWidget-direction: from left to bottom and see if the window shows up (it will be ugly if it does) and if this works, try changing it to right and see if that works.

Also, what compositor are you using? Labwc?

devosalain commented 1 year ago

The compositor is labwc

LBCrion commented 1 year ago

Can you please check the version of gtk-layer-shell you're using? And if you get a chance, try the vertical config with the above changes.

devosalain commented 1 year ago

I perfermod these two changes but still nothing is shown.

LBCrion commented 1 year ago

Can you try running GTK_DEBUG=geometry sfwbar -f vertical.config and post output please? A few other things to try:

  1. remove SetMonitor action from SfwbarInit function
  2. remove tray (since this is the last output we get in debug)
  3. change layout { to layout "blah" {
  4. Remove grid { style = "frame" } I'm trying to figure out why one config runs and the other doesn't on your system, so trying to eliminate differences between them to find out what causes this.
LBCrion commented 1 year ago

Also try the latest git version of sfwbar please. While digging through this I fixed a race condition in SetMonitor function.

LBCrion commented 1 year ago

Hi @devosalain, can you please try the latest git version to see if you still get this issue?

elgithubo commented 1 year ago

Hey @LBCrion, Just jumping in to confirm v1.0beta9 works fine on FreeBSD for me. :) Thanks!

LBCrion commented 3 months ago

Closing this for now as it was fixed a while ago. Please feel free to reopen if you experience any more crashes.