- RomaniukVadim / bspwm.txt
- bspwm (Русский)
- Contents
- Установка
- Настройка
- Примечание для установки нескольких мониторов
- Правила
- Панели
- Блокнот
- Различные настройки монитора для различных машин
- Решение проблем
- Помогите! У меня пустой экран и мои горячие клавиши не работают!
- Размер окна больше самого приложения!
- Проблемы с приложениями Java
- Проблемы, связанные с использованием назначения клавиш fish
- bspwm
- Contents
- Installation
- Starting
- Configuration
- Note for multi-monitor setups
- Rules
- Panels
- Using lemonbar
- Using yabar
- Using polybar
- Scratchpad
- Using pid
- Using class name
- Other
- Different monitor configurations for different machines
- Set up a desktop where all windows are floating
- Keyboard
- Troubleshooting
- Blank screen and keybindings do not work
- Cursor themes do not apply to the desktop
- Window box larger than the actual application
- Problems with Java applications
- Problems with keybindings using fish
- Performance issues using fish
- Error messages «Could not grab key 43 with modfield 68» on start
- Firefox context menu automatically selects first option on right click
RomaniukVadim / bspwm.txt
Binary Space Partitioning Window Manager = bspwm |
Youtube Video: https://youtu.be/ZbXQUOwcH08 |
bspwm install |
pacman packages: |
bspwm |
sxhkd |
terminus-font |
xorg-xset |
xorg-xsetroot |
dmenu |
termite (optional) |
rxvt-unicode (urxvt) |
trayer (optional) |
stalonetray (optional) |
AUR packages: |
xtitle-git |
sutils-git |
lemonbar-xft-git |
.xinitrc |
sxhkd & |
exec bspwm |
configuration: |
mkdir -p .config/bspwm |
mkdir .config/sxhkd |
cp /usr/share/doc/bspwn/examples/bspwmrc .config/bspwm |
cp /usr/share/doc/bspwn/examples/sxkhdrc .config/sxhkd |
NOTE: edit sxkhdrc if using termite |
add to .bashrc |
export PANEL_FIFO=/tmp/panel-fifo |
export PATH=$PATH:/home/midfingr/Documents/panel |
then: source |
/.bashrc
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Источник
bspwm (Русский)
bspwm тайловый оконный менеджер представляющий окна как слои двоичного дерева. Также поддерживает EWMH и несколько мониторов. Настраивается и управляется с помощью сообщений.
Contents
Установка
Установите bspwm и sxhkd , или разрабатываемую версию: bspwm-git AUR и sxhkd-git AUR . Sxhkd простой демон горячих клавиш X, использующий для связи bspc с bspwm, он также запускает выбранные вами приложения.
Для запуска bspwm при входе в систему, добавьте следующие строки в
/.xprofile (в зависимости от того, как вы запускаете X / ваш менеджер дисплея):
Настройка
Пример настроек находится в /usr/share/doc/bspwm/examples/ и на GitHub.
Важно: Создайте ваше переменное окружение $XDG_CONFIG_HOME правильно, иначе bspwmrc не будет найден. Это можно сделать путём добавления XDG_CONFIG_HOME=»$HOME/.config» и экспорта XDG_CONFIG_HOME в ваш
/.config/sxhkd/ , затем скопируйте /usr/share/doc/bspwm/examples/bspwmrc в
/.config/bspwm/ и /usr/share/doc/bspwm/examples/sxhkdrc в
/.config/sxhkd/ . Сделайте bspwmrc выполняемым chmod +x
Эти два файла, в которых вы будите устанавливать соответственно настройки wm (оконного менеджера) и горячих клавиш. В качестве примера, смотрите bspwm/Example configurations.
Документацию для bspwm можно посмотреть выполнив bspwm(1) .
Также есть документация для sxhkd, выполните sxhkd(1) .
Примечание для установки нескольких мониторов
Пример настройки bspwmrc, для десяти рабочих столов на одном мониторе:
Вам нужно будет изменить эту строку и добавить для каждого монитора, например:
Вы можете использовать запросы `xrandr -q` или `bspc query -M` чтобы узнать имя монитора.
В примере выше, было сохранено общее количество рабочих столов, — десять. Это связано с тем, что к каждому рабочему столу можно обратиться с помощью ‘super + <1-9,0>‘ в sxhkdrc.
Правила
Есть два способа установить правила для окна (rules) (по состоянию на cd97a32).
Во-первых, с помощью встроенной команды правила, как показано в примере bspwmrc:
Второй вариант заключается в использовании внешней команды правил. Этот вариант более сложный, но может позволить вам разрабатывать более сложные правила для окна. Смотрите команды правил в этих примерах.
Если какое-то окно, не ведёт себя в соответствии с вашими правилами, проверьте имя класса программы. Это можно сделать запустив xprop | grep WM_CLASS чтобы убедиться, что вы используете правильную строку.
Панели
Пример панели для lemonbar AUR есть в каталоге examples на странице GitHub. Вы также можете получить некоторые идеи из страници Wiki lemonbar. Панель будет запускаться командой panel & в вашем bspwmrc. Проверьте дополнительные зависимости пакета bspwm которые могут потребоваться.
Для отображения информации о системе на строке состояния, вы можете использовать различные системные вызовы. Этот пример покажет вам как изменить panel , чтобы получить статус громкости на панели:
Далее, мы должны убедиться, что она вызывается и отправляет в $PANEL_FIFO :
Блокнот
Вы можете эмулировать блокнот (как в i3) путем добавления ярлыка для этой команды:
и добавив это правило:
Смотрите также [1] и [2].
Для блокнота, который может использовать любой тип окна без предопределенных правил, смотрите: [3]
Для более сложных скриптов блокнота, которые поддерживают множество терминалов «из коробки», имеют флаги, делают при необходимости запуск сессии tmuxinator / tmux, превращают любое окно в блокнот на лету, автоматически меняют размер блокнота соответствующему монитору, смотрите tdrop-git AUR .
Различные настройки монитора для различных машин
Так как bspwmrc это сценарий оболочки, он позволяет делать такие вещи:
Решение проблем
Помогите! У меня пустой экран и мои горячие клавиши не работают!
Есть несколько способов уладить это. Во-первых, пустой экран это хорошо. Это означает, что bspwm работает.
Для начала убедитесь что в вашем xinitrc есть эти строки
Амперсанд имеет важное значение. Далее, попробуйте вызвать терминал в вашем xinitrc, чтобы увидеть, получите ли вы его правильное положение. Он должен появиться несколько «по центру» на экране. Для этого используйте этот .xinitrc:
Если ничего не отображается, это означает, что вы, вероятно, забыли установить urxvt. Если он оказался вверху, но не по центру экрана, или занимает большую часть экрана, это означает, что BSPWM не начал работу должным образом. Убедитесь что вы выполнили chmod +x
Далее, введите в этом запустившемся терминале pidof sxhkd . Команда покажет число. Если этого не произойдет, это означает, что sxhd не работает. Выполните sxhkd -c
/.config/sxhkd/sxhkdrc . Кроме того, можно попробовать изменить клавишу Super на другую, например Alt в вашем sxhkdrc и посмотреть, поможет ли это. Другой распространенной проблемой является копирование текста из файла примеров, вместо физического копирования файла. Копирование / вставка кода обычно приводит к проблемам отступов, к которые sxhkd может быть чувствительным.
Размер окна больше самого приложения!
Это может произойти, если вы используете приложения GTK3, обычно это происходит с диалоговыми окнами. Для решения проблемы необходимо создать или добавить ниже в файле темы GTK3 (
Проблемы с приложениями Java
Если у вас есть проблемы, например окно приложения Java неменяет размер, или меню закрыввется после щелчка, смотрите Java#Gray window, applications not resizing with WM, menus immediately closing.
Проблемы, связанные с использованием назначения клавиш fish
Если вы используете fish, вы обнаружите, что не можете переключаться между рабочими столами. Это происходит потому что bspc’s использует символ ^ несовместимый с fish. Вы можете это исправить, сказав sxhkd использовать bash для выполнения команд:
В качестве альтернативы, символ ^ может быть символом обратной косой черты в файле sxhkdrc.
Источник
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. EWMH is partially supported.
Contents
Installation
Install bspwm or bspwm-git AUR for development version.
Starting
Run bspwm using xinit.
Configuration
The example configuration is located in /usr/share/doc/bspwm/examples/ .
Copy/install bspwmrc from there into
/.config/bspwm/ and sxhkdrc into
The file bspwmrc needs to be executable since the default example is simply a shell script that in turn configures bspwm via the bspc command.
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:
You will need to change this line and add one for each monitor, similar to this:
You can use xrandr -q or bspc query -M —names 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:
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 are using the proper string, which requires the xorg-xprop package.
Panels
Using lemonbar
An example panel for lemonbar-git AUR 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:
Next, we will have to make sure it is called and redirected to $PANEL_FIFO :
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 yabar AUR , 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
Using pid
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):
The sticky flag ensures that the window is always present on the current desktop. And
The hotkey for toggling the scratchpad should be bound to:
Using class name
In this example we are going to use termite with a custom class name as our dropdown terminal. It does not have to be termite.
First create a file in your path with the following content and make it executable. In this example let us call it scratchpad.sh :
Then add this to your bspwm config.
To toggle the window a custom rule in sxhkd is necessary. Give as parameter the custom class name.
Other
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-git AUR .
Different monitor configurations for different machines
Since the bspwmrc is a shell script, it allows you to do things like these:
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):
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-git AUR for the development version).
Troubleshooting
Blank screen and keybindings do not work
- Make sure sxhkd is installed.
- Make sure you are starting sxhkd (in the background as it is blocking).
- Make sure
/.config/bspwm/bspwmrc is executable.
The example configuration file for sxhkd specifies urxvt as the terminal emulator. If you do not have this installed, edit
/.config/sxhkd/sxhkdrc to point to the terminal emulator of your choosing.
Cursor themes do not apply to the desktop
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 (
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.
Furthermore, some applications based on Java can not display any window content at all (e.g. Intellij IDEs like PyCharm, CLion, etc). A solution is to install wmname and add the following line in your
Additionally, these errors can often be solved by setting an environment variable for the JVM within bspwmrc or a shell rc like
/.bashrc , since BSPWM is a non reparenting WM.
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:
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):
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
/.bash_profile for excessive commands starting sxhkd.
Firefox context menu automatically selects first option on right click
This section is being considered for removal.
Источник