Bspwm: Is it possible to create a startup workspace?

Created on 11 Jan 2016  路  9Comments  路  Source: baskerville/bspwm

Hello,

I was wondering if it was possible to launch some applications at startup and define where they will spawn. So that you get the same layout every time you boot.

Hope this is possbile!

Thanks in advance.

Most helpful comment

See examples/receptacles.

All 9 comments

Not yet.

This is a duplicate of #259.

It is!
Though it _may_ be possible to use exported world states and JSON trees, a simple script with one-shot rules will suffice.

#!/bin/sh
bspc desktop -f ^1
urxvtc &
sleep 0.05

#bash session persists after lynx closes
bspc rule -a URxvt -o split_dir="east" split_ratio="0.5" && urxvtc -g 53x8 -e /bin/bash -c "lynx && /bin/bash" &
sleep 0.05

bspc rule -a URxvt -o split_dir="north" split_ratio="0.489" locked=on  && urxvtc -e toxic &
sleep 0.05

bspc node -f west
bspc rule -a URxvt -o split_dir="south" split_ratio="0.858" state=pseudo_tiled && urxvtc -g 53x8 -e tty-clock -bscC3 &
sleep 0.05

#bspc desktop -f ^2
bspc rule -a Firefox -o desktop=^2 state=floating && firefox &

There are a few drawbacks to this method

  • the desktop you are trying to create a specific tiling tree on will more than likely need to be focused
  • sleep commands are required; delay value may need to vary
  • a sleep system can screw with application placement if it's the application's first start

    • not sure how to get around this. Higher sleep values or using your init system to exec script when bspwm starts may help.

    • running the script in a loop that checks how many windows are open might work as an alternative to sleep

You may also need to customize split_ratio to account for your particular resolution, window gap, border width, and padding.

Fixed by e8aa679.

could you explain how this actually makes startup workspaces possible?

An example is given in the commit message.

@baskerville can you explain a bit the commit message? I'm sorry but I don't think I understood it completely.

I agree, some explanation would be nice.

Apologies for being a noob, but how do I attach a new process to one of these receptacles?

See examples/receptacles.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lukasino1214 picture lukasino1214  路  4Comments

nebulaw2081d picture nebulaw2081d  路  4Comments

notmgsk picture notmgsk  路  6Comments

JKomoroski picture JKomoroski  路  5Comments

kristoferus75 picture kristoferus75  路  4Comments