A healthy, bite-sized window manager written in C over the XLib library.
For usage and documentation, please visit the project website berrywm.org
:strawberry: A healthy, byte-sized window manager
License: MIT License
A healthy, bite-sized window manager written in C over the XLib library.
For usage and documentation, please visit the project website berrywm.org
Can you add support for _NET_DESKTOP_NAMES?
So it is usable with polybars xworkspaces.
In berry, if I run this command...
$ xprop -id 0xe00006 _NET_WM_DESKTOP _NET_FRAME_EXTENTS
_NET_WM_DESKTOP: not found.
_NET_FRAME_EXTENTS: not found.
I can't migrate some of my automation scripts without them; in particular I miss the first one without which I don't know how I could otherwise have a complete overview of the position of all windows on the different workspaces.
The second one can be used to determine the current status "decorated == yes|no"
I don't know how else to get such values and I would still like to avoid third party tools (xdotool, wmctrl....) and be able to continue to use only xprop and xwininfo...
i've got a blank screen with the cursor, and according to the log file there are issues with the "~/.config/berry/autostart", which simply put, refers to a nonexistent solution. exact error message below:
sh: 0: Can't open /root/.config/berry/autostart
what can i do about this?
The package in the AUR fails to build because the Makefile
tries to install it in the real filesystem root. When building pacman packages, a fakeroot is created so the files owned by the package can be placed in the filesystem properly.
I pushed a patch upstream to the AUR so the package builds properly. Here's the patch currently in upstream:
diff --git a/Makefile b/Makefile
index 6e25cbf..cc4f066 100644
--- a/Makefile
+++ b/Makefile
@@ -14,8 +14,8 @@ all:
install:
mkdir -p "$(DESTDIR)$(PREFIX)/bin"
- install $(__NAME__) "/usr/local/bin/$(__NAME__)"
- install $(__NAME_C__) "/usr/local/bin/$(__NAME_C__)"
+ install $(__NAME__) "$(DESTDIR)/usr/local/bin/$(__NAME__)"
+ install $(__NAME_C__) "$(DESTDIR)/usr/local/bin/$(__NAME_C__)"
cd ./man; $(MAKE) install
clean:
WM doesn't support _NET_MOVERESIZE_WINDOW. Gravity will be ignored.
I use wmctrl with slop to quickly move and resize windows but berry doesn't support _NET_MOVERESIZE_WINDOW
.
Open file dialog window not handled by berry.
$xprop
_NET_WM_USER_TIME(CARDINAL) = 3644362
_NET_WM_STATE(ATOM) = _NET_WM_STATE_MODAL
WM_HINTS(WM_HINTS):
Client accepts input or input focus: True
Initial state is Normal State.
window id # of group leader: 0x1400001
_GTK_THEME_VARIANT(UTF8_STRING) =
WM_TRANSIENT_FOR(WINDOW): window id # 0x1600017
XdndAware(ATOM) = BITMAP
WM_WINDOW_ROLE(STRING) = "GtkFileChooserDialog"
_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_DIALOG
_NET_WM_SYNC_REQUEST_COUNTER(CARDINAL) = 20971533, 20971534
_NET_WM_USER_TIME_WINDOW(WINDOW): window id # 0x140000c
WM_CLIENT_LEADER(WINDOW): window id # 0x1400001
_NET_WM_PID(CARDINAL) = 21571
WM_LOCALE_NAME(STRING) = "C"
WM_CLIENT_MACHINE(STRING) = "aser"
WM_NORMAL_HINTS(WM_SIZE_HINTS):
program specified minimum size: 532 by 320
program specified base size: 0 by 0
window gravity: NorthWest
WM_PROTOCOLS(ATOM): protocols WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_SYNC_REQUEST
WM_CLASS(STRING) = "code-oss", "Code-oss"
WM_ICON_NAME(STRING) = "Open File"
_NET_WM_ICON_NAME(UTF8_STRING) = "Open File"
WM_NAME(STRING) = "Open File"
_NET_WM_NAME(UTF8_STRING) = "Open File"
This dialog I opened by vscode file->open menu command.
This window appears at top left corner and shown at all workspaces.
Hey! I love your WM, have been playing with it for the whole day now. I still got a few questions.
f
or m
to maximize the window.squash
but that didn't work.EDIT: Found out how I could apply the wallpaper (hsetroot). But it doesn't work well with my 2 monitor setup. It stretches along my two monitors.
Thanks in advance!
is it possible to have transparent stuff with compton?
if now is there any plan to add something like this in future ?
Commit e8fea835679d233d51049d431cdb4eb05ab1262b
Not really sure how to describe it, so here's a one second video depicting my issue. It happens for a split second before reverting back to normal, but comes back when it's clicked. It happens to all windows, regardless of size.
Dell Latitude E6320, stock specs
Arch Linux 4.18.5-arch1-1-ARCH
Intel Integrated Graphics (Using the mesa
driver)
No idea why this happens, freshly compiled and no changed made, error:
[xcb] Unknown sequence number while processing queue
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.
berry: xcb_io.c:263: poll_for_event: Assertion `!xcb_xlib_threads_sequence_lost' failed.
fish: Job 3, '~/tmp/berry/berry' terminated by signal SIGABRT (Abort)
Using berryc fullscreen
causes the window to fill the area defined by edge_gap
, not the entire screen. This makes the behaviour of berryc fullscreen
the same as berryc window_monocle
.
For example,
berryc edge_gap 100 0 0 0
berryc fullscreen
leaves a 100 pixel gap at the top. This happens for gaps on the left, right, and bottom as well. The only way to achieve the desired behaviour of filling the entire screen is to have edge_gap 0 0 0 0
.
Steps to reproduce:
berryc window_center
.berry
crashes.Note: This is tested on the latest commit on the master
branch of berry
. Untested on the latest stable release version.
Here is the output:
berry: font not specified, loading default font
berry: Successfully opened display
berry: Successfully assigned atoms
berry: Successfully set initial properties
berry: Setting up monitors
berry: Found 1 screens active
berry: Screen #0 with dim: x=0 y=0 w=1366 h=768
berry: Successfully setup monitors
berry: Allocating color values
berry: Receieved new 16 event
berry: Receieved new 33 event
berry: Handling 33 event
berry: Recieved event from berryc
berry: Receieved new 33 event
berry: Handling 33 event
**!!!!!!!!!!Same outputs so I deleted them!!!!!!!!!**
berry: Text height is 4
berry: Drawing text on client
berry: Receieved new 28 event
berry: Handling 28 event
berry: Handling property notify event
berry: Receieved new 28 event
berry: Handling 28 event
berry: Handling property notify event
berry: Updating client title
berry: Text height is 7
berry: Drawing text on client
berry: Receieved new 16 event
berry: Receieved new 20 event
berry: Handling 20 event
berry: Handling map request event
berry: client has class @?�ߒU
When i run xev -event keyboard berry gives berry: client has class @?�ߒU output and crashes.
Here is my xinitrc
# Source xinitrc.d scripts
if [ -d /etc/X11/xinit/xinitrc.d ] ; then
for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
[ -x "$f" ] && . "$f"
done
unset f
fi
# load .Xresources
/usr/bin/xrdb -merge $HOME/.Xresources
# Set wallpaper
nitrogen --restore &
# Compton
compton --config ~/.config/compton.conf &
# Start PulseAudio
start-pulseaudio-x11 &
# Polkit
/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &
# Start Unclutter
unclutter &
# Fonts
xset +fp ~/.local/share/fonts/Bitmap
xset fp rehash
# cursor
xsetroot -cursor_name left_ptr
# numlock
numlockx on &
# Tray apps
volumeicon &
cbatticon &
nm-applet &
# Start wm
sxhkd &
exec berry >~/.xsession-errors 2>&1
Berry is installed from AUR and version is 0.1.2.r7.g8aa8085
Also berry is not starting without chmod +x autostart
And berry crashes a lot when starting apps other than xev.
Thanks.
Hey, loving your work so far.
I'm currently using a dual-monitor setup, with my left monitor being 1440x900 and my right 2560x1080.
Moving the mouse cursor around the screens works perfectly, so it respects the screen borders and all that jazz. However, if I move a window to my second/1440x900 monitor, I can move the window off the screen and it stops at an invisible border as if my screen was 1080 pixels high.
Again, it's not a huge issue. Just a little annoying as I like my windows hard-up against the screen borders, and the default incriment the keyboard moves the window is too large to do this without screen edge detection. :P
EDIT: Also noticed that tooltips/pop-up text in windows may go off the edge of the screen (on either monitor in my setup) and become cut-off or unreadable.
This is because I'm using st with berry and picom and I can't get opacity with decorations enabled.
Problem
When using a compositor (compton in my case) with shadows enabled, both the window and the window decorations have shadows, and the window shadow is on top of the decorations. This is shown in the screenshot below.
Expected Behaviour
I expect something like the screenshot below taken in bspwm. I've made an extremely large border to demonstrate. There is only a single shadow for the window + decoration, and there is no "bleeding" of the shadow on to the decoration.
Details
Steps to reproduce:
Note: Resizing/moving after step 3 (and before step 4) makes monocle mode work again.
OS Arch Linux 4.18.4-arch1-1-ARCH
Tried to compile into a pacman package, but cc
stopped when the compiler threw this (Stripped for formatting):
cc -Os -pedantic -Wall -D__NAME__=\"berry\" -D__NAME_CLIENT__=\"berryc\" -D__THIS_VERSION__=\"0.0.1\" -D__CONFIG_NAME__=\"autostart\" -I/usr/include wm.c -L/usr/lib -lX11 -lm -o berry
wm.c:190:6: error: ‘IPCPointerMove’ undeclared here (not in a function); did you mean ‘PointerRoot’?
wm.c:190:6: error: array index in initializer not of integer type wm.c:190:6: note: (near initialization for ‘ipc_handler’) make: *** [Makefile:12: all] Error 1
libx11
is installed.
as the title describes, log of output from startx.
http://ix.io/1OhD
This issue is consistent trying to clone and build, using the latest tar under releases, and with the AUR package.
Could it be an issue with having both 32 and 64 bit libs?
lib32-libxft 2.3.2-2
libxft 2.3.3-1
lib32-libx11 1.6.7-1
libx11 1.6.8-1
i know from jlervin website that he plays nice counter strike)
so today i decided to install cs and try to play on new laptop with berry as wm
and one thing is freaks me out: when in game i going to any kind of menu - window automaticly goes to maximized state from fullscreen
if jlervin plays cs under own berry wm - how he handle this situation?)
maybe some tips?
also, it would be very nice to have an option to turn off window borders when window goes fullscreen
Hi. Berry was freezing when I was using picom's glx
backend so I've switched to xrender
and it hasn't crashed once. Although now I'm getting weird artifacts surrounding unfocused windows. So I was just wondering what others are using in their picom configs.
Here's mine.
Also, transparency only works on terminal windows when titlebars on toggled off. When on, the backgrounds are solid.
Thanks! This is a great wm. Keep up the great work.
Current behavior:
Suggested behavior:
First of all, thanks for the amazing and fully customizable wm, i love the modular nature of it
Second, unfortunately i have an issue with xterm. Its window overlap its decoration, as you can see below
And here's a screenshot of urxvt, chrome, and thunar, all of it looks normal
Here's my berry config
#!/bin/bash
sxhkd -c ~/.config/berry/sxhkdrc &
xrdb -merge ~/.Xresources &
~/.fehbg &
~/.config/polybar/run.berry &
# Set decoration geometry
berryc border_width 0
berryc inner_border_width 0
berryc title_height 30
berryc top_gap 0
# Set decoration colors
berryc inner_focus_color 4f5666
berryc inner_unfocus_color 4f5666
berryc text_focus_color 4f5666
berryc text_unfocus_color 4f5666
# Other options
berryc smart_place "false"
berryc draw_text "false"
berryc edge_lock "false"
berryc set_font "SF Mono-10"
and my .Xresources
#include ".themes/onedark"
XTerm*geometry: 60x21
XTerm*faceName: SF Mono
XTerm*faceSize: 10
! font settings
URxvt*font: xft:SF Mono:size=10, xft
URxvt*letterSpace: -1
! appearance
URxvt*scrollBar: false
URxvt*scrollBar_right: false
URxvt*internalBorder: 12
URxvt*cursorBlink: true
URxvt*geometry: 60x18
! copy and pasting
URxvt.keysym.Shift-Control-V: eval:paste_clipboard
URxvt.keysym.Shift-Control-C: eval:selection_to_clipboard
URxvt.keysym.Control-Meta-c: builtin-string:
URxvt.keysym.Control-Meta-v: builtin-string:
URxvt.iso14755: false
! Xft settings
Xft.dpi: 96
Xft.antialias: true
Xft.hinting: true
Xft.rgba: none
Xft.autohint: true
Xft.hintstyle: hintfull
Xft.lcdfilter: lcdfilter
I've tried to resize the XTerm*geometry
option, also using berryc window resizing, but still no change
I don't have any experience in C programming, especially XLib, but i really love this WM, so if you need more infos from me, i'll happily provide them
It seems to me that the manager should perform window actions depending on the monitor.
It would also be great to be able to determine edge_gap depending on the monitor (in my case, to change the top gap for the bar)
by now, i did the sxhkd hotkey that launches script which calls "save_monitor" for current workspace and monitor, that gived as argument. So i can spawn window on another monitor and maximize it, but i must remember which monitor is choosed right now when somehow manipulating windows, which is kinda frustrating.
berry: font not specified, loading default font
berry: Successfully opened display
berry: Giving focus to dummy window
Fatal request. request code=2, error code=10
X Error of failed request: BadAccess (attempt to access private resource denied)
Major opcode of failed request: 2 (X_ChangeWindowAttributes)
Serial number of failed request: 32
Current serial number in output stream: 38
Manually installed from this repo and through AUR give me the same result.
Can't find an answer on internet may need some help
I could not follow the development of Berry lately but today from VoidLinux I updated to 0.1.3 release and I'm trying to complete my personal configuration of my Berry desktop.
Now I note that the main windows of all applications are the only ones decorated and that they are handled differently from their child windows; the latters do not appear with a wmctrl -l
for example and on these undecorated dialog windows berryc commands seems to have no effect (applies to the main window instead) although they do have the focus (??)
If what I have just written is expected and correct, I find myself in difficulty…
I would like to be able to control ALL windows from my scripts also by defining opening rules. For this reason I have installed the devilspie2 tool which doesn't seem to be able to capture any event in my berry session....
In practice: is it or will it be possible to define geometry and/or workarea number at the opening event for any type of window (NET_WM_WINDOW_TYPE*)? is there a third party tool recommended to manage this?
Thank you for an clarification.
The most recently opened window is focused when a window closes, instead of the parent / spawner of the closed window.
example: open two terminals, use each to open an image. the newest terminal is always focused after the image closes, instead of the terminal that spawned the image.
When press the "f" key, the video does not go into full screen mode. Also, if run mpv with the --fs option, the video is not full screen.
$ berry -v
berry 0.1.5
Copyright (c) 2018 Joshua L Ervin
Released under the MIT License
$ mpv -V
mpv 0.32.0 Copyright © 2000-2020 mpv/MPlayer/mplayer2 projects
built on UNKNOWN
ffmpeg library versions:
libavutil 56.31.100
libavcodec 58.54.100
libavformat 58.29.100
libswscale 5.5.100
libavfilter 7.57.100
libswresample 3.5.100
ffmpeg version: n4.2.2
~/Sources/berry $ cp example/sxhkdrc /home/scott/.config/berry/sxhkdrc cp: cannot stat 'example/sxhkdrc': Too many levels of symbolic links
Looking at the sxhkdrc file; it says it is a broken link.
I just autostarted the polybar I use normally and in berry it shows right in the middle of the screen and is treated like other windows with borders an so on.
I'm using Manjaro and used the Aur package for Arch.
I want to manage windows like it's in 2bwm. super+batton1+mouse drag
for moving windows and super+batton3+mouse drag
for resizing. And this working by pressing on window itself not only on decorations.
If I right understand bspwm
has pointer
command for mouse grabbing. Is there a way to do the same with berry?
It seems to me that when a window is moved toward another workspace, it is temporarily unregistered from the xserver property descriptor.
Xor- 7.6
libX11-1.6.9
berry-0.1.5
(packaged by Void Linux)0
and make sure it is listed in xprop -root _NET_CLIENT_LIST
home ) xprop -root _NET_CURRENT_DESKTOP
_NET_CURRENT_DESKTOP(CARDINAL) = 0
home ) xprop -root _NET_CLIENT_LIST
_NET_CLIENT_LIST(WINDOW): window id # 0x120000e
berryc send_to_workspace 5 & berryc switch_workspace 5
in it.home ) xprop -root _NET_CURRENT_DESKTOP
_NET_CURRENT_DESKTOP(CARDINAL) = 5
home ) xprop -root _NET_CLIENT_LIST
_NET_CLIENT_LIST: not found.
I think this might also be related with polybar/polybar#1922.
As discussed on reddit I did not find a bottom_gap. Something more general like edge_gap
would be neat.
edge_gap top right bottom left
- eg: edge_gap 0 0 24 0
for a 24px bottom gap
However you choose to implement this feature it will be great!
When I launch berry (no dm), it launches into a black screen, without a cursor.
OS: Raspbian/Ubuntu 18.04
Activity to trigger: Close a window
Expected Behavior: Window closes
Exact Behavior: Berry closes
I did try this in two different systems. I checked the output of the X.org log and I'm not seeing any useful output to really provide to you. If there are other places to look, let me know and I'll get that info straight over.
Instead of opening a PR, just doing this to save time. The current MANPREFIX
throws a build error when using the AUR installation.
Under config.mk
:
-MANPREFIX = $(PREFIX)/share/man
+MANPREFIX = $(PREFIX)/man
When building, MANPREFIX = $(PREFIX)/share/man
is owned by the filesystem, and aborts the package update. Seeing as how this points to /usr/local/man
anyway, it should go there instead.
Please comment any suggestions you have to improve the window manager below. I can't promise that I will be able to implement everything, but I'm curious what people have to say!
Steps to reproduce:
send_to_workspace {0-9}
(sxhkd
bindings)Steps to reproduce:
Note: Occurs on other programs (e.g. closing a tab in firefox, etc.).
The guide at berrywm.org should say to install sxhkd, and it should replace the line cp examples/sxhkdrc $HOME/.config/berry/sxhkdrc
with cp examples/sxhkdrc $HOME/.config/sxhkd/sxhkdrc
. It took me a while to figure this out on my own.
installation fails on the last step (installing built package) with the following error:
error: failed to commit transaction (conflicting files)
berry-git: /usr/local/share/man exists in filesystem (owned by filesystem)
Errors occurred, no packages were upgraded.
i guess this issue could be related to #17
I'm opening this issue to discuss one of the enhancements mentioned in the feature request thread here.
Specifically the first suggestion which allows clients to query information about internal window state via xprop
.
I've starting working on this in the development branch, and I'm open to suggestions. First, a few questions I have for users:
windowcherf
reports this information in JSON. Although this is well-formatted, I fear that it it inaccessible to users without a commandline JSON parsing tool and I'd rather not require a specific external tool for use.xprop -root
. Currently, window status is stored in a window-by-window basis. I fear this would be impossible without using JSON as a format. Perhaps I could introduce a berryc
command that nicely reports this information?Thoughts? Specifically @paoloschi
Thank you for this simple and beautiful window manager! I have a problem when I send a window to another workspace.
send_to_workspace 2
sends the current window to workspace 1
send_to_workspace 1
sends the current window to workspace 0
and i am not sure what send_to_workspace 0
does.
Is it possible to implement something like bspwm has that you can automatically focus on that window when you move the mouse on it?
Now we have to either write scripts,use sxhkd keybindings or press ~button1 to get it in focus.
I tried adding a thing or two in [ wm.c ] file,but couldn’t find anything that doesn’t mess up something else after recompiling. Maybe something so we can enable/disable it in terminal
[ berryc WINDOW_HOVER_FOCUS true/false ] idk just an idea.
Steps to reproduce:
firefox
in my case).Note: It works on dwm
. I haven't tested other WMs.
Steps to reproduce:
Note: Immediately closing the window in step 2 will also show the bug.
Just letting you know that the commands given in the "copy the sample configuration files" section aren't copy-and-paste-easy.
(assuming the user is still in the berry folder from installation):
mkdir $HOME/.config/berry cp example/sxhkdrc $HOME/.config/berry/sxhkdrc cp example/autostart $HOME/.config/berry/autostart
Changed:
berry/
from the second lineexamples
as the actual folder is just example
, from last two linesberry
from the last line, especially since there's a space there ;PAnyway, it's not that important so keep up the great work! :D
If I call berryc window raise
nothing happens.
If it must raise window on the top, then it's not any sense, because focused window already on the top.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.