bspc query -T --monitor
gives you a JSON tree with all the informations you need, you can pipe it to "jq" and play with it : the tree contains an array called desktops where active desktops have the key focusedNodeId set to the id of the focused node (inactive ones have it is set to 0).
jq '.desktops | .[] | select(.focusedNodeId != 0) | .name'
first select the desktops array with .desktops
then you pipe it to an empty .[] to treat the value as an array,
filter it out with select(.focusedNodeId != 0)
and in the end select only the name fields with .name
this is what it looks like in the end :
bspc query -T --monitor | jq '.desktops | .[] | select(.focusedNodeId != 0) | .name'
you can then pipe the_query to notify-send with
the_query | while read X; do notify-send $X;done;
which yield a separate notification per desktop or
notify-send "$(the_query)"
or (probably more interesing)
the_query | dmenu
#!/bin/sh
xdo show -d
LAYOUT=$(bspc query -T -d | jq -r .layout)
if [[ $LAYOUT = monocle ]]
then
bspc node -f $1.local
xdo hide -dr
else
bspc node -f $1.local
fi
works fine, the problem is that the window at the beginning of the cycling is never shown afterwards, and selecting previous node doesn't work neither... can anyone help with finding the problem ?
edit : added the seletor hidden here
bspc node -f $1.local.hidden
and the first window now shows.
The problem with the direction persists. I guess it's because of how windows are rearranged when showing then hiding with xdo...
I am having a problem with some floating windows (like pop up messages) not staying on top. The problem affects Tilda as well.
I noticed this very recently as well.
]]>I can't set the border width smaller than 1 right ? I would like something like 0.5.
Unless you have a HiDPI screen (and have applied a pixel scaling factor such that 1 virtual pixel = X physical pixels), that's physically impossible (modulo subpixel rendering on LCDs but that's definitely not what you want). If you are using a HiDPI screen, I recommend you switch to a wayland tiling window manager (e.g., sway) as Xorg has poor HiDPI support.
]]>I created a small program, that can be used to easily use bspwm with lemonbar, check it out:
https://github.com/fabledpig/bspwmtobar
Any feedback is appreciated!
For anyone else having this problem: It is caused by sxhkd running every command with the fish shell, which is very slow.
Setting SXHKD_SHELL to /usr/bin/sh fixes this.
I added an entry to the bspwm wiki called Playing nicely with fish shell in case anyone else runs into this problem.
]]>This works for me.
# expand a window by moving one of its side outward
super + alt + {h,j,k,l}
bspc node @{west -r -10,south -r +10,north -r -10,east -r +10}
# contract a window by moving one of its side inward
super + alt + shift + {h,j,k,l}
bspc node @{east -r -10,north -r +10,south -r -10,west -r +10}
# expand a window by moving one of its side outward
super + alt + {h,j,k,l}
bspc node -z {left -20 0,bottom 0 20,top 0 -20,right 20 0}
# contract a window by moving one of its side inward
super + alt + shift + {h,j,k,l}
bspc node -z {right -20 0,top 0 20,bottom 0 -20,left 20 0}
However, these commands do not do anything. I've run them on the terminal and get an "Invalid syntax" error.
For reference, this is what the commands looked like before the latest update (these worked fine):
super + alt + {h,j,k,l}
bspc window -e {left -10,down +10,up -10,right +10}
super + alt + shift + {h,j,k,l}
bspc window -e {right -10,up +10,down -10,left +10}
I also tried running these commands in the terminal, replacing window with node. This, too, did not work. The last thing I tried was reading Message Translation Guide at https://github.com/baskerville/bspwm/bl … ANGELOG.md and changed window -e DIR RATIO appropriately, still with no luck.
Does anyone know what is going wrong?
]]>Just what I was looking for, thanks easysid!!!
This was kinda essential for my workflow and I was beginning to miss it, but for now at least, I am content
Also maybe of note, setting a window to sticky causes it to be 'dragged along' when you switch desktops, which is kinda the reverse to what I was after, but now we have both
Glad that I could help
A little modification to the script would allow same mark to be set for multiple windows, enabling them to be dragged together as a group.
I am not sure that using a file is the best way of implementing this, but I don't see how to communicate the tag information to bspwm. Maybe someone will point out an improvement.
]]>I'm once again trying out bspwm and I was wondering if there is a way to do 'dwm-style'-tagging with bspwm?
More specifically the behaviour I'm after is the 'pulling' a tagged windows into view.
For instance I have 10 desktops in bspwm, and whilst I can switch between them and send/push windows to other desktops,
I would also like to be able to pull from other desktops, say pull in that xterm running on '1' whilst not having to leave my current desktop '5'.
I am not aware of dwm style tags, but you can 'mark' your windows individually, and pull them to current desktop, without leaving it. You can store a window id with the mark/tag and use it to pull the window later.
#!/bin/bash
# tagfetch.sh
# script to tag and fetch windows
[[ $# -ne 2 ]] && exit 101
# create a directory for storing id info
tagdir="/tmp/tagdir"
[[ -d $tagdir ]] || mkdir "$tagdir"
# use 1 file per tag
tagfile="$tagdir/$2"
case $1 in
tag)
echo -n $(bspc query -N -n) > "$tagfile"
;;
fetch)
[[ -f $tagfile ]] && bspc node $(< $tagfile) -d $(bspc query -D -d)
;;
esac
You can then bind it to sxhkd to mark, and fetch windows, like so
# tag
super + ctrl + {1-9}
tagfetch.sh tag {1-9}
#fetch
super + shift + {1-9}
tagfetch.sh fetch {1-9}
Edit1: Removed xdotool in favour of bspc query.
Edit2: Streamlined the script