-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ipc: support workspace sets #2156
Conversation
Hi and thanks for starting the work on this. A few things:
|
@ammen99 Updated
Does the output data need to contain any workspace information except for the workspace set's id? It could easily just provide the id, and scripts can query for the workspace set info itself afterwards with that. Right now, the output data still supplies the workspace data to clients. |
Yes, that's true but I'd like to avoid breaking changes - and I guess that this is information which would be commonly requested so I think overall it is better to spare the additional IPC call needed otherwise. |
Took a brief look over the PR, looks much better now :) I'll do a full review on the weekend & merge if everything is fine. |
Sounds good. I just added EDIT: I also have to build and try it for myself :) Still haven't done that yet! |
I think this features should belong to the wsets plugin though, since it can also create/destroy wsets and already has all the logic for moving wsets around (and also I think it keeps an internal mapping of wsets). It can also show a popup when the wset changes (which I guess should happen also for ipc-triggered switches). |
Good point! I'll revert the commit for now and look into adding this feature before the merge, if it is in scope for this PR. |
I don't personally mind merging either two separate PRs or one bigger PR, feel free to organize it as you wish. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pushed one small commit with a few smaller fixes and also made it so that when selecting a workspace set on an output which doesn't exist, the workspace set with the given index will be created. This matches the behavior of the bindings that the wset
plugin provides - otherwise we'd need a dedicated command for creating a wset which seems clumsy.
Otherwise LGTM, thanks!
* Basic untested support for ipc workspaces * Updated ipc-rules * Fix find_workspace_set_by_id * Added configure_output and configure_wset * Include workspace-set.hpp in ipc-helpers * Revert "Added configure_output and configure_wset" This reverts commit 36d5adf. * Check code style with uncrustify * Add ipc wset manipulation in wsets plugin * Updated ipc plugins * small fixes --------- Co-authored-by: Ilia Bozhinov <ammen99@gmail.com>
I would like to switch between workspace in a bar. |
@bluebyt Workspace or workspace set? Here is an example for workspaces using the vswitch plugin: from wayfire_socket import WayfireSocket, get_msg_template
import os
addr = os.getenv('WAYFIRE_SOCKET')
sock = WayfireSocket(addr)
msg = get_msg_template('vswitch/set-workspace')
msg['data']['x'] = x
msg['data']['y'] = y
msg['data']['output-id'] = output-id
sock.send_json(msg) For reference: wayfire/plugins/vswitch/vswitch.cpp Line 242 in 4f65d16
wayfire/plugins/vswitch/vswitch.cpp Lines 251 to 255 in 4f65d16
|
@ammen99 Something like this, all workspace are displayed in the bar with numbers or icons and with the mouse you can navigate between them by clicking or scrolling on the number in the bar. I don't known what is workspace set? I tried the script on the terminal, but I get multiple error, my system should be all set, I can run other script like inactive-alpha.py without any error. ./workspace.py: line 1: from: command not found |
@bluebyt In case you're not looking at the matrix chat .. |
After added the line "#!/bin/env python3" I have less error. |
Yes, replace x/y and the output-id appropriately xD |
What is output-id? I tried this HDMI-A-1, but I get an error. |
You can see a list of available output by making a query |
also you can try: pip install wayfire
|
This is a draft PR for an implementation of querying and configuring workspace sets via IPC. This would be a way to interface with workspaces via bars such as waybar or window rule scripts specific to workspaces. Leaving it as a draft for now since I am unsure if this should live in
wsets
oripc-rules
. For now, it lives inipc-rules
. This is a very quick, very untested implementation as I do not have time at the moment to build and test the plugin.This would likely require signals for seeing if a workspace set is created or destroyed. I'm not too sure if they already exist, but this would require more signals to be defined I imagine, if they aren't defined already.
Views should also know which workspace set and viewport they exist on, but I don't know if that would complicate anything in the codebase, or if that is considered out of scope for this PR. On paper, listing views and specifying the workspace set id and/or viewport position should list all the views that exist on that workspace set (and viewport if specified). This would make it less simple for scripts to know which workspace set they exist on however- an example would be seeing if a view's title change is on the second workspace. One would have to list all the views that exist on the second workspace in order to check if the view is indeed on it whereas ideally, one could simply check properties such as
workspace-set-id
andworkspace-point
. Again, that might be out of scope for this specific PR as it doesn't necessarily pertain to interfacing with workspace sets.