From bd6877370cc7f50f33b7a49ccaea8c912f73ad73 Mon Sep 17 00:00:00 2001 From: Bastien Dejean Date: Sat, 16 Mar 2013 12:29:24 +0100 Subject: [PATCH] Clarify and expand the configuration documentation --- README.md | 43 ++++++++++--------- bspwm.1 | 32 ++++++--------- examples/autostart | 16 ++++++++ examples/panel/autostart | 3 ++ examples/panel/panel | 5 +++ examples/{ => panel}/panel_bar | 10 ++--- examples/panel/profile | 1 + examples/panel/xinitrc | 3 ++ examples/sxhkdrc | 75 ++++++++++++++++++++++++++++++++++ 9 files changed, 141 insertions(+), 47 deletions(-) create mode 100755 examples/autostart create mode 100755 examples/panel/autostart create mode 100755 examples/panel/panel rename examples/{ => panel}/panel_bar (83%) create mode 100644 examples/panel/profile create mode 100644 examples/panel/xinitrc create mode 100644 examples/sxhkdrc diff --git a/README.md b/README.md index 10b4b78..f2472ae 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,26 @@ ![logo](https://github.com/baskerville/bspwm/raw/master/logo/bspwm-logo.png) +## Synopsis + + bspwm [-v|-s STATUS_FIFO] + + bspc MESSAGE [ARGUMENTS] [OPTIONS] + ## Description -`bspwm` is a tiling window manager based on binary space partitioning. +`bspwm` is a tiling window manager where each window is represented as the leaf of a binary tree. -The windows are represented as the leaves of a binary tree. +It is controlled and configured via `bspc`. ## Configuration `bspwm` have only two sources of informations: the X events it receives and the messages it reads on a dedicated socket. -Those messages are sent via `bspc`. - -If the `BSPWM_SOCKET` environment variable is defined, it will be used as the socket path, otherwise `/tmp/bspwm-socket` is used. +Its configuration file is `$XDG_CONFIG_HOME/bspwm/autostart`. The recommended way of defining keyboard shortcuts is to use [sxhkd](https://github.com/baskerville/sxhkd). -The only way to configure `bspwm` is by sending *set* messages via the client, hence `bspwm`'s configuration file is an executable called `autostart` which lives in `$XDG_CONFIG_HOME/bspwm/`. - -Example configurations: [autostart](https://github.com/baskerville/bin/blob/master/bspwm_autostart) and [sxhkdrc](https://github.com/baskerville/dotfiles/blob/master/sxhkdrc). +Example configuration files can be found in the `examples` directory. ## Splitting Modes @@ -65,12 +67,6 @@ was sent beforehand: | | | | | | +-------------------------+ +-------------------------+ -## Synopsis - - bspwm [-v|-s STATUS_FIFO] - - bspc MESSAGE [ARGUMENTS] [OPTIONS] - ## Messages The syntax for the client is `bspc MESSAGE [ARGUMENTS ...]`. @@ -221,19 +217,22 @@ Colors are either [X color names](http://en.wikipedia.org/wiki/X11_color_names) - `apply_shadow_property` — Enable shadows for floating windows via the `_COMPTON_SHADOW` property. +## Environment Variables + +- `BSPWM_SOCKET` — The path of the socket used for the communication between `bspc` and `bspwm`. + ## Key Features -- Configured and controlled through messages -- Multiple monitors support (via *Xinerama*) -- EWMH support (`tint2` works) -- Automatic and manual modes +- Configured and controlled through messages. +- Multiple monitors support (via *Xinerama*). +- EWMH support (`tint2` works). +- Automatic and manual modes. -## Panel +## Panels -Multiple choices: -- `dzen2` fed with the output of `ewmhstatus`. Example: [launchpanel](https://github.com/baskerville/bin/blob/master/launchpanel). -- A custom panel if the `-s` flag is used (have a look at the files in `examples/`). - Any EWMH compliant panel (e.g. `tint2`, `bmpanel2`, etc.). +- A custom panel if the `-s` flag is used (have a look at the files in `examples/panel`). +- `dzen2` fed with the output of `ewmhstatus`. Example: [launchpanel](https://github.com/baskerville/bin/blob/master/launchpanel). ## Required Libraries: diff --git a/bspwm.1 b/bspwm.1 index 2367155..f6c6a6c 100644 --- a/bspwm.1 +++ b/bspwm.1 @@ -10,7 +10,9 @@ bspwm \- Tiling window manager based on binary space partitioning .RI [ OPTIONS ] .SH DESCRIPTION .B bspwm -is a tiling window manager where each window is represented as the leaf of a binary tree. It is controlled and configured via +is a tiling window manager where each window is represented as the leaf of a binary tree. +.P +It is controlled and configured via .BR bspc . .SH CONFIGURATION .B bspwm @@ -18,28 +20,15 @@ have only two sources of informations: the .B X events it receives and the messages it reads on a dedicated socket. .P -Those messages are sent via -.BR bspc . -.P -If the -.I BSPWM_SOCKET -environment variable is defined, it will be used as the socket path, otherwise -.I /tmp/bspwm-socket -is used. +Its configuration file is +.IR $XDG_CONFIG_HOME/bspwm/autostart . .P The recommended way of defining keyboard shortcuts is to use .BR sxhkd . .P -The only way to configure -.B bspwm -is by sending -.I set -messages via the client, hence -.BR bspwm \'s -configuration file is an executable called -.I autostart -which lives in -.IR $XDG_CONFIG_HOME/bspwm/ . +Example configuration files can be found in the +.I examples +directory. .SH SPLITTING MODES There is only two splitting modes: .IR automatic " and " manual . @@ -336,6 +325,11 @@ Prevent floating windows from being raised when they might cover other floating Enable shadows for floating windows via the .B _COMPTON_SHADOW property. +.SH ENVIRONMENT VARIABLES +.TP +.I BSPWM_SOCKET +The path of the socket used for the communication between +.BR bspc " and " bspwm . .SH AUTHOR .EX Bastien Dejean diff --git a/examples/autostart b/examples/autostart new file mode 100755 index 0000000..fa6d446 --- /dev/null +++ b/examples/autostart @@ -0,0 +1,16 @@ +#! /bin/sh + +FIRST_DESK=One +REMAINING_DESKS='Two Three Four Five Six Seven Eight Nine Ten' +bspc rename Desktop01 $FIRST_DESK +bspc add $REMAINING_DESKS +bspc layout monocle $FIRST_DESK $REMAINING_DESKS + +bspc rule Gimp Eight floating + +bspc set border_width 1 +bspc set window_gap 6 + +bspc set borderless_monocle true +bspc set gapless_monocle true +bspc set adaptative_raise true diff --git a/examples/panel/autostart b/examples/panel/autostart new file mode 100755 index 0000000..66d5be4 --- /dev/null +++ b/examples/panel/autostart @@ -0,0 +1,3 @@ +#! /bin/sh + +panel & diff --git a/examples/panel/panel b/examples/panel/panel new file mode 100755 index 0000000..f51f080 --- /dev/null +++ b/examples/panel/panel @@ -0,0 +1,5 @@ +#! /bin/sh + +xtitle -sf 'T%s' > "$BSPWM_STATUS_FIFO" & +clock 'S%H:%M' 5 > "$BSPWM_STATUS_FIFO" & +cat "$BSPWM_STATUS_FIFO" | panel_bar | bar diff --git a/examples/panel_bar b/examples/panel/panel_bar similarity index 83% rename from examples/panel_bar rename to examples/panel/panel_bar index 473f356..da3c54f 100755 --- a/examples/panel_bar +++ b/examples/panel/panel_bar @@ -7,6 +7,9 @@ while read -r line ; do S*) sys_infos="\\r\\f5${line#?}\\fr" ;; + T*) + title="\\c${line#?}" + ;; *) wm_infos="" IFS=':' @@ -35,15 +38,10 @@ while read -r line ; do layout=$(printf "%s" "${item#?}" | sed 's/\(.\).*/\U\1/') wm_infos="$wm_infos \\b4\\f0$layout\\br\\fr" ;; - W*) - # window id - wid=${item#?} - [ $wid != 0 ] && wm_infos="$wm_infos\\c$(xdotool getwindowname 0x$wid)" - ;; esac shift done ;; esac - printf "%s\n" "$wm_infos $sys_infos" + printf "%s\n" "$wm_infos $title $sys_infos" done diff --git a/examples/panel/profile b/examples/panel/profile new file mode 100644 index 0000000..cfd37fb --- /dev/null +++ b/examples/panel/profile @@ -0,0 +1 @@ +export BSPWM_STATUS_FIFO=/tmp/bspwm-fifo diff --git a/examples/panel/xinitrc b/examples/panel/xinitrc new file mode 100644 index 0000000..5f37398 --- /dev/null +++ b/examples/panel/xinitrc @@ -0,0 +1,3 @@ +[ -e "$BSPWM_STATUS_FIFO" ] && rm "$BSPWM_STATUS_FIFO" +mkfifo "$BSPWM_STATUS_FIFO" +exec bspwm -s "$BSPWM_STATUS_FIFO" diff --git a/examples/sxhkdrc b/examples/sxhkdrc new file mode 100644 index 0000000..c591a9a --- /dev/null +++ b/examples/sxhkdrc @@ -0,0 +1,75 @@ +# +# bspwm hotkeys +# + +super + alt + Escape + bspc quit + +super + w + bspc close + +super + t + bspc cycle_layout + +super + {s,f} + bspc toggle_{floating,fullscreen} + +super + {grave,Tab} + bspc {alternate,alternate_desktop} + +super + {h,j,k,l} + bspc focus {left,down,up,right} + +super + shift + {h,j,k,l} + bspc shift {left,down,up,right} + +super + {c,shift + c} + bspc cycle {next,prev} + +super + bracket{left,right} + bspc cycle_desktop {prev,next} + +super + ctrl + {h,j,k,l} + bspc presel {left,down,up,right} + +super + alt + {h,j,k,l} + bspc push {left,down,up,right} + +super + alt + shift + {h,j,k,l} + bspc pull {right,up,down,left} + +super + ctrl + {1-9} + bspc ratio 0.{1-9} + +super + {1-9,0} + bspc use {One,Two,Three,Four,Five,Six,Seven,Eight,Nine,Ten} + +super + shift + {1-9,0} + bspc send_to {One,Two,Three,Four,Five,Six,Seven,Eight,Nine,Ten} + +super + button{1,2,3} + bspc grab_pointer {move,resize_side,resize_corner} + +super + !button{1,2,3} + bspc {track_pointer,track_pointer,track_pointer} %i %i + +super + @button{1,2,3} + bspc {ungrab_pointer,ungrab_pointer,ungrab_pointer} + +super + alt + button1 + bspc grab_pointer focus + +# +# wm independent hotkeys +# + +super + Return + urxvt + +super + space + dmenu_run + +super + Escape + pkill -USR1 -x sxhkd + + vim: set ft=sxhkdrc: -- 2.44.0