This is Gentoo's testing wiki. It is a non-operational environment and its textual content is outdated.

Please visit our production wiki at https://wiki.gentoo.org

bspwm

From Gentoo Wiki (test)
Jump to:navigation Jump to:search

bspwm is a lightweight, tiling, minimalist window manager that is written in C and represents its windows as leaves on a binary tree. Its installed size is less than 600 KB (even with the examples USE flag enabled). It only responds to X events and messages it receives on a dedicated socket from a program included in its package, bspc.

Installation

USE flags

USE flags for x11-wm/bspwm Tiling window manager based on binary space partitioning

examples Install examples, usually source code

Emerge

To install bspwm using Portage merely issue the command:

root #emerge --ask x11-wm/bspwm

sxhkd is used for keybindings and pointer bindings so one may wish to install it too with:

root #emerge --ask x11-misc/sxhkd

Configuration

If you installed with examples local USE flag enabled, you have to configure bspwm properly.

First create the necessary directories that will hold your configurations. Because bspwm doesn't handle keyboard or pointer inputs, it's using x11-misc/sxhkd (Simple X hotkey daemon) to do so, therefore we'll need a config file for that as well because that's where all your key bindings will reside.

user $mkdir -vp ~/.config/bspwm ~/.config/sxhkd

Now copy the sample configuration files from /usr/share/doc/bspwm/examples/ and, if required, extract them:

user $cp -v /usr/share/doc/bspwm/examples/bspwmrc.bz2 ~/.config/bspwm/
user $cp -v /usr/share/doc/bspwm/examples/sxhkdrc.bz2 ~/.config/sxhkd/
user ~/.config/bspwm $bunzip2 bspwmrc.bz2
user ~/.config/sxhkd $bunzip2 sxhkdrc.bz2
Note
The bspwmrc configuration file needs to be executable. Therefore, if it's not, you can chmod +x ~/.config/bspwm/bspwmrc.

Autostart programs

If you have certain programs that want to start after logging in on the workstation (i.e. net-misc/dropbox, media-gfx/feh) you can achieve that by simply adding them in the bspwm config file

FILE ~/.config/bspwm/bspwmrcbspwm configuration file
# autostart programs
dropbox
feh --bg-scale ~/.config/my_wallpaper.png
${HOME}/.config/polybar/launch.sh

Hide/Show windows

Some programs also have tray icons and one may want to mimic the Minimize behavior (hide in the bspwm world), you can achieve that by setting a keyboard shortcut. Note that when restoring them, they will spawn in the same Monitor that they were hidden, just so you don't go look for them in the other Desktops randomly...

FILE ~/.config/sxhkd/sxhkdrcsxhkd configuration file
# hide window
super + v
  bspc node -g hidden

# unhide window
super + shift + v
  bspc node {,$(bspc query -N -n .hidden | tail -n1)} -g hidden=off

Additional software

dmenu

In order to launch whatever programs you desire

USE flags for x11-misc/dmenu a generic, highly customizable, and efficient menu for the X Window System

savedconfig Use this to restore your config from /etc/portage/savedconfig ${CATEGORY}/${PN}. Make sure your USE flags allow for appropriate dependencies
xinerama Add support for querying multi-monitor screen geometry through the Xinerama API

To assign a keyboard shortcut for launching dmenu:

FILE ~/.config/sxhkd/sxhkdrcsxhkd configuration file
# program launcher
super + @space
  dmenu_run

Terminal emulators

st aka suckless/simple terminal

If lightweight is how you roll, this might be of use

USE flags for x11-terms/st Simple terminal implementation for X

savedconfig Use this to restore your config from /etc/portage/savedconfig ${CATEGORY}/${PN}. Make sure your USE flags allow for appropriate dependencies

To install it, just issue the command:

root #emerge --ask x11-terms/st

To enable a keyboard shortcut for launching the terminal

FILE ~/.config/sxhkd/sxhkdrcsxhkd configuration file
# terminal emulator
super + Return
  st

rxvt-unicode aka urxvt

This is another alternative, although it lacks full unicode support and you might have some issues with Powerline Fonts.

USE flags for x11-terms/rxvt-unicode rxvt clone with xft and unicode support

+font-styles Enable support for bold and italic fonts
+mousewheel Enable scrolling via mouse wheel or buttons 4 and 5
24-bit-color Enable 24-bit color support. Note that this feature is unofficial, may cause visual glitches due to the fact there is no termcap/terminfo definition for rxvt-unicode-24bit yet so it is necessary to use the one for 256 colours, visibly increases memory usage, and might slow urxvt down dramatically when more than six fonts are in use in a terminal instance.
256-color Enable 256 color support
blink Enable blinking text
fading-colors Enable colors fading when off focus
gdk-pixbuf Enable transparency support using x11-libs/gdk-pixbuf
iso14755 Enable ISO-14755 support
perl Enable perl script support. You can still disable this at runtime with -pe ""
startup-notification Enable application startup event feedback mechanism
unicode3 Use 21 instead of 16 bits to represent unicode characters
wide-glyphs Enable support for wide glyphs, required for certain symbol/icon fonts to display correctly. Note that this feature is *unofficial* and has been observed to cause stability issues for some users.
xft Build with support for XFT font renderer (x11-libs/libXft)

You can install it issuing the command:

root #emerge --ask x11-terms/rxvt-unicode

i3lock

Locking your screen is always recommended in order to avoid unauthorized access to your Workstation

USE flags for x11-misc/i3lock Simple screen locker

You can install it by issuing the command:

root #emerge --ask x11-misc/i3lock

In order to assign a keyboard shortcut for locking your screen, you should update your configuration file

FILE ~/.config/sxhkd/sxhkdrcsxhkd configuration file
# lock the screen with dark background
super + q
  i3lock -c 000000

File managers

ranger

ranger is a console file manager with VI key bindings. It provides a minimalistic and nice curses interface with a view on the directory hierarchy. It ships with rifle, a file launcher that is good at automatically finding out which program to use for what file type.

You can install ranger via

root #emerge --ask app-misc/ranger

If you want to tune ranger with your own settings:

Start ranger and exit so that it creates the directory structure for its configuration files.

user $ranger
user $Q

Now copy the configuration files:

user $ranger --copy-config=all
creating: /home/user/.config/ranger/apps.py
creating: /home/user/.config/ranger/commands.py
creating: /home/user/.config/ranger/rc.conf
creating: /home/user/.config/ranger/options.py
creating: /home/user/.config/ranger/scope.sh

See also

External resources