Author Topic: bspwm window manager  (Read 5386 times)

PackRat

  • Posts: 1848
    • View Profile
bspwm window manager
« on: September 11, 2013, 05:18:08 PM »
Been checking out bspwm - second time I've tried it, put a little more patience and effort into this time.

It's a tiling window manager written by an arch linux user - check out the dedicated thread

There are two programs to install - bspwm itself, and the program to define the key bindings - sxhkd - both available from the github linked in the op of the arch thread.

Here is a good HowTo for installing on a debian system (it's in the aur for you arch users).

First time I tried using bspwm, I tried it with xbindkeys because sxhkd wasn't working for me (and a couple #! users) but following that HowTo fixed whatever was messing me up - dependency? Using xbindkeys was causing some issues with other window managers on my system, so go with sxhkd. Two other recommended programs - dzen2 and dmenu.

There is a bit of a learning curve - particularly with the default key bindings - to understand how the windows get manipulated, so read the man pages for bspwm and sxhkd before logging in for the first time. After learning some basics, and setting up some key bindings you're comfortable with, manipulating windows becomes pretty straight forward.

Like most tilers, it has it's default layout - the binary space partitioning was why I checked it out in the first place, it's unique. But, window partitioning can be manual as well - reminiscent of musca window manager for any that have tried it - so it's really easy to get open windows into the layout you want.

Some screenshots -



Panels do work with this window manager, but I'm not sure I got them set up correctly - got the panel started, but it is "always on top" so a portion of the active window disappears beneath the panel. Don't know if that's the default and can be changed. One way around it is to set the:

Code: [Select]
bspc config window_gap
in the $HOME/.config/bspwm/bspwmrc file to a value that leaves the panel uncovered, but there is only one setting for left, right, top, bottom, and space between open windows so a setting of 20 to clear a panel will leave a lot of unused screen space.



The default panels are defined by some pretty impressive bash scripts and require dzen2 be installed.

The conky in the screenshots is a regular conky with:

Code: [Select]
own_window no
Rules can be set up so that windows float by default (xine in the screenshot) and open on a particular desktop (9 virtual desktops by default).

All in all, a good, usable window manager that doesn't take too much effort to learn the basics. Hopefully, the project continues. This single post can't really do it justice, read through the arch thread to get an idea of what can be done with this wm; or watch the screencast (link at top of page) -- http://www.reddit.com/r/unixporn/comments/1m0ea1/arch_bspwm_why_bspwm_watch_this_screencast_and/
I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo

Digit

  • Techno Hippie
  • Posts: 295
  • savant (alegedly), polymath (wannabe)
    • View Profile
    • wastedartist.com
Re: bspwm window manager
« Reply #1 on: September 24, 2013, 11:16:06 AM »
when seen it in action...

bspwm 0.1 on Vimeo

it really conjures some drool.

PackRat

  • Posts: 1848
    • View Profile
Re: bspwm window manager
« Reply #2 on: September 24, 2013, 02:01:41 PM »
From that video, it looks like the top margin width can be set independently from the other margins to make room for the panel, but not sacrifice desktop real estate along the margins or between windows. Have you looked into the configuration enough to know how that was done?

I'm not using it at the moment, so I haven't followed the arch forum thread or really looked past basic configuration.
I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo

PackRat

  • Posts: 1848
    • View Profile
Re: bspwm window manager
« Reply #3 on: November 12, 2015, 08:54:11 PM »
Installed and configured bspmwm and sxhkd again; put some time and effort into configuration this time around, especially the taskbar.

     

the taskbar is lemonbar which is available from the author's git page.

bspwm, sxhkd, and several utilities like xres, xdo, and xtitle are available from the author's web page.. A lot of his utilities are used in the setups on the bspwm desktop page, and the main bspwm discussion page over on the Arch forum.

My current setup has desktop and conky piped to lemonbar; the panel scripts are modifications of the default script and Arch users' scripts. Configs:

bspwmrc -
Code: [Select]
#!/bin/sh

bspc config border_width            1
bspc config window_gap              0
bspc config split_ratio             0.50

bspc config top_padding                      22
bspc config right_padding                    0
bspc config bottom_padding                   0
bspc config left_padding                     0

bspc config focused_border_color             "#CBB23D"
bspc config active_border_color              "#565656"
bspc config normal_border_color              "#363636"

bspc config borderless_monocle      false
bspc config gapless_monocle         true
bspc config leaf_monocle            true
bspc config focus_follows_pointer   false
bspc config history_aware_focus     true
bspc config auto_cancel             true
bspc config focus_by_distance       true

bspc monitor -d 1 2 3 4

bspc desktop ^4 -l monocle

bspc rule -a Gimp desktop=^4 follow=on
bspc rule -a lxappearance state=floating center=true
bspc rule -a nitrogen state=floating center=true
bspc rule -a lxappearance state=floating center=true
bspc rule -a mplayer2 state=floating
bspc rule -a xfce4-appfinder state=floating
bspc rule -a xcalc state=floating
bspc rule -a stalonetray border=off sticky above
bspc rule -a trayer border=off sticky above
bspc rule -a Orage border=off sticky state=floating


# autostart apps

fbsetbg -c -r ~/wallpaper/ &

# conky contained in panel
~/.config/bspwm/panel &

(sleep 2s && trayer --edge top --align right --distance 1 --distancefrom right --widthtype request --height 22 --SetDockType true --SetPartialStrut true --expand true --transparent true --alpha 0 --tint 0x232323) &

panel_lemon -
Code: [Select]
#! /bin/sh
#
# bar input parser for bspwm

NORMIFS=$IFS
FIELDIFS=':'

COLOR3="#CBB23D"
COLOR4="#E22D32"
COLOR5="#000000"
COLOR6="#FFFFFF"

#source $(dirname $0)/panel_config
# source /home/scarecrow/.config/bspwm/panel_config

while read -r line ; do
    case $line in
        # conky
        S*)
            sys_infos="${line#?}"
            ;;
#        T*)
#            if [[ ${line#?} == "" ]]; then
#                title="%{F$COLOR1}$(printf "%b" "\ue0a1")%{F-} $(uname -r)"
#            else title="%{F$COLOR1}$(printf "%b" "\ue135")%{F-} %{A:bspc window -t floating: A3:bspc desktop -R 90:}$(echo ${line#?} | sed 's^\(.\{40\}\).*^\1...^')%{A A-}"
#            fi
#            ;;
        W*)
            wm_infos=""
            IFS=$FIELDIFS
            set -- ${line#?}
            while [ $# -gt 0 ] ; do
                item=$1
                case $item in
                    [OoFfUu]*)
                        name=${item#?}
                        case $item in
                            O*)
                                # focused occupied desktop
                                desk="%{F$COLOR6 B$COLOR3} $name %{B- F-}"
                                ;;
                            F*)
                                # focused free desktop
                                desk="%{F$COLOR6 B$COLOR3} $name %{B- F-}"
                                ;;
                            U*)
                                # focused urgent desktop
                                desk="%{F$COLOR6 B$COLOR4} $name %{B- F-}"
                                ;;
                            o*)
                                # occupied desktop
                                desk="%{F$COLOR3 B$COLOR2} $name %{B- F-}"
                                ;;
                            f*)
                                # free desktop
                                desk="%{F$COLOR1} $name %{F-}"
                                ;;
                            u*)
                                # urgent desktop
                                desk="%{F$COLOR4} $name %{F-}"
                                ;;
                        esac
                        wm_infos="${wm_infos}%{A:bspc desktop -f ${name}:}${desk}%{A}"
                        ;;
                esac
                shift
            done
            IFS=$NORMIFS
            ;;
    esac
    printf "%s\n" "%{l}$wm_infos %{c}$sys_infos"
done

panel -
Code: [Select]
#! /bin/sh

# source $(dirname $0)/panel_config

bspc config top_padding $PANEL_HEIGHT
bspc config left_padding 0
bspc config right_padding 0
bspc config bottom_padding 0

PANEL_FIFO=~/.config/bspwm/fifo_

if [ $(pgrep -cx panel) -gt 1 ] ; then
    printf "%s\n" "The panel is already running." >&2
    exit 1
fi

trap 'trap - TERM; kill 0' INT TERM QUIT EXIT

# Set X offset of the bar
CUR_X_OFFSET=0

# How many monitors are we displaying bar on?
num_mon=$(bspc query -M)

for i in $num_mon; do

    # Remove old panel_fifo and create a new one
    [ -e "$PANEL_FIFO" ] && rm "$PANEL_FIFO"
    mkfifo "$PANEL_FIFO"

    # xtitle -sf 'T%s' > "$PANEL_FIFO$i" &

    # Get bspwm information for current monitor
    bspc control --subscribe |\
        grep -oE "[Mm]$i[^TM]*[TML]" --line-buffered |\
        while read line; do echo W$line; done \
            > "$PANEL_FIFO" &

    # Output extra scripts to the panel_fifo
    # ~/bin/SysBar > "$PANEL_FIFO$i" &
    conky -c ~/.conkybar > "$PANEL_FIFO" &
   
    # Get current monitor width
    COLOR1="#C4C4C4"
    COLOR2="#242424"
    TEST_WIDTH=100
    PFONT=-*-terminus-medium-r-normal-*-12-120-*-*-*-*-iso8859-1
    CUR_MON_WIDTH=$(bspc query -T -m $i | grep -oE "[0-9]{2,6}" | head -n 1)
    PANEL_GEO="${CUR_MON_WIDTH}x${PANEL_HEIGHT}+${CUR_X_OFFSET}+0"

    # cat "$PANEL_FIFO" | ~/.config/bspwm/panel_lemon |\
    # Running bar
    ~/.config/bspwm/panel_lemon < "$PANEL_FIFO" \
        | lemonbar -g $PANEL_GEO \
          -F "$COLOR1" -B "$COLOR2" -f "$PFONT" \
        | while read line; do eval "$line"; done &

    # New X Offset
    CUR_X_OFFSET=$(expr $CUR_X_OFFSET + $CUR_MON_WIDTH)

done

wait

.conkybar  -- note tha S\ at the beginning of the conky objects; took me a long time to spot that bit of code which allows conky to get piped to the bar.
Code: [Select]
conky.config = {
background = false,
update_interval = 1,
cpu_avg_samples = 1,
total_run_times = 0,
override_utf8_locale = true,
short_units = true,
pad_percents = 2,
uppercase = true,
out_to_console = true,
out_to_x = false,

};

conky.text = [[
S\
   %{F\#DAC79C}Uptime: ${uptime_short}  \
   Core0: ${if_match ${hwmon 1 temp 2}<=50}%{F\#17E617}${else}${if_match ${hwmon 1 temp 2}<=70}%{F\#FFFF00}${else}${if_match ${hwmon 1 temp 2}>70}%{F\#FF0000}${endif}${endif}${endif}${hwmon 1 temp 2} °C %{F\#DAC79C}  \
   Core1: ${if_match ${hwmon 1 temp 4}<=50}%{F\#17E617}${else}${if_match ${hwmon 1 temp 4}<=70}%{F\#FFFF00}${else}${if_match ${hwmon 1 temp 4}>70}%{F\#FF0000}${endif}${endif}${endif}${hwmon 1 temp 4} °C %{F\#DAC79C}  \
   CPU: ${if_match ${cpu}<=15}%{F\#17E617}${else}${if_match ${cpu}<=70}%{F\#FFFF00}${else}${if_match ${cpu}>70}%{F\#FF0000}${endif}${endif}${endif}${cpu cpu0}% %{F\#DAC79C} ${loadavg}  \
   Mem: ${if_match ${memperc}<=15}%{F\#17E617}${else}${if_match ${memperc}<=70}%{F\#FFFF00}${else}${if_match ${memperc}>70}%{F\#FF0000}${endif}${endif}${endif}${memperc}% %{F\#DAC79C}  \
   Battery: ${execpi 60 acpi -b | awk '{print $3}' | cut -c1-4}  ${if_match ${battery_percent BAT0}<=15}%{F\#FF0000}${blink ${battery_percent BAT0}%}${else}${if_match ${battery_percent BAT0}<=50}%{F\#FFFF00}${battery_percent BAT0}%${else}${if_match ${battery_percent BAT0}>50}%{F\#17E617}${battery_percent BAT0}%${endif}${endif}${endif}%{F\#DAC79C}  \
   Net: ${if_up wlo1} ${wireless_link_qual_perc wlo1}%  ${upspeedf wlo1}  ${downspeedf wlo1}${endif}  \
   %{A3:gsimplecal:}${time %a, %e %b %k:%M}%{A3}
]];

startup script:

Code: [Select]
#!/bin/sh

xrdb -l "$HOME/.Xresources" &
xmodmap "$HOME/.Xmodmap" &
urxvtd -q -o -f &
xsetroot -solid "#323233" &
togglekpad &

PANEL_FIFO=/tmp/panel-fifo
PANEL_HEIGHT=22
PANEL_FONT_FAMILY="-*-terminus-medium-r-normal-*-12-120-*-*-c-*-iso8859-1"
PANEL_WM_NAME=BSPWM_PANEL
export PANEL_FIFO PANEL_HEIGHT PANEL_FONT_FAMILY PANEL_WM_NAME

sxhkd &
exec bspwm

Still a smooth window manager, light on resources. Definitely worth a look if you're wanting to try a new window manager.
I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo

Katherine

  • sbobet
  • Posts: 2
    • View Profile
Re: bspwm window manager
« Reply #4 on: January 19, 2017, 12:56:34 PM »
A forum about the music still exists either.

VastOne

  •      v-ger
  • Posts: 3894
    • View Profile
    • VSIDO Community
Re: bspwm window manager
« Reply #5 on: January 19, 2017, 11:44:22 PM »
I have a 12 hour Over/Under that the latest forum member will last that long

any takers?
VSIDO      VSIDO Twitter     VSIDO FB     VSIDO Google+   

I dev VSIDO

jedi

  • DEFCON 1
  • Posts: 1499
  • Not all those who wander are lost.
    • View Profile
    • NixNut.com
Re: bspwm window manager
« Reply #6 on: January 20, 2017, 01:00:30 AM »
less
Forum Netiquette

"No matter how smart you are you can never convince someone stupid that they are stupid."  Anonymous

dizzie

  • DEFCON 1
  • Posts: 729
  • Bastard Operator From Hell
    • View Profile
Re: bspwm window manager
« Reply #7 on: January 20, 2017, 01:54:50 AM »
Reclaim your culture, it's within your reach!

My Blog | Facebook | Twitter | G+ | VSIDO |