2bwm
2bwm is a fast floating WM, with the particularity of having 2 borders, written over the XCB library and derived from mcwm written by Michael Cardell. In 2bwm everything is accessible from the keyboard but a pointing device can be used for move, resize and raise/lower.
Installation
Once you finish installing Archcraft, 2bwm can be installed on the top of it. It's pre-configured and ready to go. Open a terminal and run the following command to install 2bwm :
$ sudo pacman -Sy archcraft-2bwm
Configuration
2bwm is pre-configured in Archcraft. In this section, We'll see how the 2bwm window manager is configured, what tools and utilities are used to make it look and work like a complete desktop environment.
Config Structure
The configuration structure of 2bwm in Archcraft looks something like this:
/opt
└── 2bwm-source : 2bwm source code
└── config.h : 2bwm config file
/usr
└── share
└── archcraft
└── 2bwm
├── alacritty : terminal config
├── scripts : scripts used for 2bwm
├── theme : desktop theme (polybar, rofi configs)
├── dunstrc : dunst config for notifications
├── picom.conf : compositor config
└── xsettingsd : gtk themes, icons and fonts config file
Terminal
Alacritty is the default terminal. In 2bwm window manager, alacritty is launched with an alternative config file. If you need to change anything, make sure you modify the config files in /usr/share/archcraft/2bwm/alacritty
directory. These are the following config files you can modify to change the behaviour of your terminal:
/usr/share/archcraft/2bwm/alacritty/alacritty.toml
: Main configuration file
/usr/share/archcraft/2bwm/alacritty/colors.toml
: Colors configurations
/usr/share/archcraft/2bwm/alacritty/fonts.toml
: Fonts configurations
If you need any help with alacritty config, run :
man 5 alacritty
in terminal.
Notification
Dunst is used as a notification daemon for notifications in 2bwm. In 2bwm window manager, dunst is launched with an alternative config file, which is /usr/share/archcraft/2bwm/dunstrc
. So, If you need to modify anything, make sure you edit this file.
If you need any help with dunst config, run :
man 5 dunst
in terminal.
Wallpaper
hsetroot sets the wallpaper in the 2bwm. If you want to change the wallpaper, Edit /usr/share/archcraft/2bwm/scripts/2bwm_autostart
script and add the path to your wallpaper :
# Restore wallpaper
hsetroot -cover '/path/to/your/wallpaper'
Statusbar
Polybar is used as the statusbar in Archcraft's 2bwm window manager.
The configurations for polybar can be found inside the theme directory directory of 2bwm /usr/share/archcraft/2bwm/theme
If you want to modify the polybar settings, or perhaps want to add/remove modules, then you need to edit the following files :
/usr/share/archcraft/2bwm/theme/polybar/config.ini
: Main config file
/usr/share/archcraft/2bwm/theme/polybar/colors.ini
: Colors config file
/usr/share/archcraft/2bwm/theme/polybar/modules.ini
: Modules config file
If you need any help with polybar config, visit : polybar wiki
Launchers and Applets
Rofi is used for application launchers, command runner and various applets. To modify the rofi config, edit ~/.config/rofi/config.rasi
file.
If you need any help with rofi config, run :
man rofi
in terminal.
The scripts for rofi that are used in 2bwm can be found it /usr/share/archcraft/2bwm/scripts
directory. These are the following scripts that uses rofi to provide the launchers and applets :
rofi_askpass
: rofi based sudo
frontend to get root password
rofi_asroot
: applet to open apps as root
rofi_bluetooth
: bluetooth applet to quickly connect to BT devices
rofi_launcher
: an application launcher, cmd runner, file manager and task manager
rofi_music
: music applet, that controls MPD with mpc
rofi_powermenu
: power menu, with confirmation dialog
rofi_runner
: quickly lets you run a command
rofi_screenshot
: screenshot applet that works with maim
If you want to modify any applet or perhaps want to extend the functionality of the applet, just edit these scripts above.
The configuration of each script can be found inside the theme directory of 2bwm /usr/share/archcraft/2bwm/theme
Let's say you want to modify the looks of launcher, then you need to edit the /usr/share/archcraft/2bwm/theme/rofi/launcher.rasi
file. Same goes for every other applet, Edit the respective file in the same directory.
If you need any help with rofi theming, run :
man rofi-theme
in terminal.
To change the colors and fonts of the launchers and applets, Edit the /usr/share/archcraft/2bwm/theme/rofi/shared/colors.rasi
and /usr/share/archcraft/2bwm/theme/rofi/shared/fonts.rasi
files.
Compositor
Picom is used for compositing. It's a lightweight compositor with shadowing, advanced blurring and fading. In 2bwm, picom is launched with an alternative config file, which is /usr/share/archcraft/2bwm/picom.conf
.
If you need to change anything related to picom, Edit this picom config file.
If you need any help with picom config, check the picom's default config file in
/etc/xdg/picom.conf
If you're having screen-tearing issues, using glx
backend can solve this issue.
If you're facing lagging, hangs and freezes, try switching between xrender
and glx
backend.
Window Manager
/opt/2bwm-source/config.h
is the main configuration file of 2bwm. If you need to change anything or perhaps you want to add/remove/change keybindings, Edit this file and recompile 2bwm and then install the new binary.
If you need any help with 2bwm configuration and customisation, run :
man 2bwm
Keybindings
Here's a list of some important keybinds you need to know for operating 2bwm easily. If you want to view, modify or add new keybinds, Edit /opt/2bwm-source/config.h
file.
Applications
Keys | Action |
---|---|
super + Return | Open terminal (alacritty) |
super + shift + Return | Open fullscreen terminal |
super + F | Open file manager (thunar) |
super + E | Open text editor (geany) |
super + W | Open web browser (firefox) |
Menu and Applets
Keys | Action |
---|---|
super | Open application launcher |
alt + F1 | Open application launcher |
alt + F2 | Open command runner |
super + N | Open network manager applet |
super + B | Open bluetooth applet |
super + M | Open music applet |
super + X | Open powermenu applet |
super + S | Open screenshots applet |
super + R | Open apps as root applet |
Hardware Keys
Keys | Action |
---|---|
Take screenshot | |
alt + Print | Take screenshot in 5 seconds delay |
shift + Print | Take screenshot in 10 seconds delay |
ctrl + Print | Take screenshot of currently focused window |
super + Print | Take screenshot of selected area |
XF86AudioRaiseVolume | Increase volume |
XF86AudioLowerVolume | Decrease volume |
XF86AudioMute | Toggle mute speakers |
XF86AudioMicMute | Toggle mute microphone |
XF86MonBrightnessUp | Increase display brightness |
XF86MonBrightnessDown | Decrease display brightness |
Workspaces
Keys | Action |
---|---|
super + 1..9,0 | Switch to respective workspace |
super + ctrl + Right/Left | Next/Previous workspace |
super + ctrl + shift + Right/Left | Move window to Next/Previous workspace |
super + Comma/Period | Next/Previous screen |
Window Management
Keys | Action |
---|---|
super + C/Q | Close focued window |
super + Tab | Focus to next/previous window |
super + Up/Down/Left/Right | Move window directionally |
super + shift + Up/Down/Left/Right | Resize window directionally |
super + alt + Left/Right | Resize while keeping the window's aspect ratio |
super + G | Teleport the window to center of the screen |
super + shift + G | Teleport the window to centerY of the screen |
super + ctrl + G | Teleport the window to centerX of the screen |
super + H | Teleport the window to Top left of the screen |
super + K | Teleport the window to Top right of the screen |
super + J | Teleport the window to Bottom left of the screen |
super + L | Teleport the window to Bottom right of the screen |
super + shift + M | Maximize window |
super + shift + F | Fullscreen window |
super + V | Maximize vertically |
super + shift + V | Maximize horizontally |
super + shift + H | Maximize and move vertically to the left |
super + shift + L | Maximize and move vertically to the right |
super + shift + J | Maximize and move horizontally to the left |
super + shift + K | Maximize and move horizontally to the right |
super + shift + ctrl + K | Maximize and move : fold half vertically |
super + shift + ctrl + H | Maximize and move : fold half horizontally |
super + shift + ctrl + J | Maximize and move : unfold vertically |
super + shift + ctrl + L | Maximize and move : unfold horizontally |
super + I | Iconify the window |
super + A | Make the window unkillable |
super + Z | Raise or lower a window |
super + T | Make the window appear always on top |
super + D | Make the window stay on all workspaces |
super + Y | Toggle sloppy |
super + Space | Make window half and centered |
Window Manager
Keys | Action |
---|---|
super + ctrl + R | Restart 2bwm |
super + ctrl + Q | Quit 2bwm |
Misc Keys
Keys | Action |
---|---|
ctrl + alt + M | Open ncmpcpp with album art in terminal |
ctrl + alt + L | Trigger lockscreen |
super + P | Run colorpicker |
Screenshots
Here's few screenshots of 2bwm
desktop. These'll give you an idea of the experience of 2bwm in Archcraft.
Desktop 1 | Desktop 2 | Desktop 3 | Desktop 4 |
---|---|---|---|
Desktop 5 | Desktop 6 | Desktop 7 | Desktop 8 |
---|---|---|---|
Desktop 9 | Desktop 10 | Desktop 11 | Desktop 12 |
---|---|---|---|
FAQs
How to change GTK theme, icons and cursor?
To change GTK theme, icons and cursor in 2bwm session, Edit /usr/share/archcraft/2bwm/xsettingsd
file and restart 2bwm to apply the changes.
Net/ThemeName "Nordic"
Net/IconThemeName "Zafiro"
Gtk/CursorThemeName "Qogirr"
How to manage multiple monitors and resolution in 2bwm?
If you use multiple monitors with 2bwm window manager, you can manage them by running Manager Monitors or archcraft-randr
app.
Why Alacritty is not working on my computer?
Since Alacritty is a OpenGL based terminal emulator, It may not work on some computer hardwares. You can make it work on such computers by following these methods :
- Open alacritty with LIBGL_ALWAYS_SOFTWARE=1 variable. Edit the keybindings/script launching alacritty and replace
alacritty
withLIBGL_ALWAYS_SOFTWARE=1 alacritty
- Edit /usr/share/applications/Alacritty.desktop desktop file and replace
Exec=alacritty
withExec=env LIBGL_ALWAYS_SOFTWARE=1 alacritty