You are not logged in.

#1451 2014-10-31 16:08:39

bloom
Member
Registered: 2010-08-18
Posts: 749
Website

Re: bspwm — A tiling window manager based on binary space partitioning

Here's the fix:

DARK="#FF1F1F1F"
LIGHT="#FFC0B18B"

gh · da · ds

Offline

#1452 2014-10-31 21:47:13

_glitchware
Member
Registered: 2014-01-29
Posts: 29

Re: bspwm — A tiling window manager based on binary space partitioning

#edit: image -- http://i.imgur.com/DSKLPKS.jpg

My workspaces do not show up on my bar. Instead, where they should be is a small rectangle that's slightly lighter than the background. What causes this?

#! /bin/sh

. /home/rlee/scripts/panel_colors-bar

DARK="#FF1F1F1F"
LIGHT="#FFC0B18B"

workspace() {
    SPACE_NUM=$(bspc query -D -d);
        case "$SPACE_NUM" in
            "1")
                WORKSPACE="_--";;
            "2")
                WORKSPACE="-_-";;
            "3")
                WORKSPACE="--_";;
        esac
    echo -n $WORKSPACE
}

ram(){
	echo -n  $(free -m | awk '/-/ {print $3}')
}

dat(){
	echo -n  $(date "+%H:%M")
}

mus(){
	echo -n  $(test -z "$(mpc current)" || mpc current -f %title%)
	#echo -n $(ps aux | grep -v "grep" | if grep -q "cmus"; then echo $(cmus-remote -Q | sed -n 's/tag title //p'); else echo "n/a"; fi)
}

while :; do
    printf "%s\n" "%{B$DARK}%{F$WHITE} $(mus) %{c}$(workspace)%{c} %{r} $(dat) %{r}%{B-}%{F-}"
sleep 1
done

Last edited by _glitchware (2014-10-31 21:49:51)

Offline

#1453 2014-11-01 04:20:49

ttz
Member
From: My Box
Registered: 2013-08-01
Posts: 56

Re: bspwm — A tiling window manager based on binary space partitioning

_glitchware wrote:

#edit: image -- http://i.imgur.com/DSKLPKS.jpg

My workspaces do not show up on my bar. Instead, where they should be is a small rectangle that's slightly lighter than the background. What causes this?

while :; do
    printf "%s\n" "%{B$DARK}%{F$WHITE} $(mus) %{c}$(workspace)%{c} %{r} $(dat) %{r}%{B-}%{F-}"
sleep 1
done

You have not defined "$WHITE".


Character shines in the great moments, but is polished in the little ones.

Offline

#1454 2014-11-01 11:55:51

_glitchware
Member
Registered: 2014-01-29
Posts: 29

Re: bspwm — A tiling window manager based on binary space partitioning

ttz wrote:

You have not defined "$WHITE".

I changed it to $LIGHT (defined as #FFE8E9CA) and it still does not work.

Offline

#1455 2014-11-01 12:34:12

o_caino
Member
Registered: 2013-06-06
Posts: 166

Re: bspwm — A tiling window manager based on binary space partitioning

printf "%s\n" "%{B$DARK}%{F$LIGHT} $(mus) %{c}$(workspace)%{r}$(dat) %{B-}%{F-}"

Last edited by o_caino (2014-11-01 12:34:40)

Offline

#1456 2014-11-06 20:07:40

sdothum
Member
Registered: 2013-04-26
Posts: 14

Re: bspwm — A tiling window manager based on binary space partitioning

I know this thread is mainly focused on solving bspwm problems but I saw this xmonad layout on unixporn and liked the dynamic window_gap handling -- tightening up the window_gap as the number of windows on a desktop increase. So I  created a script and called it at the end of my bspwmrc..

bspc control --subscribe | while read line; do
  W=$(bspc query --desktop focused --windows | wc -l)
  G=$(echo "71 - ($W - 1) * 10" | bc)
  [[ $G -lt 1 ]] && G=1
  bspc config --desktop focused window_gap $G
done

Not sure if there is a better hook for trapping window actions to the desktop.. but it works. My initial window_gap of 71, changing by 10 shows a 1 pixel window_gap with 7 or more windows -- just what I arbitrarily have it set up for on my 30" monitor at the moment.

bspwm continues to rock! (Care to share your own bspwm gymnastics?)

Offline

#1457 2014-11-07 04:25:36

Stebalien
Member
Registered: 2010-04-27
Posts: 1,237
Website

Re: bspwm — A tiling window manager based on binary space partitioning

sdothum wrote:

I know this thread is mainly focused on solving bspwm problems but I saw this xmonad layout on unixporn and liked the dynamic window_gap handling -- tightening up the window_gap as the number of windows on a desktop increase. So I  created a script and called it at the end of my bspwmrc..

bspc control --subscribe | while read line; do
  W=$(bspc query --desktop focused --windows | wc -l)
  G=$(echo "71 - ($W - 1) * 10" | bc)
  [[ $G -lt 1 ]] && G=1
  bspc config --desktop focused window_gap $G
done

Not sure if there is a better hook for trapping window actions to the desktop.. but it works. My initial window_gap of 71, changing by 10 shows a 1 pixel window_gap with 7 or more windows -- just what I arbitrarily have it set up for on my 30" monitor at the moment.

bspwm continues to rock! (Care to share your own bspwm gymnastics?)

As far as I know, that's the best way to do this. You could also make a feature request for a more powerful subscribe command that spits out (filterable?) events like:

unmap <monitor> <desktop> <window>
map <monitor> <desktop> <window>
focus <monitor> <desktop> <window>
resize <monitor> <desktop> <window> ? (noisy)
swap <monitor> <desktop> <window> | <monitor> <desktop> <window>
rename <desktop> <desktop_new>
.....


Steven [ web : git ]
GPG:  327B 20CE 21EA 68CF A7748675 7C92 3221 5899 410C
Do not email: honeypot@stebalien.com

Offline

#1458 2014-11-11 03:16:07

3xOSC
Member
Registered: 2013-03-18
Posts: 107

Re: bspwm — A tiling window manager based on binary space partitioning

so i figured out how external rules work (mostly).
debugged it by using notify-sends  (lol) and discovered the $wid, and $class and $instance are passed as per what the document says.  Which is all fine and dandy, and xtitle allows me xtitle allows me to pin point "if it is actually my program-name" being started up, so that it can apply an external rule to it.

I need something that allows me to pin point "if it is actually my program-name" && "it is on desktop=^2".  So I poked around with xprop and xwininfo and these two tools show me which cardinal desktop it is.  However, I am kinda hooped as to how to get my external_rules script to discover the desktop number.

With $wid, and $class and $instance, it seems that I can't seem to pass these into xprop, and xwininfo - as these requires the user to select using a mouse.

I tried using 'xprop -id $wid' but that didn't give me the cardinal desktop number.
Any help on how to detect and grab the desktop number of the application launched would be appreciated.

Last edited by 3xOSC (2014-11-11 03:33:04)

Offline

#1459 2014-11-11 08:38:28

J.
Member
Registered: 2011-01-31
Posts: 57

Re: bspwm — A tiling window manager based on binary space partitioning

bspc query -D -w "$wid"

Offline

#1460 2014-11-11 11:16:43

3xOSC
Member
Registered: 2013-03-18
Posts: 107

Re: bspwm — A tiling window manager based on binary space partitioning

J. wrote:

bspc query -D -w "$wid"

hmm, for some reason, i can run this in the command line as is. and it is fine, the desktop gets return as a roman numeral:

http://i.imgur.com/pAdBUhV.png
however, it doesn't work in the script:
http://ix.io/f8B

I am able to see the $wid getting written to the file 'sup'

However, 'thing' as a variable is never ever assigned.

Last edited by 3xOSC (2014-11-11 11:23:08)

Offline

#1461 2014-11-11 11:30:18

o_caino
Member
Registered: 2013-06-06
Posts: 166

Re: bspwm — A tiling window manager based on binary space partitioning

3xOSC wrote:

the desktop gets return as a roman numeral:

It returns whatever name you call the desktop.

Offline

#1462 2014-11-11 11:48:42

3xOSC
Member
Registered: 2013-03-18
Posts: 107

Re: bspwm — A tiling window manager based on binary space partitioning

o_caino wrote:
3xOSC wrote:

the desktop gets return as a roman numeral:

It returns whatever name you call the desktop.

yeah, i can see that from the terminal, and only when i call that command from the terminal

however, in a shell script such as the one i posted, the variable never got assigned the roman numeral that i saw when i did it from the terminal

Offline

#1463 2014-11-11 12:13:14

bloom
Member
Registered: 2010-08-18
Posts: 749
Website

Re: bspwm — A tiling window manager based on binary space partitioning

J. wrote:

bspc query -D -w "$wid"

This won't work inside external_rules_command, because the window isn't managed yet.


gh · da · ds

Offline

#1464 2014-11-11 14:21:18

3xOSC
Member
Registered: 2013-03-18
Posts: 107

Re: bspwm — A tiling window manager based on binary space partitioning

bloom wrote:
J. wrote:

bspc query -D -w "$wid"

This won't work inside external_rules_command, because the window isn't managed yet.


hmm, i thought it would be since the window was just started.

is there an alternative way that i can find a desktop number then?

Offline

#1465 2014-11-11 19:13:26

J.
Member
Registered: 2011-01-31
Posts: 57

Re: bspwm — A tiling window manager based on binary space partitioning

Oh, yeah, of course.  Your external_rules_command is supposed to define the desktop for the window, not query for it.  The default is to map to the current desktop, so I guess you want 'bspc query -D -d focused'?

Offline

#1466 2014-11-11 21:25:58

3xOSC
Member
Registered: 2013-03-18
Posts: 107

Re: bspwm — A tiling window manager based on binary space partitioning

So the external rules command is to assign the window to a desktop?

I understand that yeah, the default is to map to the current desktop.  But what I want to do is to be able to have externals_rule_command detect "if termite is started in desktop 2, make it floating".
I start terminals in desktop 1 and 3 as well as 2.  And I would like those tiled. 

Is this even do-able?

Update/EDIT:
omfg, I just used that command you gave me, J.
That's exactly what i wanted/looking for.

Thank you so fucking much.!

ps:  my next question is:   reading the docs of bspc, I can't seem to find a key/value pair that allows me to assign the x/y position of a window that started up.  Does such thing exist?

Last edited by 3xOSC (2014-11-11 21:57:29)

Offline

#1467 2014-11-22 23:33:53

tb01110100
Member
From: Hoosierland
Registered: 2012-12-25
Posts: 42

Re: bspwm — A tiling window manager based on binary space partitioning

I'm completely stumped on this one. Bspwm refuses to create its socket on startup (which obviously messes up a lot of other things) on my laptop only, no problem on my desktop. It still happened even after I completely re-installed Arch. Another interesting thing is, though, it has no trouble starting up when I'm running it from my arch usb stick. Any ideas?

Last edited by tb01110100 (2014-11-22 23:39:39)

Offline

#1468 2014-11-26 01:33:06

damicore
Member
Registered: 2009-12-21
Posts: 19

Re: bspwm — A tiling window manager based on binary space partitioning

I cant get bar to display anything.
I don't know what is going on, if i pkill panel and run panel once bspwm is running i get a black bar on top of my windows that has no text whatsoever.
I'm using the example panel script from the github.
My .xinitrc:

#!/bin/sh
#
# ~/.xinitrc
#
# Executed by startx (run your window manager from here)

if [ -d /etc/X11/xinit/xinitrc.d ]; then
  for f in /etc/X11/xinit/xinitrc.d/*; do
    [ -x "$f" ] && . "$f"
  done
  unset f
fi

export PANEL_FIFO=/tmp/panel-fifo
setxkbmap latam &
sxhkd -c /home/damian/.config/sxhkd/sxhkdrc &
#xrdb -merge ~/.Xresources &
#panel &
exec bspwm
#exec herbstluftwm
#exec i3
#exec awesome
# exec gnome-session
# exec startkde
# exec startxfce4
# ...or the Window Manager of your choice

My bspwmrc:

#! /bin/sh

bspc config border_width        2
bspc config window_gap          5 5

bspc config split_ratio         0.52
bspc config borderless_monocle  true
bspc config gapless_monocle     true
bspc config focus_by_distance   true

bspc monitor -d I II III IV V VI VII VIII IX X

bspc rule -a Gimp desktop=^8 follow=on floating=on
bspc rule -a Chromium desktop=^2
bspc rule -a mplayer2 floating=on
bspc rule -a Kupfer.py focus=on
bspc rule -a Screenkey manage=off

panel &

all my 3 panel scripts are in ~/bin/ which is correctly imported to my path and "echo $PANEL_FIFO" returns "/tmp/panel-fifo" as expected. When I do startx and try launching the panel it says the panel is already running which makes me think that the panel is running but there is no reserved space for it by bspwm and because it is completely black it camuflates with my default black bg.
I have really really tried but there's no luck.

Offline

#1469 2014-11-26 07:59:06

easysid
Member
From: India
Registered: 2013-01-01
Posts: 256

Re: bspwm — A tiling window manager based on binary space partitioning

damicore wrote:

I cant get bar to display anything ...

Quick questions:
1) Is your bar updated?
2) Does

 $ echo "Hello World" | bar -p 

display a bar?
3) Try commenting out panel from bspwmrc and launch it separately in a terminal. Look for the messages.

Last edited by easysid (2014-11-26 07:59:36)

Offline

#1470 2014-11-26 09:44:16

o_caino
Member
Registered: 2013-06-06
Posts: 166

Re: bspwm — A tiling window manager based on binary space partitioning

damicore wrote:

I'm using the example panel script from the github.

Did you install the dependencies?

Offline

#1471 2014-11-26 15:35:27

damicore
Member
Registered: 2009-12-21
Posts: 19

Re: bspwm — A tiling window manager based on binary space partitioning

easysid wrote:
damicore wrote:

I cant get bar to display anything ...

Quick questions:
1) Is your bar updated?
2) Does

 $ echo "Hello World" | bar -p 

display a bar?
3) Try commenting out panel from bspwmrc and launch it separately in a terminal. Look for the messages.

1)Bar is up to date I think. Installed it from AUR yesterday.
2)it does indeed display a black bar with a white "hellow world!" text on it.
3)I did this, this is what brings up a black bar with no text on it.

Did you install the dependencies?

are they xtitle, sutils and bar? THey're all freshly installed.

If I do cat /tmp/panel_fifo whilst i run panel it prints the time, and windows titles as I change desktops:

SWed 12:41 
TEdit post / Arch Linux Forum

So panel script seems to be working but there is something wrong in panel_bar?

Panel script is here:

#! /bin/sh

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

flavor=${1:-bar}

[ -e "$PANEL_FIFO" ] && rm "$PANEL_FIFO"
mkfifo "$PANEL_FIFO"

bspc config top_padding $PANEL_HEIGHT

bspc control --subscribe > "$PANEL_FIFO" &
xtitle -sf 'T%s' > "$PANEL_FIFO" &
clock -sf 'S%a %H:%M' > "$PANEL_FIFO" &

. panel_colors

case "$flavor" in
	bar)
		FONT_FAMILY='-*-terminus-medium-r-normal-*-12-*-*-*-c-*-*-1'
		cat "$PANEL_FIFO" | panel_bar | bar -g x$PANEL_HEIGHT -f "$FONT_FAMILY" -F "$COLOR_FOREGROUND" -B "$COLOR_BACKGROUND" &
		;;
	dzen2)
		FONT_FAMILY='DejaVu Sans'
		FONT_SIZE=11
		cat "$PANEL_FIFO" | panel_dzen2 -f "$FONT_FAMILY" -s "$FONT_SIZE" | dzen2 -h $PANEL_HEIGHT -dock -ta l -title-name panel -fn "${FONT_FAMILY}:pixelsize=${FONT_SIZE}" -fg "$COLOR_FOREGROUND" -bg "$COLOR_BACKGROUND" &
		;;
esac

wait

panel_bar:

#! /bin/sh
#
# Example panel for LemonBoy's bar

. panel_colors

while read -r line ; do
    case $line in
        S*)
            # clock output
            sys_infos="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG}${line#?}"
            ;;
        T*)
            # xtitle output
            title="%{F$COLOR_TITLE_FG}%{B$COLOR_TITLE_BG}${line#?}"
            ;;
        W*)
            # bspwm internal state
            wm_infos=""
            IFS=':'
            set -- ${line#?}
            while [ $# -gt 0 ] ; do
                item=$1
                name=${item#?}
                case $item in
                    O*)
                        # focused occupied desktop
                        wm_infos="$wm_infos %{F$COLOR_FOCUSED_OCCUPIED_FG}%{B$COLOR_FOCUSED_OCCUPIED_BG}%{U$COLOR_FOREGROUND}%{+u}${name}%{-u}"
                        ;;
                    F*)
                        # focused free desktop
                        wm_infos="$wm_infos %{F$COLOR_FOCUSED_FREE_FG}%{B$COLOR_FOCUSED_FREE_BG}%{U$COLOR_FOREGROUND}%{+u}${name}%{-u}"
                        ;;
                    U*)
                        # focused urgent desktop
                        wm_infos="$wm_infos %{F$COLOR_FOCUSED_URGENT_FG}%{B$COLOR_FOCUSED_URGENT_BG}%{U$COLOR_FOREGROUND}%{+u}${name}%{-u}"
                        ;;
                    o*)
                        # occupied desktop
                        wm_infos="$wm_infos %{F$COLOR_OCCUPIED_FG}%{B$COLOR_OCCUPIED_BG}${name}"
                        ;;
                    f*)
                        # free desktop
                        wm_infos="$wm_infos %{F$COLOR_FREE_FG}%{B$COLOR_FREE_BG}${name}"
                        ;;
                    u*)
                        # urgent desktop
                        wm_infos="$wm_infos %{F$COLOR_URGENT_FG}%{B$COLOR_URGENT_BG}${name}"
                        ;;
                    L*)
                        # layout
                        layout=$(printf "%s" "${name}" | sed 's/\(.\).*/\U\1/')
                        wm_infos="$wm_infos    %{F$COLOR_LAYOUT_FG}%{B$COLOR_LAYOUT_BG}$layout"
                        ;;
                esac
                shift
            done
            ;;
    esac
    printf "%s\n" "%{l} $wm_infos %{c} $title %{r} $sys_infos  "
done

and panel_colors

COLOR_FOREGROUND='#A3A6AB'
COLOR_BACKGROUND='#34322E'
COLOR_FOCUSED_OCCUPIED_FG='#F6F9FF'
COLOR_FOCUSED_OCCUPIED_BG='#5C5955'
COLOR_FOCUSED_FREE_FG='#F6F9FF'
COLOR_FOCUSED_FREE_BG='#6D561C'
COLOR_FOCUSED_URGENT_FG='#34322E'
COLOR_FOCUSED_URGENT_BG='#F9A299'
COLOR_OCCUPIED_FG='#A3A6AB'
COLOR_OCCUPIED_BG='#34322E'
COLOR_FREE_FG='#6F7277'
COLOR_FREE_BG='#34322E'
COLOR_URGENT_FG='#F9A299'
COLOR_URGENT_BG='#34322E'
COLOR_LAYOUT_FG='#A3A6AB'
COLOR_LAYOUT_BG='#34322E'
COLOR_TITLE_FG='#A3A6AB'
COLOR_TITLE_BG='#34322E'
COLOR_STATUS_FG='#A3A6AB'
COLOR_STATUS_BG='#34322E'

all three of them are chmod+x'd

edit: nevermind, I used the scripts from the bspwm github instead of the ones in the bspwm aur package and it worked wonders except my windows overlap my panel now.
Should I install bspwm from the git instead of the AUR package? I dislike the idea of not having it on my pacman database.

Last edited by damicore (2014-11-26 16:20:13)

Offline

#1472 2014-11-26 20:07:33

rikn00
Member
Registered: 2014-06-26
Posts: 21

Re: bspwm — A tiling window manager based on binary space partitioning

damicore wrote:

nevermind, I used the scripts from the bspwm github instead of the ones in the bspwm aur package and it worked wonders except my windows overlap my panel now.
Should I install bspwm from the git instead of the AUR package? I dislike the idea of not having it on my pacman database.

I don't know about bspwm but maybe bspwm-git is the thing you want. It's in aur too.

Offline

#1473 2014-11-27 11:46:53

wesbluemarine
Member
Registered: 2009-11-25
Posts: 2

Re: bspwm — A tiling window manager based on binary space partitioning

I've very slow resize windows with bspwm and i don't use compton.
I' ve tried with sxhkd -f 100" in .xinitrc and putting in /etc/modprobe.d/modprobe.conf  "options usbhid mousepoll=2"  but it's the same...
Can you help me? Thanks!

EDIT

When i set sxhkd -f 50 everything is smooth. I don't know why but it works!

Last edited by wesbluemarine (2014-11-30 04:13:54)

Offline

#1474 2014-11-28 07:22:02

easysid
Member
From: India
Registered: 2013-01-01
Posts: 256

Re: bspwm — A tiling window manager based on binary space partitioning

damicore wrote:

nevermind, I used the scripts from the bspwm github instead of the ones in the bspwm aur package and it worked wonders except my windows overlap my panel now.
Should I install bspwm from the git instead of the AUR package? I dislike the idea of not having it on my pacman database.

see bspc config top_padding in bspwmrc to adjust the window gap on the panel.
You can try bspwm-git from aur. It will keep you updated to git and show up in pacman.

Offline

#1475 2014-11-28 14:20:54

damicore
Member
Registered: 2009-12-21
Posts: 19

Re: bspwm — A tiling window manager based on binary space partitioning

easysid wrote:
damicore wrote:

nevermind, I used the scripts from the bspwm github instead of the ones in the bspwm aur package and it worked wonders except my windows overlap my panel now.
Should I install bspwm from the git instead of the AUR package? I dislike the idea of not having it on my pacman database.

see bspc config top_padding in bspwmrc to adjust the window gap on the panel.
You can try bspwm-git from aur. It will keep you updated to git and show up in pacman.

All set and working, been playing with it a bit, thanks!
I'll replace my actual bspwm with the git aur package.

Offline

Board footer

Powered by FluxBB