Closed agloo closed 8 years ago
Cool. What mechanism does it use to figure out what workspace to put the current window in? A window doesn't get automatically added to a workspace, does it?
It actually doesn't add any WIDs to any workspaces when a window is created, no. I did this because in testing it seemed like a lot of WIDs were being thrown up that didn't correspond to actual windows I cared about and they were lingering around. Instead, I decided to just save whatever windows are currently mapped (using lsw) to a workspace's list of windows whenever I switch workspaces. In other words, window is put in a workspace implicitly by being mapped to display while /tmp/workspaces/curr contains that workspace's ID. This is nice, since I don't have to worry about regexing over all $NUM_WS workspace files whenever I delete a window. It does introduce the possibility that we drop some windows on switches, but in testing I've found that barring 100-calls/second spamming that isn't really an issue.
agloo wrote:
Made a script to handle a workspace idiom by mapping lists of focused windows to files in /tmp/workspaces. You can view, comment on, or merge this pull request online at:
https://github.com/wmutils/contrib/pull/31
-- Commit Summary --
- add: workspace.sh
-- File Changes --
A workspace.sh (100)
-- Patch Links --
https://github.com/wmutils/contrib/pull/31.patch https://github.com/wmutils/contrib/pull/31.diff
You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/wmutils/contrib/pull/31
Could you also include a change to the README, specifying what your script does and how to use it?
I like this, do you mind updating this? @agloo
Sure, what needs updating? The last commit should have the readme up, and I was waiting on you guys.
It's on me now, I need to test the script to ensure it works properly
I didn't expect for it to fail this fast!
$ workspace.sh -i
/home/z3bra/bin/workspace.sh: 22: /home/z3bra/bin/workspace.sh: i: not found
/home/z3bra/bin/workspace.sh: 23: [: Illegal number:
Gah, sorry about the amount of poor bash syntax you've had to sift through! That should be fixed, alongside another bit of poor error handling in move_focused_window.
Got an other error when moving to an empty workspace:
$ workspace.sh -n
usage: mapw [-h] [-mut <wid> [wid..]]
Made a script to handle a workspace idiom by mapping lists of focused windows to files in /tmp/workspaces.