Giter Site home page Giter Site logo

sfwbar's Introduction

SFWBar

SFWBar (S* Floating Window Bar) is a flexible taskbar application for wayland compositors, designed with a stacking layout in mind. Originally developed for Sway, SFWBar will work with any wayland compositor supporting layer shell protocol, the taskbar and window switcher functionality shall work with any compositor supportinig foreign toplevel protocol, but the pager, and window placement functionality require sway (or at least i3 IPC support).

If you're getting expression errors when upgrading from version 1.0_beta9 or earlier, please check your data types. The expression parser now applies strict type checks.

SFWBar is licensed under GNU GPL. Weather icons are from yr.no and are licensed under MIT license

SFWBar implements the following features:

  1. Taskbar - to control floating windows
  2. Task Switcher - to allow switching active window (Alt-Tab)
  3. Pager - to allow switching between workspaces
  4. Tray - a system tray using status notification item protocol
  5. Window placement engine - to open new windows in more logical locations
  6. A simple widget set to display information from system files

Compiling from Source

Install dependencies:

  • gtk3
  • gtk-layer-shell
  • json-c

Runtime dependencies:

  • python is used by some widgets (i.e. battery and start menu widgets)
  • symbolic icons are used by battery.widget

Compile instructions:

meson setup build
ninja -C build
sudo ninja -C build install

Configuration

Copy sfwbar.config from /usr/share/sfwbar/ to ~/.config/sfwbar/ If you prefer to start with something more like tint2 bar, you can copy t2.config into ~/.config/sfwbar/sfwbar.config instead. If you want something like waybar, you can copy wbar.config and if you prefer something from the darker side, w10.config could be for you. For more information on the format of configuration file, please see the man page

If you're using sway, you may want to add the following lines to your sway config file to open windows as floating by default:

# open new windows as floating by default
for_window [app_id="[.]*"] floating enable
# set Alt-tab as a task switcher combo
bindsym Alt+Tab bar hidden_state toggle 
# set $mod+c to hide/unhide taskbar 
bindsym $mod+c bar mode toggle

sfwbar's People

Contributors

01micko avatar avillacis avatar b1rger avatar cid-chan avatar consolatis avatar iggut avatar joshuataylor avatar keshto avatar lbcrion avatar mozlima avatar neilpang avatar user18130814200115-2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

sfwbar's Issues

About the gtk3 dependency

I'm on Void Linux and trying to run the command meson build gives me the error Run-time dependency gtk+-3.0 found: NO (tried pkgconfig and cmake). But I already have the gtk+3 package from void, so I don't understand what I have to do

Width for taskbar items

Hi!

I'm trying to set a width for the taskbar items, similar to the way XFCE works here: https://i.imgur.com/dsjdjUO.png , where the taskbar items have a max width, then there is whitespace until the end of the items.

Is this possible through sfwbar (or gtk(?))?

I'm not completely sure how it works, but from what I can see you can't set a max width?

When setting my taskbar like this:

  taskbar {
    rows = 1
    style = "taskbar"
    icons = true
    labels = true
    filter_output = true
    action[3] = Menu "winops"
    title_width = 15
    sort = false
  }

then setting my CSS like this:

grid#taskbar button { 
    min-width: 200px;
}

This seems to show okay, but the grid is next to the taskbar (and then the items):
image

Is there a way to add a spacer or something in between the items and the grid, where the items can take the full width if there are enough items?

(I'm using the latest git builds)

Is there a way to make a "Show Desktop" button?

I want a button on my sfwbar that:

  • Clicking once minimizes all windows
  • Clicking another time restores all minimized windows

Windows has this at the bottom right corner. Wanted to mimic the same thing.

All I was able to make is a button that minimizes the current focused window and restores with another click:

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

Feature discussion: Display taskbar items only for that workspace

When using XFCE/KDE, when having multiple workspaces the applications in the taskbar are only for that workspace.

Looking through the code, it seems that taskbaritem.c has the concept about what workspace the item belongs to, but doesn't know which workspaces actually exist.

I'm not even sure if it SHOULD know, as that should belong to taskbar.c in taskbar_invalidate_all, where it could pass the workspace from win?

I would be happy to take a look at this, pending discussion :)

Crashes on launch (Arch Linux)

I installed the AUR package, tried running it and it crashed, so I tried building it from the source here, ran that binary with ./sfwbar, and got this same error.

This is what is printed in the terminal:
terminal.txt
And this is the wget-log
wget-log.txt

Question: How to center a grid?

In a way that it shows up at the center of the screen?
I have this layout: taskbar - label (for spacing) - grid (I want this centered) - label (spacing again) - tray. But it's not exactly centered.

Feature request: support multiple instances

Ideally one per monitor.
Invoking sfwbar the second time (or for example sfbar -m list) used to cause segfault, now animations on the first instance don't work and the space where another instance would be is just reserved (there's no bar)

FLOW_GRID error and glib warning

(sfwbar:14563): GLib-CRITICAL **: 14:50:57.867: g_hash_table_lookup: assertion 'hash_table != NULL' failed
14:50:58.17 flow_grid_update: assertion 'IS_FLOW_GRID(self)' failed
14:50:58.27 flow_grid_update: assertion 'IS_FLOW_GRID(self)' failed

This is what I get running sfwbar on CLI , main as of today.

The glib error is from previous versions back to beta6 as well. Just haven't had the time to report.

I'll post my configs too.

# main config
# stock puppy sfwbar.config

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

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

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

function("SfwbarInit") {
  SetLayer "bottom"
  SetMonitor "DVI-D-1"
}

# Panel layout

layout {
  style = frame

  button {
    value = "/usr/share/pixmaps/puppy/puppy.svg"
    action = "killall -usr1 altf1d"                        # launch menu on click
    tooltip = "Launch menu"
    css = "* { min-height: 24px; min-width: 48px; }"
  }

  image {
    value = "terminal"
    action = "defaultterminal"
    tooltip = "Launch terminal"
    css = "* { min-height: 24px; min-width: 24px; padding: 5px; }"
  }

  image {
    value = "browser"
    action = "defaultbrowser"
    tooltip = "Launch browser"
   css = "* { padding: 5px; }"
  }

  image {
    value = "directory"
    action = "defaultfilemanager"
    tooltip = "Launch file manager"
    css = "* { min-height: 24px; min-width: 24px; padding: 5px; }"
  }

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

  include("pupnet.widget")

  image {
    value = "audio-volume-high"
    action[1] = "ppavolume"
    action[2] = "fix_sound_crash"
    action[3] = "pavucontrol"
    tooltip = "Volume control"
    css = "* { min-height: 24px; min-width: 24px; padding: 4px; }"
  }

  include("idle.widget")
  include("temp.widget")
  include("clock.widget")

  image {
    value = "shutdown"
    action = "logout_gui"
    tooltip = "Logout"
    css = "* { min-height: 24px; min-width: 24px; padding: 4px; }"
  }

}

#CSS
window {
  -GtkWidget-direction: top;
	border-radius: 6px;
	color: rgba(17,  17,  17, 0.73);
}

button#taskbar_normal image, button#taskbar_active image, button#taskbar_normal:hover image {
  background-color: rgba(0, 0, 0, 0.0);
  min-width: 0.4cm;
  min-height: 0.4cm;
}

button#taskbar_normal label, button#taskbar_active label, button#taskbar_normal:hover label {
  background-color: rgba(0, 0, 0, 0.0);
  -GtkWidget-vexpand: true;
  padding-left: 0.5mm;
  padding-top: 0px;
  padding-bottom: 0px;
  font: 10pt Sans;
}

button#taskbar_normal , button#taskbar_active , button#taskbar_normal:hover {
  padding: 3px;
  border: 0.5px;
}

button#pager_normal , button#pager_visible , button#pager_focused {
  background-color: rgba(0, 0, 0, 0.0);
  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: 10pt Sans;
}

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

button#pager_preview {
	background-color: rgba(0, 0, 0, 0.0);
  background-image: none;
  border-radius: 0;
  border-image: none;
  border-color: #000000;
  border-width: 0.25mm;
  color: #777777;
  min-width: 5cm;
  min-height: 1.4125cm;
}

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

button#menu {
  background-color: transparent;
  border: 1px solid transparent;
  padding: 3px;
}

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

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

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

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;
}

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

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

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

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

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

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

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

label#value {
  min-width: 1cm;
  -GtkWidget-hexpand: true;
  -GtkWidget-align: 0.5;
}

image#value_icon {
  padding: 0.1cm;
  min-width: 16px;
  min-height: 16px;
}

button {
  padding: 3px;
  border-width: 0.5px;
  border-radius: 6px;
}

and

# launcher config
# runs with:
# sfwbar -f /tmp/sfw
function("SfwbarInit") {
  SetLayer "bottom"
  SetMonitor "DVI-D-1"
  SetBarSize "160"
}

layout {
  style = frame
  grid {
	  css = "* { -GtkWidget-direction: bottom; }"
	  button {
	    value = "directory-home"
	    action = "defaultfilemanager"
	    tooltip = "File Manager"
	    css = "* { min-height: 36px; min-width: 28px; margin: 3px; }"
	  }
	  button {
	    value = "edit"
	    action = "defaulttexteditor"
	    tooltip = "Text Editor"
	    css = "* { min-height: 36px; min-width: 28px; margin: 3px; }"
	  }
	  button {
	    value = "browser"
	    action = "defaultbrowser"
	    tooltip = "Browser"
	    css = "* { min-height: 36px; min-width: 28px; margin: 3px; }"
	  }
	  button {
	    value = "mail"
	    action = "defaultemail"
	    tooltip = "Email"
	    css = "* { min-height: 36px; min-width: 28px; margin: 3px; }"
	  }
	  button {
	    value = "paint"
	    action = "defaultpaint"
	    tooltip = "Paint"
	    css = "* { min-height: 36px; min-width: 28px; margin: 3px; }"
	  }
	  button {
	    value = "terminal"
	    action = "defaultterminal"
	    tooltip = "Terminal"
	    css = "* { min-height: 36px; min-width: 28px; margin: 3px; }"
	  }
  }
}

#CSS
window {
  -GtkWidget-direction:left;
	border-radius: 6px;
	background-color: rgba(17, 17, 17, 0.333);
}

Screenshot

20220625_14h58m52s_grim

SetLayer not working

In my setup I have this:

function("SfwbarInit") {
  SetLayer "background"
  SetMonitor "DVI-D-1"
}

The bar starts on the correct monitor but not on the 'background' layer. See screenshot: (clarification: not that I want 'background' but same thing with 'bottom', which I do want if I run a second instance of the bar)

sfw-bug

For comparison I drew a simple gtkdialog window invoking gtk-layer-shell - the second 2 attributes to the <window> widget. Firefox or Celluloid can not go into 'fullscreen'. It seems to me that sfwbar is always starting on overlay.

Running latest labwc v0.5 branch.

Thanks and if you need any more info I'll provide as time permits.

Still don't like the default icon

.. so I made one!

<?xml version="1.0" encoding="utf-8"?>
<!-- 01micko GPLv3.0  -->

<svg version="1.1" id="_x31_0" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 512 512" style="width: 256px; height: 256px; opacity: 1;" xml:space="preserve">
<style type="text/css">
	.st0{fill:#FFFDDD}
	.st1{fill:#374149;}
</style>
<g>
	<path class="st0" d="m 40 10 432 0 a 30 30 0 0 1 30 30 l 0 432 a 30 30 0 0 1 -30 30 l -432 0 a 30 30 0 0 1 -30 -30 l 0 -432 a 30 30 0 0 1 30 -30 z"></path>
	<path class="st1" d="m 35 440 442 0 a 6 6 0 0 0 6 -6 l 0 -24 a 6 6 0 0 0 -6 -6 l -442 0 a 6 6 0 0 0 -6 6 l 0 24 a 6 6 0 0 0 6 6 z 
						 m 0 -64 126 0 a 32 32 0 0 0 32 -32 l 0 -40 a 32 32 0 0 0 -32 -32 l -88 0 a 6 6 0 0 1 -6 -6 l 0 -24 a 6 6 0 0 1 6 -6
						 l 114 0  a 6 6 0 0 0 6 -6 l 0 -24 a 6 6 0 0 0 -6 -6 l -126 0 a 32 32  0 0 0 -32 32 l 0 40 a 32 32 0 0 0 32 32 l 88 0
						 a 6 6 0 0 1 6 6 l 0 24 a 6 6 0 0 1 -6 6 l -114 0 a 6 6 0 0 0 -6 6 l 0 24 a 6 6 0 0 0 6 6 z
						 m 172 0 24 0 a 6 6 0 0 0 6 -6 l 0 -128 a 6 6 0 0 1 6 -6 l 32 0 a 6 6 0 0 0 6 -6 l 0 -24 a 6 6 0 0 0 -6 -6 
						 l -32 0 a 6 6 0 0 1 -6 -6 l 0 -24 a 6 6 0 0 1 6 -6 l 64 0 a 6 6 0 0 0 6 -6 l 0 -24 a 6 6 0 0 0 -6 -6
						 l -76 0 a 32 32 0 0 0 -32 32 l 0 210 a 6 6 0 0 0 6 6 z
						 m 116 0 48 0 a 16 16 0 0 0 16 -16 a 16 16 0 0 0 16 16 l 48 0 a 32 32 0 0 0 32 -32 l 0 -138 a 6 6 0 0 0 -6 -6 l -24 0
						 a 6 6 0 0 0 -6 6 l 0 128 a 6 6 0 0 1 -6 6 l -20 0 a 6 6 0 0 1 -6 -6 l 0 -12 a 6 6 0 0 0 -6 -6 l -52 0
						 a 6 6 0 0 0 -6 6 l 0 12 a 6 6 0 0 1 -6 6 l -20 0 a 6 6 0 0 1 -6 -6 l 0 -128 a 6 6 0 0 0 -6 -6 
						 l -20 0 a 6 6 0 0 0 -6 6 l0 138  a 32 32 0 0 0 32 32 z"></path>
</g>
</svg>

png preview

sfwbar

First click on taskbar button doesn't unminimize window

Using labwc and latest sfwbar git. Easiest to see if you only have one application open.

  1. Minimize window by clicking on taskbar button (See how it also stays blue, should mean it is still activated, right?)
  2. Click on taskbar button again, now it should unminimize but doesn't. (Only now does the button change to grey.)
  3. Click again, now it does unminimize.

If you look at the video you can also see how the state doesn't change. I'm using wl_framework to monitor that.
I've also tried it with the default oneline.config, same behavior.

2022-09-17_02-59-38.mp4

sfwbar is not compiling anymore on FreeBSD

Here is the log

git pull --rebase
rm -vfR build
meson build
ninja -C build
./rebuild 
Already up to date.
build/idle-inhibit-unstable-v1.h
build/meson-info/intro-targets.json
build/meson-info/intro-projectinfo.json
build/meson-info/intro-tests.json
build/meson-info/intro-buildsystem_files.json
build/meson-info/intro-install_plan.json
build/meson-info/intro-benchmarks.json
build/meson-info/intro-installed.json
build/meson-info/intro-dependencies.json
build/meson-info/intro-buildoptions.json
build/meson-info/meson-info.json
build/meson-info
build/wlr-foreign-toplevel-management-unstable-v1.h
build/xdg-output-unstable-v1.c
build/compile_commands.json
build/.gitignore
build/.ninja_log
build/meson-private/sanitycheckc.exe
build/meson-private/meson_test_setup.dat
build/meson-private/meson_benchmark_setup.dat
build/meson-private/install.dat
build/meson-private/sanitycheckc.c
build/meson-private/meson.lock
build/meson-private/cleantrees.dat
build/meson-private/coredata.dat
build/meson-private/build.dat
build/meson-private/cmd_line.txt
build/meson-private
build/build.ninja
build/xdg-output-unstable-v1.h
build/wlr-foreign-toplevel-management-unstable-v1.c
build/idle-inhibit-unstable-v1.c
build/.hgignore
build/meson-logs/meson-log.txt
build/meson-logs
build/sfwbar.p/meson-generated_.._xdg-output-unstable-v1.c.o
build/sfwbar.p
build
The Meson build system
Version: 0.62.2
Source dir: /usr/home/x/Git_Apps/sfwbar
Build dir: /usr/home/x/Git_Apps/sfwbar/build
Build type: native build
Project name: sfwbar
Project version: undefined
C compiler for the host machine: ccache cc (clang 13.0.0 "FreeBSD clang version 13.0.0 ([email protected]:llvm/llvm-project.git llvmorg-13.0.0-0-gd7b669b3a303)")
C linker for the host machine: cc ld.lld 13.0.0
Host machine cpu family: x86_64
Host machine cpu: x86_64
Found pkg-config: /usr/local/bin/pkg-config (1.8.0)
Run-time dependency gtk+-3.0 found: YES 3.24.33
Run-time dependency glib-2.0 found: YES 2.72.2
Run-time dependency json-c found: YES 0.16
Run-time dependency gtk-layer-shell-0 found: YES 0.7.0
Run-time dependency wayland-client found: YES 1.21.0
Run-time dependency wayland-protocols found: YES 1.26
Program wayland-scanner found: YES (/usr/local/bin/wayland-scanner)
Build targets in project: 7

Found ninja-1.10.2 at /usr/local/bin/ninja
ninja: Entering directory `build'
[7/52] Compiling C object sfwbar.p/meson-generated_.._wlr-foreign-toplevel-management-unstable-v1.c.o
FAILED: sfwbar.p/meson-generated_.._wlr-foreign-toplevel-management-unstable-v1.c.o 
ccache cc -Isfwbar.p -I. -I.. -I/usr/local/include/gtk-3.0 -I/usr/local/include/pango-1.0 -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include/harfbuzz -I/usr/local/include/freetype2 -I/usr/local/include/libpng16 -I/usr/local/include/fribidi -I/usr/local/include/cairo -I/usr/local/include/pixman-1 -I/usr/local/include/gdk-pixbuf-2.0 -I/usr/local/include/gio-unix-2.0 -I/usr/local/include/libepoll-shim -I/usr/local/include/atk-1.0 -I/usr/local/include/at-spi2-atk/2.0 -I/usr/local/include/dbus-1.0 -I/usr/local/lib/dbus-1.0/include -I/usr/local/include/at-spi-2.0 -I/usr/local/include/gtk-layer-shell -I/usr/local/include/json-c -fcolor-diagnostics -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O0 -g -pthread -D_THREAD_SAFE -DGLIB_DISABLE_DEPRECATION_WARNINGS -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -MD -MQ sfwbar.p/meson-generated_.._wlr-foreign-toplevel-management-unstable-v1.c.o -MF sfwbar.p/meson-generated_.._wlr-foreign-toplevel-management-unstable-v1.c.o.d -o sfwbar.p/meson-generated_.._wlr-foreign-toplevel-management-unstable-v1.c.o -c wlr-foreign-toplevel-management-unstable-v1.c
ccache: error: Failed to create temporary file for /ccache/2/b/34a9596f74d461d32b59ed50004771-27797.o.tmp.stdout: Permission denied
[8/52] Compiling C object sfwbar.p/meson-generated_.._idle-inhibit-unstable-v1.c.o
FAILED: sfwbar.p/meson-generated_.._idle-inhibit-unstable-v1.c.o 
ccache cc -Isfwbar.p -I. -I.. -I/usr/local/include/gtk-3.0 -I/usr/local/include/pango-1.0 -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include/harfbuzz -I/usr/local/include/freetype2 -I/usr/local/include/libpng16 -I/usr/local/include/fribidi -I/usr/local/include/cairo -I/usr/local/include/pixman-1 -I/usr/local/include/gdk-pixbuf-2.0 -I/usr/local/include/gio-unix-2.0 -I/usr/local/include/libepoll-shim -I/usr/local/include/atk-1.0 -I/usr/local/include/at-spi2-atk/2.0 -I/usr/local/include/dbus-1.0 -I/usr/local/lib/dbus-1.0/include -I/usr/local/include/at-spi-2.0 -I/usr/local/include/gtk-layer-shell -I/usr/local/include/json-c -fcolor-diagnostics -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O0 -g -pthread -D_THREAD_SAFE -DGLIB_DISABLE_DEPRECATION_WARNINGS -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -MD -MQ sfwbar.p/meson-generated_.._idle-inhibit-unstable-v1.c.o -MF sfwbar.p/meson-generated_.._idle-inhibit-unstable-v1.c.o.d -o sfwbar.p/meson-generated_.._idle-inhibit-unstable-v1.c.o -c idle-inhibit-unstable-v1.c
ccache: error: Failed to create temporary file for /ccache/5/e/40381909c785222d960b889497fe82-25572.o.tmp.stdout: Permission denied
[9/52] Compiling C object sfwbar.p/meson-generated_.._xdg-output-unstable-v1.c.o
FAILED: sfwbar.p/meson-generated_.._xdg-output-unstable-v1.c.o 
ccache cc -Isfwbar.p -I. -I.. -I/usr/local/include/gtk-3.0 -I/usr/local/include/pango-1.0 -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include/harfbuzz -I/usr/local/include/freetype2 -I/usr/local/include/libpng16 -I/usr/local/include/fribidi -I/usr/local/include/cairo -I/usr/local/include/pixman-1 -I/usr/local/include/gdk-pixbuf-2.0 -I/usr/local/include/gio-unix-2.0 -I/usr/local/include/libepoll-shim -I/usr/local/include/atk-1.0 -I/usr/local/include/at-spi2-atk/2.0 -I/usr/local/include/dbus-1.0 -I/usr/local/lib/dbus-1.0/include -I/usr/local/include/at-spi-2.0 -I/usr/local/include/gtk-layer-shell -I/usr/local/include/json-c -fcolor-diagnostics -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O0 -g -pthread -D_THREAD_SAFE -DGLIB_DISABLE_DEPRECATION_WARNINGS -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -MD -MQ sfwbar.p/meson-generated_.._xdg-output-unstable-v1.c.o -MF sfwbar.p/meson-generated_.._xdg-output-unstable-v1.c.o.d -o sfwbar.p/meson-generated_.._xdg-output-unstable-v1.c.o -c xdg-output-unstable-v1.c
ccache: error: Failed to create temporary file for /ccache/0/b/0ee597557ab233d2fed77ceb7a7677-4097.manifest.tmp: Permission denied
[10/52] Compiling C object sfwbar.p/src_css.c.o
FAILED: sfwbar.p/src_css.c.o 
ccache cc -Isfwbar.p -I. -I.. -I/usr/local/include/gtk-3.0 -I/usr/local/include/pango-1.0 -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include/harfbuzz -I/usr/local/include/freetype2 -I/usr/local/include/libpng16 -I/usr/local/include/fribidi -I/usr/local/include/cairo -I/usr/local/include/pixman-1 -I/usr/local/include/gdk-pixbuf-2.0 -I/usr/local/include/gio-unix-2.0 -I/usr/local/include/libepoll-shim -I/usr/local/include/atk-1.0 -I/usr/local/include/at-spi2-atk/2.0 -I/usr/local/include/dbus-1.0 -I/usr/local/lib/dbus-1.0/include -I/usr/local/include/at-spi-2.0 -I/usr/local/include/gtk-layer-shell -I/usr/local/include/json-c -fcolor-diagnostics -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O0 -g -pthread -D_THREAD_SAFE -DGLIB_DISABLE_DEPRECATION_WARNINGS -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -MD -MQ sfwbar.p/src_css.c.o -MF sfwbar.p/src_css.c.o.d -o sfwbar.p/src_css.c.o -c ../src/css.c
ccache: error: Failed to create temporary file for /ccache/5/1/9eba6e178ff1a0e5279f28395670a2-2729112.o.tmp.stdout: Permission denied
[11/52] Compiling C object sfwbar.p/src_button.c.o
FAILED: sfwbar.p/src_button.c.o 
ccache cc -Isfwbar.p -I. -I.. -I/usr/local/include/gtk-3.0 -I/usr/local/include/pango-1.0 -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include/harfbuzz -I/usr/local/include/freetype2 -I/usr/local/include/libpng16 -I/usr/local/include/fribidi -I/usr/local/include/cairo -I/usr/local/include/pixman-1 -I/usr/local/include/gdk-pixbuf-2.0 -I/usr/local/include/gio-unix-2.0 -I/usr/local/include/libepoll-shim -I/usr/local/include/atk-1.0 -I/usr/local/include/at-spi2-atk/2.0 -I/usr/local/include/dbus-1.0 -I/usr/local/lib/dbus-1.0/include -I/usr/local/include/at-spi-2.0 -I/usr/local/include/gtk-layer-shell -I/usr/local/include/json-c -fcolor-diagnostics -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O0 -g -pthread -D_THREAD_SAFE -DGLIB_DISABLE_DEPRECATION_WARNINGS -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -MD -MQ sfwbar.p/src_button.c.o -MF sfwbar.p/src_button.c.o.d -o sfwbar.p/src_button.c.o -c ../src/button.c
ccache: error: Failed to create temporary file for /ccache/9/7/0b7afd3a3598612d2384fe3400efdd-2739234.o.tmp.stdout: Permission denied
[12/52] Compiling C object sfwbar.p/src_label.c.o
FAILED: sfwbar.p/src_label.c.o 
ccache cc -Isfwbar.p -I. -I.. -I/usr/local/include/gtk-3.0 -I/usr/local/include/pango-1.0 -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include/harfbuzz -I/usr/local/include/freetype2 -I/usr/local/include/libpng16 -I/usr/local/include/fribidi -I/usr/local/include/cairo -I/usr/local/include/pixman-1 -I/usr/local/include/gdk-pixbuf-2.0 -I/usr/local/include/gio-unix-2.0 -I/usr/local/include/libepoll-shim -I/usr/local/include/atk-1.0 -I/usr/local/include/at-spi2-atk/2.0 -I/usr/local/include/dbus-1.0 -I/usr/local/lib/dbus-1.0/include -I/usr/local/include/at-spi-2.0 -I/usr/local/include/gtk-layer-shell -I/usr/local/include/json-c -fcolor-diagnostics -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O0 -g -pthread -D_THREAD_SAFE -DGLIB_DISABLE_DEPRECATION_WARNINGS -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -MD -MQ sfwbar.p/src_label.c.o -MF sfwbar.p/src_label.c.o.d -o sfwbar.p/src_label.c.o -c ../src/label.c
ccache: error: Failed to create temporary file for /ccache/e/1/d1942bbdb07367a8140c7ec4405d63-2738146.o.tmp.stdout: Permission denied
[13/52] Compiling C object sfwbar.p/src_scale.c.o
FAILED: sfwbar.p/src_scale.c.o 
ccache cc -Isfwbar.p -I. -I.. -I/usr/local/include/gtk-3.0 -I/usr/local/include/pango-1.0 -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include/harfbuzz -I/usr/local/include/freetype2 -I/usr/local/include/libpng16 -I/usr/local/include/fribidi -I/usr/local/include/cairo -I/usr/local/include/pixman-1 -I/usr/local/include/gdk-pixbuf-2.0 -I/usr/local/include/gio-unix-2.0 -I/usr/local/include/libepoll-shim -I/usr/local/include/atk-1.0 -I/usr/local/include/at-spi2-atk/2.0 -I/usr/local/include/dbus-1.0 -I/usr/local/lib/dbus-1.0/include -I/usr/local/include/at-spi-2.0 -I/usr/local/include/gtk-layer-shell -I/usr/local/include/json-c -fcolor-diagnostics -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O0 -g -pthread -D_THREAD_SAFE -DGLIB_DISABLE_DEPRECATION_WARNINGS -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -MD -MQ sfwbar.p/src_scale.c.o -MF sfwbar.p/src_scale.c.o.d -o sfwbar.p/src_scale.c.o -c ../src/scale.c
ccache: error: Failed to create temporary file for /ccache/d/8/fe97e28e7350f93ce9e652e03bbdb9-2739229.o.tmp.stdout: Permission denied
[14/52] Compiling C object sfwbar.p/src_sfwbar.c.o
FAILED: sfwbar.p/src_sfwbar.c.o 
ccache cc -Isfwbar.p -I. -I.. -I/usr/local/include/gtk-3.0 -I/usr/local/include/pango-1.0 -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include/harfbuzz -I/usr/local/include/freetype2 -I/usr/local/include/libpng16 -I/usr/local/include/fribidi -I/usr/local/include/cairo -I/usr/local/include/pixman-1 -I/usr/local/include/gdk-pixbuf-2.0 -I/usr/local/include/gio-unix-2.0 -I/usr/local/include/libepoll-shim -I/usr/local/include/atk-1.0 -I/usr/local/include/at-spi2-atk/2.0 -I/usr/local/include/dbus-1.0 -I/usr/local/lib/dbus-1.0/include -I/usr/local/include/at-spi-2.0 -I/usr/local/include/gtk-layer-shell -I/usr/local/include/json-c -fcolor-diagnostics -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O0 -g -pthread -D_THREAD_SAFE -DGLIB_DISABLE_DEPRECATION_WARNINGS -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -MD -MQ sfwbar.p/src_sfwbar.c.o -MF sfwbar.p/src_sfwbar.c.o.d -o sfwbar.p/src_sfwbar.c.o -c ../src/sfwbar.c
ccache: error: Failed to create temporary file for /ccache/4/d/1e557f2c59c98cbeb5049960b74b18-2757779.o.tmp.stdout: Permission denied
[15/52] Compiling C object sfwbar.p/src_bar.c.o
FAILED: sfwbar.p/src_bar.c.o 
ccache cc -Isfwbar.p -I. -I.. -I/usr/local/include/gtk-3.0 -I/usr/local/include/pango-1.0 -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include/harfbuzz -I/usr/local/include/freetype2 -I/usr/local/include/libpng16 -I/usr/local/include/fribidi -I/usr/local/include/cairo -I/usr/local/include/pixman-1 -I/usr/local/include/gdk-pixbuf-2.0 -I/usr/local/include/gio-unix-2.0 -I/usr/local/include/libepoll-shim -I/usr/local/include/atk-1.0 -I/usr/local/include/at-spi2-atk/2.0 -I/usr/local/include/dbus-1.0 -I/usr/local/lib/dbus-1.0/include -I/usr/local/include/at-spi-2.0 -I/usr/local/include/gtk-layer-shell -I/usr/local/include/json-c -fcolor-diagnostics -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O0 -g -pthread -D_THREAD_SAFE -DGLIB_DISABLE_DEPRECATION_WARNINGS -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -MD -MQ sfwbar.p/src_bar.c.o -MF sfwbar.p/src_bar.c.o.d -o sfwbar.p/src_bar.c.o -c ../src/bar.c
ccache: error: Failed to create temporary file for /ccache/d/e/f46773c41e8bc54441f21fdfc7a70c-2750250.o.tmp.stdout: Permission denied
[16/52] Compiling C object sfwbar.p/src_basewidget.c.o
FAILED: sfwbar.p/src_basewidget.c.o 
ccache cc -Isfwbar.p -I. -I.. -I/usr/local/include/gtk-3.0 -I/usr/local/include/pango-1.0 -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include/harfbuzz -I/usr/local/include/freetype2 -I/usr/local/include/libpng16 -I/usr/local/include/fribidi -I/usr/local/include/cairo -I/usr/local/include/pixman-1 -I/usr/local/include/gdk-pixbuf-2.0 -I/usr/local/include/gio-unix-2.0 -I/usr/local/include/libepoll-shim -I/usr/local/include/atk-1.0 -I/usr/local/include/at-spi2-atk/2.0 -I/usr/local/include/dbus-1.0 -I/usr/local/lib/dbus-1.0/include -I/usr/local/include/at-spi-2.0 -I/usr/local/include/gtk-layer-shell -I/usr/local/include/json-c -fcolor-diagnostics -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O0 -g -pthread -D_THREAD_SAFE -DGLIB_DISABLE_DEPRECATION_WARNINGS -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -MD -MQ sfwbar.p/src_basewidget.c.o -MF sfwbar.p/src_basewidget.c.o.d -o sfwbar.p/src_basewidget.c.o -c ../src/basewidget.c
ccache: error: Failed to create temporary file for /ccache/c/8/d091eeb84718bb12df48f025d78f3b-2755700.o.tmp.stdout: Permission denied
ninja: build stopped: subcommand failed.

SNI watcher service startup race condition

If you have an SNI client running and then restart sfwbar the SNI client may not recover correctly:

(test_ayatana_menu.py:625051): libayatana-appindicator-WARNING **: 22:24:20.703: Unable to connect to the Notification Watcher: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: Object does not exist at path “/StatusNotifierWatcher”

I monitored the dbus traffic with dbus-monitor while it happened and this is the result:

dbus log

1:103: client
1:105: sfwbar

method call time=1662582260.683590 sender=:1.105 -> destination=org.freedesktop.DBus serial=34 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=RequestName
   string "org.freedesktop.StatusNotifierWatcher"
   uint32 0
signal time=1662582260.683781 sender=org.freedesktop.DBus -> destination=(null destination) serial=275 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
   string "org.freedesktop.StatusNotifierWatcher"
   string ""
   string ":1.105"
signal time=1662582260.683914 sender=org.freedesktop.DBus -> destination=:1.105 serial=36 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameAcquired
   string "org.freedesktop.StatusNotifierWatcher"
method return time=1662582260.684019 sender=org.freedesktop.DBus -> destination=:1.105 serial=37 reply_serial=34
   uint32 1
method call time=1662582260.689240 sender=:1.105 -> destination=org.freedesktop.DBus serial=35 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=RequestName
   string "org.freedesktop.StatusNotifierHost-625069"
   uint32 0
signal time=1662582260.690376 sender=org.freedesktop.DBus -> destination=(null destination) serial=276 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
   string "org.freedesktop.StatusNotifierHost-625069"
   string ""
   string ":1.105"
signal time=1662582260.691217 sender=org.freedesktop.DBus -> destination=:1.105 serial=38 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameAcquired
   string "org.freedesktop.StatusNotifierHost-625069"
method return time=1662582260.692024 sender=org.freedesktop.DBus -> destination=:1.105 serial=39 reply_serial=35
   uint32 1
method call time=1662582260.693259 sender=:1.105 -> destination=org.freedesktop.DBus serial=36 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
   string "type='signal',sender='org.freedesktop.DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',path='/org/freedesktop/DBus',arg0='org.freedesktop.StatusNotifierWatcher'"
method return time=1662582260.693783 sender=org.freedesktop.DBus -> destination=:1.105 serial=40 reply_serial=36
method call time=1662582260.694197 sender=:1.105 -> destination=org.freedesktop.DBus serial=37 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=GetNameOwner
   string "org.freedesktop.StatusNotifierWatcher"
method return time=1662582260.694343 sender=org.freedesktop.DBus -> destination=:1.105 serial=41 reply_serial=37
   string ":1.105"
method call time=1662582260.697984 sender=:1.103 -> destination=org.freedesktop.DBus serial=47 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=StartServiceByName
   string "org.kde.StatusNotifierWatcher"
   uint32 0
error time=1662582260.698426 sender=org.freedesktop.DBus -> destination=:1.103 error_name=org.freedesktop.DBus.Error.ServiceUnknown reply_serial=47
   string "The name org.kde.StatusNotifierWatcher was not provided by any .service files"
method call time=1662582260.700182 sender=:1.103 -> destination=org.freedesktop.DBus serial=48 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=GetNameOwner
   string "org.kde.StatusNotifierWatcher"
method return time=1662582260.700318 sender=org.freedesktop.DBus -> destination=:1.103 serial=24 reply_serial=48
   string ":1.105"
method call time=1662582260.701506 sender=:1.103 -> destination=:1.105 serial=49 path=/StatusNotifierWatcher; interface=org.kde.StatusNotifierWatcher; member=RegisterStatusNotifierItem
   string "/org/ayatana/NotificationItem/Menu"
error time=1662582260.703074 sender=:1.105 -> destination=:1.103 error_name=org.freedesktop.DBus.Error.UnknownMethod reply_serial=49
   string "Object does not exist at path “/StatusNotifierWatcher”"

Client

  • reacts to NameOwnerChanged
  • sends RegisterStatusNotifierItem
  • receives UnknownMethod
  • Gives up

As to why sfwbar returns UnknownMethod:

sfwbar/src/sni.c

Lines 312 to 315 in d7a4c76

g_bus_own_name(G_BUS_TYPE_SESSION,watcher->iface,
G_BUS_NAME_OWNER_FLAGS_NONE,NULL,
(GBusNameAcquiredCallback)sni_watcher_register_cb,
(GBusNameLostCallback)sni_watcher_unregister_cb,watcher,NULL);

Starts to own/claim the name and in the callback registers its methods:

sfwbar/src/sni.c

Lines 182 to 184 in d7a4c76

watcher->regid = g_dbus_connection_register_object (con,
"/StatusNotifierWatcher", watcher->idata->interfaces[0],
&watcher_vtable, watcher, NULL, NULL);

Which are defined here:

sfwbar/src/sni.c

Lines 167 to 172 in d7a4c76

static const GDBusInterfaceVTable watcher_vtable =
{
(GDBusInterfaceMethodCallFunc)sni_watcher_method,
(GDBusInterfaceGetPropertyFunc)sni_watcher_get_prop,
NULL
};

So what happens is that a client tries to talk to the watcher service after it is already owning the "well known" name but before it has initialized its object/callbacks.

A solution could be for the watcher to start by watching or asking for the name (something calling GetNameOwner) and if not already set register the object/callbacks and then claim/own the name as the last step.

Or as alternative:
Initializing the watcher (including setting up the object/callbacks) without checking for an existing owner and only then trying to own the name.

Watching for the well known name would additionally provide the benefit that if there is already a watcher running when sfwbar starts up but that other watcher then terminates after some time sfwbar could seamlessly take over.

Something similar might be required for the SNI host service.

Turning off monitor kills sfwbar when using DisplayPort

With my monitor, when I turn it off and back on again, sfwbar has closed.

There doesn't seem to be anything shown with sfwbar -d, only "Aborted".

This is using DisplayPort, so I'm guessing it's something to do with not detecting an output anymore?

Firefox moves on the taskbar when I switch between (some) tabs

Firefox moves on the taskbar when I switch between (some) tabs. I haven't figured out what exactly causes this behavior. Not all tabs behave this way. Waybar works fine.

Video demonstration:

screencast_2022-08-31.mp4

sfwbar on top, then waybar.

Program version:

System information:

OS: Alpine Linux v3.16 x86_64
Kernel: 5.15.63-0-lts
libc: musl
Shell: ash
WM: sway

P.S. Don't pay attention to the inconsistent design, I'm just experimenting with different programs around Wayland for now.

compiler warning from 71d0125

[32/53] Compiling C object sfwbar.p/src_taskbargroup.c.o
../src/taskbargroup.c: In function ‘taskbar_group_new’:
../src/taskbargroup.c:247:35: warning: passing argument 2 of ‘flow_grid_set_sort’ makes integer from pointer without a cast [-Wint-conversion]
  247 |   flow_grid_set_sort(priv->tgroup,g_object_get_data(G_OBJECT(taskbar),
      |                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                   |
      |                                   gpointer {aka void *}
  248 |         "g_sort"));
      |         ~~~~~~~~~                  
In file included from ../src/taskbargroup.c:7:
../src/flowgrid.h:54:54: note: expected ‘gboolean’ {aka ‘int’} but argument is of type ‘gpointer’ {aka ‘void *’}
   54 | void flow_grid_set_sort ( GtkWidget *cgrid, gboolean sort );
      |              

Feature request: advanced widget interaction

I would like to create a (sound) widget that reacts to mouse clicks (left/right, maybe middle would be useful too?) and mouse scroll (something like Cinnamon Sound applet).
I would like to change volume on scroll.
Currently the widget looks like this, for the interested:

scanner {
  Exec("pamixer --get-volume") {
    Volume= Grab()
  }
}

layout {
  style = "frame"
  css = "* { border: none; box-shadow: none; }"
  label {
    interval = 50
    css = "* { font: 0.3cm Fira Code; font-weight: 700; -GtkWidget-vexpand: true; -GtkWidget-hexpand: true; -GtkWidget-align: 0.5;  }"
    value = Volume
  }
}

Workspace Overview Popup: Questions about configuring / feature requests

The one thing I miss in Sway coming from GNOME is Workspace Matrix. With a bit of creative keybindings, the "space" can emulated, and with sfwbar, it can be visualized using the pager. I'm thrilled!

The key feature from Workspace Matrix that I miss is their popup workspace overview. The popup shows when switching workspace, and stay shown either for a set time, or---if the time is set to 0---until $mod is released. Being able to see what is on the workspaces is great, but just being able to see where I am would make me happy.

My attempt to use sfwbar for the purpose involves a taskbar with the same dimensions as the pager, which has 6 pinned workspaces in 3 rows, as is my preference. I've set the bar to take up 1/3 of my screen height, using SetLayer "top" and SetExclusiveZone "-1" to make it appear on top of my windows. Nice!

There are three things I hope you can help me set up:

  1. Reorder workspace in pager. Currently, workspaces are order downwards in columns. Is it possible to order them along the rows instead? in pager, I have tried playing around with order of pins = "1", "3", "5", "2", "4", "6" setting numeric = false, but to no avail.

  2. Set position of taskbar. For the love of me, I can't figure out how to set the vertical positioning of the taskbar. I've looked at the code for the switcher, but I miss it. Then again, calling be a Gtk newbie would be generous.

  3. Show taskbar on $mod+key, hide taskbar on $mod release. I would like the workspace overview to show when I switch workspace and show for as long as I keep $mod pressed, then hide.
    __ It is my impression that the way keybindings are implemented in Sway makes it impossible to implement this through the Sway config alone. The patch from this rejected PR makes it possible, but changes --release a lot, which was given as a reason for rejecting it. Another reason given for the PR rejection is that the behavior should be implementable through current Wayland protocols for apps that use layer-shell---so it should be possible in sfwbar?
    __ Apart from being nice for workspace switching, this feature combined with the versatile layout options of sfwbar would let me to place all my taskbar elements (clock, tray, etc.) into the "overview taskbar", allowing for a generally bar-free, information-on-demand environment.

Is there a chance these three things are already possible?

Tray Connot Display Anything

OS: Fedora
Compositor: LabWC
Problem:

1 - Well, It is a complex problem, When I use SFWBar tray, No tray was displayed(I use the repo of copr, which is maintained by Crion.).

2 - If I start WayBar(yes, waybar), and then start SFWBar, the tray will work, although with the issue #23.

3 - But If I start SFWBar firstly and then the WayBar, even the WayBar cannot display its tray.

this error is reproducible, I have reproduced it in my laptop and KVM...

In the situation 3 ,waybar will return such an error:

Invalid Status Notifier Item: :.**(numbers)org.***(such as kde , fcitx5, or somthing else), /StatusNotifierItem
20220410_23h10m27s_grim

the Log of sfwbar is hard to catch because it constantly return the Log in the Pictures, Since it was started.
20220410_23h17m10s_grim

BTW, I am not a native English speaker ,If any of these words are confusing, I would like to explain it.

Some compiler warnings

The bar still seems to work fine though

../src/sfwbar.c: In function ‘activate’:
../src/sfwbar.c:145:27: warning: passing argument 1 of ‘bar_get_toplevel_dir’ from incompatible pointer type [-Wincompatible-pointer-types]
  145 |   if(bar_get_toplevel_dir(bar_window) == GTK_POS_LEFT ||
      |                           ^~~~~~~~~~
      |                           |
      |                           GtkWindow * {aka struct _GtkWindow *}
In file included from ../src/sfwbar.c:9:
../src/sfwbar.h:206:29: note: expected ‘GtkWidget *’ {aka ‘struct _GtkWidget *’} but argument is of type ‘GtkWindow *’ {aka ‘struct _GtkWindow *’}
  206 | gint bar_get_toplevel_dir ( GtkWidget * );
      |                             ^~~~~~~~~~~
../src/sfwbar.c:146:28: warning: passing argument 1 of ‘bar_get_toplevel_dir’ from incompatible pointer type [-Wincompatible-pointer-types]
  146 |       bar_get_toplevel_dir(bar_window) == GTK_POS_RIGHT)
      |                            ^~~~~~~~~~
      |                            |
      |                            GtkWindow * {aka struct _GtkWindow *}
In file included from ../src/sfwbar.c:9:
../src/sfwbar.h:206:29: note: expected ‘GtkWidget *’ {aka ‘struct _GtkWidget *’} but argument is of type ‘GtkWindow *’ {aka ‘struct _GtkWindow *’}
  206 | gint bar_get_toplevel_dir ( GtkWidget * );
      |                             ^~~~~~~~~~~

In `pager`, `numeric = true` sorts 10 between 1 and 2

In the pager, numeric = true sorts workspaces differently than I would expect: If I have windows on workspaces 1, 2, 10, 11, the pager lists lhe workspaces as 1, 10, 11, 2 where I would expect 1, 2, 10, 11.

I used the following config:

function("SfwbarInit") {
  SetBarId "bar-0"
}

layout {
    pager{
      rows = 1
      sort = true
      numeric = true
    }
}

Is sorting 10 before 2 intended? If so, is there a way to get the pager to list the workspace as 1, 2, 10, 11? I apologize if I missed something.

SetLayer does not work for me

See title, basically it seems to be always set to top regardless of what I use as config.

my config in case I did manage to screw up somewhere
function("SfwbarInit") {
  SetBarId "bar-0"
  SetLayer "bottom"
#  SetExclusiveZone "-1"
#  SetMonitor "eDP-1"
#  SetBarSize "800" 
}

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

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

menu("winops") {
  item("UnMinimize", Function "ToggleMinimize" );
  item("UnMaximize", Function "ToggleMaximize" );
  item("Focus", Focus );
  item("Close", Close );
}

# Panel layout

layout {

  # menu
  label {
    style = "awesome"
    value = ""
    css = "* { padding: 0px 8px 0px 8px; }"
    action = ""
  }

  # launcher
  button {
    style = "test"
    action = "firefox"
    value = "firefox"
    css = "* { padding: 0px; }"
  }

  # taskbar
  taskbar {
    css = "* { -GtkWidget-vexpand: true; min-height: 34px; }"
    icons = true
    labels = true
    rows = 1
    action[3] = Menu "winops"
    title_width = 20
  }

  # spacer
  label {
	css = "* { -GtkWidget-hexpand: true; background-color: rgba(0,0,0,0); }"
	value =""
  }

#  include("idle.widget")
#  include("usage.widget")
#  include("mpd-mini.widget")
#  include("weather.widget")

  grid {
    style = "frame_temp"
    css = "* { -GtkWidget-direction: right; }"
    include("cpu-temp.widget")
    include("gpu-temp.widget")
  }

  tray
  include("clock.widget")

}

#CSS

window {
	-GtkWidget-direction: bottom;
	/* background-color: rgba(0,0,0,0); */
}

button#taskbar_normal image, button#taskbar_active image, button#taskbar_normal:hover image {
	min-width: 16px;
	min-height: 16px;
	padding: 0px;
}

button#taskbar_normal label, button#taskbar_active label, button#taskbar_normal:hover label {
	padding: 0px;
	padding-left: 2px;
	font: 9pt Inter;
}

button#taskbar_normal , button#taskbar_active , button#taskbar_normal:hover {
	background-image: none;
	/* border-radius: 0;
	border-image: none; */
	margin: 4px 2px;
	padding: 0px 4px;
	min-width: 140px;
}

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

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

button#tray_active,
button#tray_passive,
button#tray_attention {
	padding: 0px;
	background-color: rgba(0,0,0,0);
}

button#tray_active image,
button#tray_passive image,
button#tray_attention image {
	-GtkWidget-hexpand: true;
	-GtkWidget-vexpand: true;
	padding: 2px;
	min-width: 16px;
	min-height: 16px;
}

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

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

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

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

grid#frame {
	-GtkWidget-direction: right;
}

grid#layout {
	-GtkWidget-direction: right;
}

image#label {
	padding: 4px;
}

label#cpu-temp_icon, label#gpu-temp_icon {
	font-family: "Font Awesome 5 Free";
	font-weight: 900;
}

button#idle_inhibit {
}

label {
	font: 8pt Sans;
	color: #000000;
}

tooltip label {
	color: #cccccc;
}

label#awesome {
	font-family: "Font Awesome 5 Free";
	font-weight: 900;
}

label#date {
	font-family: Inter;
	font-size: 9pt;
	padding-left: 8px;
}

label#time {
	font-family: Inter;
	font-size: 12pt;
	padding-right: 8px;
}

label#value {
	padding: 0px;
}

grid#frame_temp {
	-GtkWidget-direction: right;
	padding-left: 8px;
	padding-right: 8px;
}

* {
	-GtkWidget-vexpand: true;
}

Also another quick one. I can't seem to reduce the height of buttons (except the taskbar ones), any idea what I might be doing wrong there? The width seems to reduce just fine if I set the padding to 0.. I have no idea what I'm doing with css.
1663263917_grim

Help needed with styling tray icons

Right now icons take all available height.
image
I have a snippet like this but honestly I don't know what affects icon's size.

image#tray_active, image#tray_passive, image#tray_attention {
    min-width: 0.40cm;
    min-height: 0.40cm;
    margin-left: 1mm;
    margin-right: 1mm;
}

I want to have some top and bottom margin, like the speaker icon in the sound widget:
image

Feature request: make taskbar show only windows from currently active workspace

I also noticed only windows that support Wayland are listed. Firefox is there but no Google Chrome. Is it possible to include XWayland windows aswell?
Another thing: is it possible to remmber state of the window before minimizing? Currently clicking a window in a taskbar unminimizes it but it doesn't maximize it if it was maximized before minimizing.

Freebsd sfwbar dies

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

Icons seem too big in latest

Seems like the css isn't working, IDK haven't investigated. Icons are larger than they should be.
20220829_19h03m55s_grim

Also getting this error if I use this config for sound widget.

~$ sfwbar

(sfwbar:2013): GLib-CRITICAL **: 19:01:20.394: g_io_channel_write_chars: assertion 'channel->is_writeable' failed

Latest commit.

Menu only works for task bar

A menu can't be opened if attached to any widget unless any app is open; that is, it seems to depend on taskbar being active.

Demo:

menu ("demo") {
  item("yes", Exec "echo yes")
  item("no", Exec "echo no")
}

layout {
  image {
    value = "gtk-about"
    action = Menu "demo"
    css = "* { min-height: 24px; min-width: 24px; padding: 4px; }"
  }
}

Try it with absolutely no windows open and it fails, open any window that triggers a taskbar entry and it works.

EDIT: just updated to latest main, issue persists.

The bar is always on top even if an application is in full-screen mode

Below is an example with a YouTube video:
image
Similar thing happens with a game in "full screen windowed" mode.

Is it possible for the bar to be at the bottom, similarly to the sway's default bar? A small reason for wanting that behaviour is consistency between bars, it would solve the issue and it should also work for screenshotting a region -- right now the bar steals focus of grim utility.
Another solution that would work is to be able to toggle auto-hide bar - usually it's irritating but for the few cases it's fine.

sfwbar+Labwc issue with battery indicator

Hello
i use sfwbar with Labwc mainly, but sporadically with other WMs, and i just realized that everything is working fine until i disconnect the battery of the laptop, sfwbar crashes when powersupply is unplugged, somethime if plug it, it is a strange pattern.

error message

**
Gtk:ERROR:../gtk/gtkcssinheritvalue.c:33:gtk_css_value_inherit_free: code should not be reached
**
Gtk:ERROR:../gtk/gtkcssinheritvalue.c:33:gtk_css_value_inherit_free: code should not be reached
Bail out! Gtk:ERROR:../gtk/gtkcssinheritvalue.c:33:gtk_css_value_inherit_free: code should not be reached
Bail out! Gtk:ERROR:../gtk/gtkcssinheritvalue.c:33:gtk_css_value_inherit_free: code should not be reached
[1] 6582 abort sfwbar

I will try with other WMs, sway and Hikari mainly, and will let you know.

KR

Taskbar group popup acts strange when it contains >1 item

I tried the new w10.config in action and found that it looks strange if the taskbar_group popup contains more than one item. To be precise, if the taskbar popup spawns at least once, it cannot change its dimensions correctly after.

Reproducing steps:

  1. Open 3 windows of the same program (mpv)
  2. Hover over program in the taskbar
  3. Close 2 windows

Screenshot:

screenshot_2022-09-10

Video demonstration:

Spoiler
screencast_2022-09-10.mp4

Program version:

In `pager`, using `cols` instead of `rows` causes crash

I cannot seem to be able to use cols instead of rows in pager without getting a crash.

Consider the following minimal config, which runs fine:

function("SfwbarInit") {
  SetBarId "bar-0"
}

layout {
    pager{
       rows = 2
    }
}

If I replace rows with cols, I get following error:

(sfwbar:6743): Gtk-WARNING **: 00:06:35.342: Negative content height -5 (allocation 1, extents 3x3) while allocating gadget (node button, owner GtkButton)

Am I doing something wrong? Missing something?

Feature request: MapId to be able to map a class name for an icon in the taskbar

When using apps that run under XWayland, they may not have an app_id.

For example the Jetbrains products run java, so they run on XWayland and don't have an app_id (app_id": null,).

They do however seem to have the following:

              "window_properties": {
                "class": "jetbrains-clion",
                "instance": "jetbrains-clion",
                "title": "sfwbar – wintree.c",
                "transient_for": null,
                "window_type": "normal"
              }

So we could use the class for xwayland apps as a workaround. I checked a few other apps and it seems the class and instance is set to the name of the process?

Could the MapAppId app_id, pattern be used for this?

Vertical sfwbar

Is there a procedure to have a vertical sfwbar on the left of the screen ?

Does not run out of the box

** (sfwbar:3238): ERROR **: 20:51:21.109: Error: can't read config file

[1]    3238 trace trap (core dumped)  sfwbar

Some taskbar icons show the default icon

Using this in labwc in Puppy Linux.

I can't figure out why some apps display an icon (firefox, geany, celluloid and some others are fine) and many don't. Most have icons in the icon themes I use and many have icons in the 'hicolor' theme (as they should). But that doesn't seem to matter as gimp doesn't show, GParted doesn't show and others.

I'm on the latest git version and not using many features, just icons taskbar and clock, all with tooltips and actions and a bit of css.

BTW, the default icon is pretty crappy, maybe you could find a nicer one and this issue wouldn't be so bothersome!

Thanks, and I like this bar, foreign-toplevel implementation is good and user friendly.

Got it looking a bit like JWM 😆

20220228_17h13m57s_grim

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.