Difference between revisions of "Bspwm"

From ArchWiki
Jump to navigation Jump to search
(Added clarification to potential performance problems with fish to give reason to why performance may be an issue)
 
(65 intermediate revisions by 28 users not shown)
Line 1: Line 1:
 
{{Lowercase title}}
 
{{Lowercase title}}
 
[[Category:Tiling WMs]]
 
[[Category:Tiling WMs]]
 +
[[ja:Bspwm]]
 +
[[ru:Bspwm]]
 +
[[es:Bspwm]]
 +
[[pt:Bspwm]]
 
{{Related articles start}}
 
{{Related articles start}}
{{Related|bspwm/Example configurations}}
+
{{Related|Window manager}}
 +
{{Related|Comparison of tiling window managers}}
 
{{Related articles end}}
 
{{Related articles end}}
  
''bspwm'' is a tiling window manager that represents windows as the leaves of a full binary tree. It has support for [http://standards.freedesktop.org/wm-spec/wm-spec-1.3.html EWMH] and multiple monitors, and is configured and controlled through messages.
+
[https://github.com/baskerville/bspwm bspwm] is a tiling window manager that represents windows as the leaves of a full binary tree. bspwm supports multiple monitors and is configured and controlled through messages. [https://specifications.freedesktop.org/wm-spec/wm-spec-latest.html EWMH] is partially supported.
  
 
== Installation ==
 
== Installation ==
  
[[Install]] {{Pkg|bspwm}} and {{Pkg|sxhkd}}, or the development versions: {{AUR|bspwm-git}} and {{AUR|sxhkd-git}}.
+
[[Install]] the {{Pkg|bspwm}} package or {{AUR|bspwm-git}} for the development version.
Sxhkd is a simple X hotkey daemon used to communicate with bspwm through {{ic|bspc}} as well as launch your applications of choice.
 
  
To start bspwm on login, add the following to {{ic|~/.xinitrc}} or {{ic|~/.xprofile}} (depending on how you launch X/your display manager):
+
== Starting ==
  
{{bc|
+
Run {{ic|bspwm}} using [[xinit]].
sxhkd &
 
exec bspwm
 
}}
 
  
 
== Configuration ==
 
== Configuration ==
  
Example configuration is found at {{ic|/usr/share/doc/bspwm/examples/}} and on [https://github.com/baskerville/bspwm/blob/master/examples/ GitHub].
+
'''Important:''' Make sure your [[environment variable]] {{ic|$XDG_CONFIG_HOME}} is set or your bspwmrc will not be found. This can be done by adding {{ic|1=XDG_CONFIG_HOME="$HOME/.config"}} and {{ic|export XDG_CONFIG_HOME}} to your {{ic|~/.profile}}.
  
'''Important:''' Make you sure environment variable $XDG_CONFIG_HOME is set or your bspwmrc will not be found. This can be done by adding XDG_CONFIG_HOME="$HOME/.config" and export XDG_CONFIG_HOME to your ~/.profile.
+
The example configuration is located in {{ic|/usr/share/doc/bspwm/examples/}}.
  
Create {{ic|~/.config/bspwm/}} and {{ic|~/.config/sxhkd/}}, then copy {{ic|/usr/share/doc/bspwm/examples/bspwmrc}} to {{ic|~/.config/bspwm/}} and {{ic|/usr/share/doc/bspwm/examples/sxhkdrc}} to {{ic|~/.config/sxhkd/}}. Make bspwmrc executable with {{ic|chmod +x ~/.config/bspwm/bspwmrc}}.
+
Copy {{ic|bspwmrc}} from there into {{ic|~/.config/bspwm/}} and {{ic|sxhkdrc}} into {{ic|~/.config/sxhkd/}}.
  
These two files are where you will be setting wm settings and keybindings, respectively. See [[bspwm/Example configurations]] for annotated examples.
+
These two files are where you will be setting wm settings and keybindings, respectively.
  
Documentation for bspwm is found by running {{ic|man bspwm}}.
+
See the {{man|1|bspwm}} and {{man|1|sxhkd}} manuals for detailed documentation.
 
 
There is also documentation for sxhkd found by running {{ic|man sxhkd}}.
 
  
 
==== Note for multi-monitor setups ====
 
==== Note for multi-monitor setups ====
  
 
The example bspwmrc configures ten desktops on one monitor like this:
 
The example bspwmrc configures ten desktops on one monitor like this:
 +
 
  bspc monitor -d I II III IV V VI VII VIII IX X
 
  bspc monitor -d I II III IV V VI VII VIII IX X
  
 
You will need to change this line and add one for each monitor, similar to this:
 
You will need to change this line and add one for each monitor, similar to this:
 +
 
  bspc monitor DVI-I-1 -d I II III IV
 
  bspc monitor DVI-I-1 -d I II III IV
 
  bspc monitor DVI-I-2 -d V VI VII
 
  bspc monitor DVI-I-2 -d V VI VII
 
  bspc monitor DP-1 -d VIII IX X
 
  bspc monitor DP-1 -d VIII IX X
  
You can use `xrandr -q` or `bspc query -M` to find the monitor names.
+
You can use {{ic|xrandr -q}} or {{ic|bspc query -M}} to find the monitor names.
  
The total number of desktops were maintained at ten in the above example. This is so that each desktop can still be addressed with 'super + {1-9,0}' in the sxhkdrc.
+
The total number of desktops were maintained at ten in the above example. This is so that each desktop can still be addressed with {{ic|super + {1-9,0}}} in the sxhkdrc.
  
 
=== Rules ===
 
=== Rules ===
Line 52: Line 53:
  
 
The first is by using the built in rule command, as shown in the example bspwmrc:
 
The first is by using the built in rule command, as shown in the example bspwmrc:
 +
 
{{bc|<nowiki>
 
{{bc|<nowiki>
 
bspc rule -a Gimp desktop=^8 follow=on state=floating
 
bspc rule -a Gimp desktop=^8 follow=on state=floating
Line 62: Line 64:
 
The second option is to use an external rule command. This is more complex, but can allow you to craft more complex window rules.  See [https://github.com/baskerville/bspwm/tree/master/examples/external_rules these examples] for a sample rule command.
 
The second option is to use an external rule command. This is more complex, but can allow you to craft more complex window rules.  See [https://github.com/baskerville/bspwm/tree/master/examples/external_rules these examples] for a sample rule command.
  
If a particular window does not seem to be behaving according to your rules, check the class name of the program. This can be accomplished by running {{ ic | xprop <nowiki>|</nowiki> grep WM_CLASS}} to make sure you're using the proper string.
+
If a particular window does not seem to be behaving according to your rules, check the class name of the program. This can be accomplished by running {{ ic|xprop {{!}} grep WM_CLASS}} to make sure you're using the proper string, which requires the {{pkg|xorg-xprop}} package.
  
 
=== Panels ===
 
=== Panels ===
An example panel for [https://aur.archlinux.org/packages/bar-aint-recursive/ bar] is provided in the examples folder on the GitHub page. You might also get some insights from the [https://wiki.archlinux.org/index.php/Bar-aint-recursive Bar] wiki page. The panel will be executed by placing {{ic | panel &}} in your bspwmrc. Check the opt-depends in the bspwm package for dependencies that may be required.
 
  
To display system information on your status bar you can use various system calls.  This example will show you how to edit your {{ic | panel }} to get the volume status on your BAR:
+
==== Using lemonbar ====
 +
 
 +
An example panel for {{AUR|lemonbar-git}} is provided in the examples folder on the GitHub page. You might also get some insights from the [[lemonbar]] wiki page. The panel will be executed by placing {{ic|panel &}} in your bspwmrc. Check the [[optdepends]] in the {{Pkg|bspwm}} package for dependencies that may be required.
 +
 
 +
To display system information on your status bar you can use various system calls.  This example will show you how to edit your {{ic|panel}} to get the volume status on your BAR:
  
 
{{bc|<nowiki>
 
{{bc|<nowiki>
Line 84: Line 89:
 
}</nowiki>}}
 
}</nowiki>}}
  
Next, we will have to make sure it is called and piped to {{ic | $PANEL_FIFO}}:
+
Next, we will have to make sure it is called and redirected to {{ic|$PANEL_FIFO}}:
  
 
{{bc|<nowiki>
 
{{bc|<nowiki>
 
while true; do
 
while true; do
echo "S" "$(panel_volume) $(panel_clock) > "$PANEL_FIFO"
+
echo "S" "$(panel_volume) $(panel_clock)" > "$PANEL_FIFO"
 
         sleep 1s
 
         sleep 1s
 
done &
 
done &
 
</nowiki>}}
 
</nowiki>}}
 +
 +
==== Using yabar ====
 +
 +
Using the example panel using lemonbar requires you to set your environment (.profile), and make sure the panel scripts are on your path. Easier panel to set up is {{AUR|yabar}}, which has just one config file.
 +
 +
==== Using polybar ====
 +
 +
[[Polybar]] can be used by adding {{ic|polybar ''example'' &}} to your bspwmrc configuration file, where {{ic|''example''}} is the name of the bar.
  
 
=== Scratchpad ===
 
=== Scratchpad ===
  
You can emulate a scratchpad (like i3's) by adding a shortcut for this command:
+
You can emulate a dropdown terminal (like i3's scratchpad feature if you put a terminal in it) using bspwm's window flags. Append the following to the end of the bspwm config file (adapt to your own terminal emulator):
  
 
{{bc|<nowiki>
 
{{bc|<nowiki>
xdotool search --onlyvisible --classname scratchpad windowunmap \
+
bspc rule -a scratchpad sticky=on state=floating hidden=on
|| xdotool search --classname scratchpad windowmap \
+
st -c scratchpad -e ~/bin/scratch &
|| st -c scratchpad -g 1000x400+460 &
 
 
</nowiki>}}
 
</nowiki>}}
  
and adding this rule:
+
The {{ic|sticky}} flag ensures that the window is always present on the current desktop.
 +
And {{ic|~/bin/scratch}} is:
  
 
{{bc|<nowiki>
 
{{bc|<nowiki>
bspc rule -a scratchpad sticky=on state=floating
+
#!/usr/bin/sh
 +
bspc query -N -n .floating > /tmp/scratchid
 +
$SHELL
 
</nowiki>}}
 
</nowiki>}}
  
See also [https://bbs.archlinux.org/viewtopic.php?pid=1338582#p1338582] and [http://yuri-rage.github.io/geekery/2015/01/26/bleeding-edge-bspwm/].
+
The hotkey for toggling the scratchpad should be bound to:
 +
 
 +
{{bc|<nowiki>
 +
id=$(cat /tmp/scratchid);\
 +
bspc node $id --flag hidden;bspc node -f $id
 +
</nowiki>}}
  
 
For a scratch-pad which can use any window type without pre-defined rules, see: [https://www.reddit.com/r/bspwm/comments/3xnwdf/i3_like_scratch_for_any_window_possible/cy6i585]
 
For a scratch-pad which can use any window type without pre-defined rules, see: [https://www.reddit.com/r/bspwm/comments/3xnwdf/i3_like_scratch_for_any_window_possible/cy6i585]
Line 115: Line 135:
 
For a more sophisticated scratchpad script that supports many terminals out of the box and has flags for doing things like optionally starting a tmuxinator/tmux session, turning any window into a scratchpad on the fly, and automatically resizing a scratchpad to fit the current monitor see {{AUR|tdrop-git}}.
 
For a more sophisticated scratchpad script that supports many terminals out of the box and has flags for doing things like optionally starting a tmuxinator/tmux session, turning any window into a scratchpad on the fly, and automatically resizing a scratchpad to fit the current monitor see {{AUR|tdrop-git}}.
  
=== Different monitor conifgurations for different machines ===
+
=== Different monitor configurations for different machines ===
  
 
Since the {{ic|bspwmrc}} is a shell script, it allows you to do things like these:
 
Since the {{ic|bspwmrc}} is a shell script, it allows you to do things like these:
Line 132: Line 152:
 
  </nowiki>
 
  </nowiki>
  
== Troubleshooting ==
+
=== Set up a desktop where all windows are floating ===
 +
 
 +
Here is how to setup the desktop 3 to have only floating windows. It can be useful for GIMP or other apps with multiple windows.
 +
 
 +
Put this script somewhere in your {{ic|$PATH}} and call it from {{ic|.xinitrc}} or similar (with a {{ic|&}} at the end):
 +
 
 +
#!/bin/bash
 +
<nowiki>
 +
# change the desktop number here
 +
FLOATING_DESKTOP_ID=$(bspc query -D -d '^3')
 +
 
 +
bspc subscribe node_manage | while read -a msg ; do
 +
    desk_id=${msg[2]}
 +
    wid=${msg[3]}
 +
    [ "$FLOATING_DESKTOP_ID" = "$desk_id" ] && bspc node "$wid" -t floating
 +
done
 +
</nowiki>
 +
 
 +
([https://github.com/baskerville/bspwm/issues/428#issuecomment-199985423 source])
  
=== Help! I get a blank screen and my keybindings don't work! ===
+
=== Keyboard ===
  
There are a few ways to debug this. First, a blank screen is good. That means bspwm is running.
+
Bspwm does not handle any keyboard input and instead provides the ''bspc'' program as its interface.
  
I would confirm that your xinitrc looks something like
+
For keyboard shortcuts you will have to setup a hotkey daemon like {{Pkg|sxhkd}} ({{AUR|sxhkd-git}} for the development version).
  
{{bc|<nowiki>
+
== Troubleshooting ==
sxhkd &
 
exec bspwm
 
</nowiki>}}
 
  
The ampersand is important. Next, try spawning a terminal in your xinitrc to see if its getting positioned properly. It should appear somewhat "centered" on the screen. To do this, use this .xinitrc:
+
=== Blank screen and keybindings don't work ===
  
{{bc|<nowiki>
+
* Make sure you are starting sxhkd (in the background as it is blocking).
sxhkd &
+
* Make sure {{ic|~/.config/bspwm/bspwmrc}} is executable.
urxvt &
 
exec bspwm
 
</nowiki>}}
 
  
If nothing shows up, that means you probably forgot to install urxvt. If it shows up but isn't centered or taking up most of your screen, that means BSPWM isn't getting started properly. Make sure that you've {{ic | chmod +x ~/.config/bspwm/bspwmrc }}.
+
=== Cursor themes don't apply to the desktop ===
  
Next, type {{ic | pidof sxhkd}} in that terminal you spawned. It should return a number. If it doesn't, that means sxhd isn't running. Try to be explicit and run {{ ic | sxhkd -c ~/.config/sxhkd/sxhkdrc }}. You could also try changing the Super key to something like Alt in your sxhkdrc and see if that helps.  Another common problem is copying the text from the example files instead of physically copying the file over. Copying / pasting code usually leads to indentation issues which sxhkd can be sensitive to.
+
See [[Cursor themes#Change X shaped default cursor]]
  
=== Window box larger than the actual application! ===
+
=== Window box larger than the actual application ===
  
This can happen if you are using GTK3 apps and usually for dialog windows. The fix is to create or add the below to a gtk3 theme file (~/.config/gtk-3.0/gtk.css).  
+
This can happen if you are using GTK3 apps and usually for dialog windows. The fix is to create or add the below to a gtk3 theme file ({{ic|~/.config/gtk-3.0/gtk.css}}).  
  
{{bc|<nowiki>
+
.window-frame, .window-frame:backdrop {
.window-frame, .window-frame:backdrop {
+
  box-shadow: 0 0 0 black;
  box-shadow: 0 0 0 black;
+
  border-style: none;
  border-style: none;
+
  margin: 0;
  margin: 0;
+
  border-radius: 0;
  border-radius: 0;
+
}
}
+
   
   
+
.titlebar {
.titlebar {
+
  border-radius: 0;
  border-radius: 0;
+
}
}
 
</nowiki>}}
 
  
 
(source: [https://bbs.archlinux.org/viewtopic.php?pid=1404973#p1404973 Bspwm forum thread])
 
(source: [https://bbs.archlinux.org/viewtopic.php?pid=1404973#p1404973 Bspwm forum thread])
  
 
=== Problems with Java applications ===  
 
=== Problems with Java applications ===  
If you have problems, like Java application Windows not resizing, or menus immediately closing after you click, see [[Java#Applications not resizing with WM, menus immediately closing]].
+
 
 +
If you have problems, like Java application Windows not resizing, or menus immediately closing after you click, see [[Java#Gray window, applications not resizing with WM, menus immediately closing]].
  
 
=== Problems with keybindings using fish ===
 
=== Problems with keybindings using fish ===
 +
 
If you use [[fish]], you will find that you are unable to switch desktops. This is because bspc's use of the ^ character is incompatible with fish. You can fix this by explicitly telling sxhkd to use bash to execute commands:
 
If you use [[fish]], you will find that you are unable to switch desktops. This is because bspc's use of the ^ character is incompatible with fish. You can fix this by explicitly telling sxhkd to use bash to execute commands:
 +
 
  $ set -U SXHKD_SHELL /usr/bin/bash
 
  $ set -U SXHKD_SHELL /usr/bin/bash
  
 
Alternatively, the ^ character may be escaped with a backslash in your sxhkdrc file.
 
Alternatively, the ^ character may be escaped with a backslash in your sxhkdrc file.
 +
 +
=== Performance issues using fish ===
 +
 +
[[sxhkd]] uses the shell set in the SHELL environment variable in order to execute commands. [[fish]] can have long intialisation time due to large or improperly configured config files, thus all sxhkd commands can take much longer to execute than with other shells. To fix this without changing your default SHELL you can make tell sxhkd explicitly to use bash, or another faster shell to execute commands (for example, sh):
 +
 +
$ set -U SXHKD_SHELL sh
 +
 +
=== Error messages "Could not grab key 43 with modfield 68" on start ===
 +
 +
Either you try to use the same key twice, or you start sxhkd twice. Check bspwmrc and {{ic|~/.profile}} or {{ic|~/.bash_profile}} for excessive commands starting sxhkd.
 +
 +
=== Firefox context menu automatically selects first option on right click ===
 +
 +
{{Remove|Should be reported upstream as a software bug}}
 +
 +
Add the following line to the {{ic|userChrome.css}} file of your Firefox profile:
 +
 +
{{bc|<nowiki>
 +
#contentAreaContextMenu{ margin: 5px 0 0 5px }
 +
</nowiki>}}
 +
 +
The file should be located in {{ic|~/.mozilla/firefox/''something''.default/chrome/}} (it will need to be created if you don't already have one). Also, in Firefox, you will have to go to the {{ic|about:config}} page and enable the option {{ic|toolkit.legacyUserProfileCustomizations.stylesheets}}; otherwise Firefox will ignore the userChrome.css file.
  
 
== See also ==
 
== See also ==
Line 192: Line 247:
 
* https://github.com/baskerville/bspwm - GitHub project
 
* https://github.com/baskerville/bspwm - GitHub project
 
* https://github.com/windelicato/dotfiles/wiki/bspwm-for-dummies - earsplit's "bspwm for dummies"
 
* https://github.com/windelicato/dotfiles/wiki/bspwm-for-dummies - earsplit's "bspwm for dummies"
* https://github.com/smlb/dotfiles/wiki/Bspwm - smlb's wiki
 

Latest revision as of 11:07, 18 November 2019

bspwm is a tiling window manager that represents windows as the leaves of a full binary tree. bspwm supports multiple monitors and is configured and controlled through messages. EWMH is partially supported.

Installation

Install the bspwm package or bspwm-gitAUR for the development version.

Starting

Run bspwm using xinit.

Configuration

Important: Make sure your environment variable $XDG_CONFIG_HOME is set or your bspwmrc will not be found. This can be done by adding XDG_CONFIG_HOME="$HOME/.config" and export XDG_CONFIG_HOME to your ~/.profile.

The example configuration is located in /usr/share/doc/bspwm/examples/.

Copy bspwmrc from there into ~/.config/bspwm/ and sxhkdrc into ~/.config/sxhkd/.

These two files are where you will be setting wm settings and keybindings, respectively.

See the bspwm(1) and sxhkd(1) manuals for detailed documentation.

Note for multi-monitor setups

The example bspwmrc configures ten desktops on one monitor like this:

bspc monitor -d I II III IV V VI VII VIII IX X

You will need to change this line and add one for each monitor, similar to this:

bspc monitor DVI-I-1 -d I II III IV
bspc monitor DVI-I-2 -d V VI VII
bspc monitor DP-1 -d VIII IX X

You can use xrandr -q or bspc query -M to find the monitor names.

The total number of desktops were maintained at ten in the above example. This is so that each desktop can still be addressed with super + {1-9,0} in the sxhkdrc.

Rules

There are two ways to set window rules (as of cd97a32).

The first is by using the built in rule command, as shown in the example bspwmrc:

bspc rule -a Gimp desktop=^8 follow=on state=floating
bspc rule -a Chromium desktop=^2
bspc rule -a mplayer2 state=floating
bspc rule -a Kupfer.py focus=on
bspc rule -a Screenkey manage=off

The second option is to use an external rule command. This is more complex, but can allow you to craft more complex window rules. See these examples for a sample rule command.

If a particular window does not seem to be behaving according to your rules, check the class name of the program. This can be accomplished by running xprop | grep WM_CLASS to make sure you're using the proper string, which requires the xorg-xprop package.

Panels

Using lemonbar

An example panel for lemonbar-gitAUR is provided in the examples folder on the GitHub page. You might also get some insights from the lemonbar wiki page. The panel will be executed by placing panel & in your bspwmrc. Check the optdepends in the bspwm package for dependencies that may be required.

To display system information on your status bar you can use various system calls. This example will show you how to edit your panel to get the volume status on your BAR:

panel_volume()
{
        volStatus=$(amixer get Master | tail -n 1 | cut -d '[' -f 4 | sed 's/].*//g')
        volLevel=$(amixer get Master | tail -n 1 | cut -d '[' -f 2 | sed 's/%.*//g')
        # is alsa muted or not muted?
        if [ "$volStatus" == "on" ]
        then
                echo "%{Fyellowgreen} $volLevel %{F-}"
        else
                # If it is muted, make the font red
                echo "%{Findianred} $volLevel %{F-}"
        fi
}

Next, we will have to make sure it is called and redirected to $PANEL_FIFO:

while true; do
echo "S" "$(panel_volume) $(panel_clock)" > "$PANEL_FIFO"
        sleep 1s
done &

Using yabar

Using the example panel using lemonbar requires you to set your environment (.profile), and make sure the panel scripts are on your path. Easier panel to set up is yabarAUR, which has just one config file.

Using polybar

Polybar can be used by adding polybar example & to your bspwmrc configuration file, where example is the name of the bar.

Scratchpad

You can emulate a dropdown terminal (like i3's scratchpad feature if you put a terminal in it) using bspwm's window flags. Append the following to the end of the bspwm config file (adapt to your own terminal emulator):

bspc rule -a scratchpad sticky=on state=floating hidden=on
st -c scratchpad -e ~/bin/scratch &

The sticky flag ensures that the window is always present on the current desktop. And ~/bin/scratch is:

#!/usr/bin/sh
bspc query -N -n .floating > /tmp/scratchid
$SHELL

The hotkey for toggling the scratchpad should be bound to:

id=$(cat /tmp/scratchid);\
bspc node $id --flag hidden;bspc node -f $id

For a scratch-pad which can use any window type without pre-defined rules, see: [1]

For a more sophisticated scratchpad script that supports many terminals out of the box and has flags for doing things like optionally starting a tmuxinator/tmux session, turning any window into a scratchpad on the fly, and automatically resizing a scratchpad to fit the current monitor see tdrop-gitAUR.

Different monitor configurations for different machines

Since the bspwmrc is a shell script, it allows you to do things like these:

#! /bin/sh

 if [[ $(hostname) == 'myhost' ]]; then
     bspc monitor eDP1 -d I II III IV V VI VII VIII IX X
 elif [[ $(hostname) == 'otherhost' ]]; then
     bspc monitor VGA-0 -d I II III IV V
     bspc monitor VGA-1 -d VI VII VIII IX X
 elif [[ $(hostname) == 'yetanotherhost' ]]; then
     bspc monitor DVI-I-3 -d VI VII VIII IX X
     bspc monitor DVI-I-2 -d I II III IV V
 fi
 

Set up a desktop where all windows are floating

Here is how to setup the desktop 3 to have only floating windows. It can be useful for GIMP or other apps with multiple windows.

Put this script somewhere in your $PATH and call it from .xinitrc or similar (with a & at the end):

#!/bin/bash

 # change the desktop number here
 FLOATING_DESKTOP_ID=$(bspc query -D -d '^3')

 bspc subscribe node_manage | while read -a msg ; do
    desk_id=${msg[2]}
    wid=${msg[3]}
    [ "$FLOATING_DESKTOP_ID" = "$desk_id" ] && bspc node "$wid" -t floating
 done
 

(source)

Keyboard

Bspwm does not handle any keyboard input and instead provides the bspc program as its interface.

For keyboard shortcuts you will have to setup a hotkey daemon like sxhkd (sxhkd-gitAUR for the development version).

Troubleshooting

Blank screen and keybindings don't work

  • Make sure you are starting sxhkd (in the background as it is blocking).
  • Make sure ~/.config/bspwm/bspwmrc is executable.

Cursor themes don't apply to the desktop

See Cursor themes#Change X shaped default cursor

Window box larger than the actual application

This can happen if you are using GTK3 apps and usually for dialog windows. The fix is to create or add the below to a gtk3 theme file (~/.config/gtk-3.0/gtk.css).

.window-frame, .window-frame:backdrop {
  box-shadow: 0 0 0 black;
  border-style: none;
  margin: 0;
  border-radius: 0;
}
    
.titlebar {
  border-radius: 0;
}

(source: Bspwm forum thread)

Problems with Java applications

If you have problems, like Java application Windows not resizing, or menus immediately closing after you click, see Java#Gray window, applications not resizing with WM, menus immediately closing.

Problems with keybindings using fish

If you use fish, you will find that you are unable to switch desktops. This is because bspc's use of the ^ character is incompatible with fish. You can fix this by explicitly telling sxhkd to use bash to execute commands:

$ set -U SXHKD_SHELL /usr/bin/bash

Alternatively, the ^ character may be escaped with a backslash in your sxhkdrc file.

Performance issues using fish

sxhkd uses the shell set in the SHELL environment variable in order to execute commands. fish can have long intialisation time due to large or improperly configured config files, thus all sxhkd commands can take much longer to execute than with other shells. To fix this without changing your default SHELL you can make tell sxhkd explicitly to use bash, or another faster shell to execute commands (for example, sh):

$ set -U SXHKD_SHELL sh

Error messages "Could not grab key 43 with modfield 68" on start

Either you try to use the same key twice, or you start sxhkd twice. Check bspwmrc and ~/.profile or ~/.bash_profile for excessive commands starting sxhkd.

Firefox context menu automatically selects first option on right click

Tango-edit-cut.pngThis section is being considered for removal.Tango-edit-cut.png

Reason: Should be reported upstream as a software bug (Discuss in Talk:Bspwm#)

Add the following line to the userChrome.css file of your Firefox profile:

#contentAreaContextMenu{ margin: 5px 0 0 5px }

The file should be located in ~/.mozilla/firefox/something.default/chrome/ (it will need to be created if you don't already have one). Also, in Firefox, you will have to go to the about:config page and enable the option toolkit.legacyUserProfileCustomizations.stylesheets; otherwise Firefox will ignore the userChrome.css file.

See also