Closed janemba closed 2 years ago
Update:
This issue occurs with others application running in Wayland compatibility mode (xwayland) but without the support for pure wayland (ex: thunderbird). So maybe it is related.
Could be, can you also share debug output from sworkstyle when you do this? --log-level debug
So I did it with Thunderbird but it doesn't show so much information:
2021-07-04 14:23:25,971 DEBUG [sworkstyle] rename workspace "3" to "3: "
2021-07-04 14:23:25,973 DEBUG [sworkstyle] rename workspace "3" to "3: "
2021-07-04 14:23:26,014 DEBUG [sworkstyle] rename workspace "3" to "3: "
2021-07-04 14:23:29,432 DEBUG [sworkstyle] rename workspace "3" to "3: "
Thunderbird is running in workspace "3: " so I guess the app_id for the child window is the same so sworkstyle wants to create a new workspace with the same workspace number and it ends with a duplicate.
Weird, it isn't using the new 3:
to rename. Can you also share swaymsg -t 'get_tree'
when you have the duplicate, or even better a way for me to recreate this situation?
You can recreate this situation by using Opera and then ctrl+s
(save as...) a child window will open in a new workspace with the same number. You can also use Thunderbird and open a child window by opening an email or writing a new one.
By the way, I save the tree when I have the duplicate. I did it with Opera which is in workspace 2.
(Also, Opera and Thunderbird are assigned in their own workspace, I don't know if it is related).
{
"id": 1,
"type": "root",
"orientation": "horizontal",
"percent": null,
"urgent": false,
"marks": [
],
"focused": false,
"layout": "splith",
"border": "none",
"current_border_width": 0,
"rect": {
"x": 0,
"y": 0,
"width": 1920,
"height": 1080
},
"deco_rect": {
"x": 0,
"y": 0,
"width": 0,
"height": 0
},
"window_rect": {
"x": 0,
"y": 0,
"width": 0,
"height": 0
},
"geometry": {
"x": 0,
"y": 0,
"width": 0,
"height": 0
},
"name": "root",
"window": null,
"nodes": [
{
"id": 2147483647,
"type": "output",
"orientation": "horizontal",
"percent": null,
"urgent": false,
"marks": [
],
"focused": false,
"layout": "output",
"border": "none",
"current_border_width": 0,
"rect": {
"x": 0,
"y": 0,
"width": 1920,
"height": 1080
},
"deco_rect": {
"x": 0,
"y": 0,
"width": 0,
"height": 0
},
"window_rect": {
"x": 0,
"y": 0,
"width": 0,
"height": 0
},
"geometry": {
"x": 0,
"y": 0,
"width": 0,
"height": 0
},
"name": "__i3",
"window": null,
"nodes": [
{
"id": 2147483646,
"type": "workspace",
"orientation": "horizontal",
"percent": null,
"urgent": false,
"marks": [
],
"focused": false,
"layout": "splith",
"border": "none",
"current_border_width": 0,
"rect": {
"x": 0,
"y": 0,
"width": 1920,
"height": 1080
},
"deco_rect": {
"x": 0,
"y": 0,
"width": 0,
"height": 0
},
"window_rect": {
"x": 0,
"y": 0,
"width": 0,
"height": 0
},
"geometry": {
"x": 0,
"y": 0,
"width": 0,
"height": 0
},
"name": "__i3_scratch",
"window": null,
"nodes": [
],
"floating_nodes": [
],
"focus": [
],
"fullscreen_mode": 1,
"sticky": false
}
],
"floating_nodes": [
],
"focus": [
2147483646
],
"fullscreen_mode": 0,
"sticky": false
},
{
"id": 3,
"type": "output",
"orientation": "none",
"percent": 1.0,
"urgent": false,
"marks": [
],
"focused": false,
"layout": "output",
"border": "none",
"current_border_width": 0,
"rect": {
"x": 0,
"y": 0,
"width": 1920,
"height": 1080
},
"deco_rect": {
"x": 0,
"y": 0,
"width": 0,
"height": 0
},
"window_rect": {
"x": 0,
"y": 0,
"width": 0,
"height": 0
},
"geometry": {
"x": 0,
"y": 0,
"width": 0,
"height": 0
},
"name": "eDP-1",
"window": null,
"nodes": [
{
"id": 4,
"type": "workspace",
"orientation": "horizontal",
"percent": null,
"urgent": false,
"marks": [
],
"focused": false,
"layout": "splith",
"border": "none",
"current_border_width": 0,
"rect": {
"x": 0,
"y": 30,
"width": 1920,
"height": 1050
},
"deco_rect": {
"x": 0,
"y": 0,
"width": 0,
"height": 0
},
"window_rect": {
"x": 0,
"y": 0,
"width": 0,
"height": 0
},
"geometry": {
"x": 0,
"y": 0,
"width": 0,
"height": 0
},
"name": "1: ",
"window": null,
"nodes": [
{
"id": 63,
"type": "con",
"orientation": "vertical",
"percent": 1.0,
"urgent": false,
"marks": [
],
"focused": false,
"layout": "splitv",
"border": "none",
"current_border_width": 0,
"rect": {
"x": 0,
"y": 30,
"width": 1920,
"height": 1050
},
"deco_rect": {
"x": 0,
"y": 0,
"width": 0,
"height": 0
},
"window_rect": {
"x": 0,
"y": 0,
"width": 0,
"height": 0
},
"geometry": {
"x": 0,
"y": 0,
"width": 0,
"height": 0
},
"name": null,
"window": null,
"nodes": [
{
"id": 5,
"type": "con",
"orientation": "none",
"percent": 1.0,
"urgent": false,
"marks": [
],
"focused": true,
"layout": "none",
"border": "pixel",
"current_border_width": 1,
"rect": {
"x": 0,
"y": 30,
"width": 1920,
"height": 1050
},
"deco_rect": {
"x": 0,
"y": 0,
"width": 0,
"height": 0
},
"window_rect": {
"x": 1,
"y": 1,
"width": 1918,
"height": 1048
},
"geometry": {
"x": 0,
"y": 0,
"width": 700,
"height": 500
},
"name": "swaymsg",
"window": null,
"nodes": [
],
"floating_nodes": [
],
"focus": [
],
"fullscreen_mode": 0,
"sticky": false,
"pid": 1584,
"app_id": "foot",
"visible": true,
"max_render_time": 0,
"shell": "xdg_shell",
"inhibit_idle": false,
"idle_inhibitors": {
"user": "none",
"application": "none"
}
}
],
"floating_nodes": [
],
"focus": [
5
],
"fullscreen_mode": 0,
"sticky": false
}
],
"floating_nodes": [
],
"focus": [
63
],
"fullscreen_mode": 1,
"sticky": false,
"num": 1,
"output": "eDP-1",
"representation": "H[V[foot]]"
},
{
"id": 7,
"type": "workspace",
"orientation": "vertical",
"percent": null,
"urgent": false,
"marks": [
],
"focused": false,
"layout": "splitv",
"border": "none",
"current_border_width": 0,
"rect": {
"x": 0,
"y": 30,
"width": 1920,
"height": 1050
},
"deco_rect": {
"x": 0,
"y": 0,
"width": 0,
"height": 0
},
"window_rect": {
"x": 0,
"y": 0,
"width": 0,
"height": 0
},
"geometry": {
"x": 0,
"y": 0,
"width": 0,
"height": 0
},
"name": "2: ",
"window": null,
"nodes": [
{
"id": 176,
"type": "con",
"orientation": "horizontal",
"percent": 1.0,
"urgent": false,
"marks": [
],
"focused": false,
"layout": "splith",
"border": "none",
"current_border_width": 0,
"rect": {
"x": 0,
"y": 30,
"width": 1920,
"height": 1050
},
"deco_rect": {
"x": 0,
"y": 0,
"width": 0,
"height": 0
},
"window_rect": {
"x": 0,
"y": 0,
"width": 0,
"height": 0
},
"geometry": {
"x": 0,
"y": 0,
"width": 0,
"height": 0
},
"name": null,
"window": null,
"nodes": [
{
"id": 6,
"type": "con",
"orientation": "none",
"percent": 1.0,
"urgent": false,
"marks": [
],
"focused": false,
"layout": "none",
"border": "pixel",
"current_border_width": 1,
"rect": {
"x": 0,
"y": 30,
"width": 1920,
"height": 1050
},
"deco_rect": {
"x": 0,
"y": 0,
"width": 0,
"height": 0
},
"window_rect": {
"x": 1,
"y": 1,
"width": 1918,
"height": 1048
},
"geometry": {
"x": 0,
"y": 0,
"width": 1918,
"height": 1078
},
"name": "child-window \/ instance add new workspace with a duplicate number · Issue #9 · Lyr-7D1h\/swayest_workstyle - Opera",
"window": 4194309,
"nodes": [
],
"floating_nodes": [
],
"focus": [
],
"fullscreen_mode": 0,
"sticky": false,
"pid": 1665,
"app_id": null,
"visible": false,
"max_render_time": 0,
"shell": "xwayland",
"inhibit_idle": false,
"idle_inhibitors": {
"user": "none",
"application": "none"
},
"window_properties": {
"class": "Opera",
"instance": "Opera",
"title": "child-window \/ instance add new workspace with a duplicate number · Issue #9 · Lyr-7D1h\/swayest_workstyle - Opera",
"transient_for": null,
"window_type": "normal"
}
}
],
"floating_nodes": [
],
"focus": [
6
],
"fullscreen_mode": 0,
"sticky": false
}
],
"floating_nodes": [
],
"focus": [
176
],
"fullscreen_mode": 1,
"sticky": false,
"num": 2,
"output": "eDP-1",
"representation": "V[H[Opera]]"
},
{
"id": 216,
"type": "workspace",
"orientation": "horizontal",
"percent": null,
"urgent": false,
"marks": [
],
"focused": false,
"layout": "splith",
"border": "none",
"current_border_width": 0,
"rect": {
"x": 0,
"y": 30,
"width": 1920,
"height": 1050
},
"deco_rect": {
"x": 0,
"y": 0,
"width": 0,
"height": 0
},
"window_rect": {
"x": 0,
"y": 0,
"width": 0,
"height": 0
},
"geometry": {
"x": 0,
"y": 0,
"width": 0,
"height": 0
},
"name": "2",
"window": null,
"nodes": [
],
"floating_nodes": [
{
"id": 215,
"type": "floating_con",
"orientation": "none",
"percent": 0.47447619047619044,
"urgent": false,
"marks": [
],
"focused": false,
"layout": "none",
"border": "normal",
"current_border_width": 2,
"rect": {
"x": 396,
"y": 129,
"width": 1128,
"height": 824
},
"deco_rect": {
"x": 396,
"y": 75,
"width": 1128,
"height": 24
},
"window_rect": {
"x": 2,
"y": 0,
"width": 1124,
"height": 822
},
"geometry": {
"x": 0,
"y": 0,
"width": 1124,
"height": 822
},
"name": "Save File",
"window": 6372003,
"nodes": [
],
"floating_nodes": [
],
"focus": [
],
"fullscreen_mode": 0,
"sticky": false,
"pid": 1665,
"app_id": null,
"visible": false,
"max_render_time": 0,
"shell": "xwayland",
"inhibit_idle": false,
"idle_inhibitors": {
"user": "none",
"application": "none"
},
"window_properties": {
"class": "Opera",
"instance": "opera",
"title": "Save File",
"transient_for": 4194309,
"window_type": "dialog"
}
}
],
"focus": [
215
],
"fullscreen_mode": 1,
"sticky": false,
"num": 2,
"output": "eDP-1",
"representation": "H[]"
}
],
"floating_nodes": [
],
"focus": [
4,
7,
216
],
"fullscreen_mode": 0,
"sticky": false,
"active": true,
"dpms": true,
"primary": false,
"make": "Unknown",
"model": "0x05C0",
"serial": "0x00000000",
"scale": 1.0,
"scale_filter": "nearest",
"transform": "normal",
"adaptive_sync_status": "disabled",
"current_workspace": "1: ",
"modes": [
{
"width": 1920,
"height": 1080,
"refresh": 60003
},
{
"width": 1920,
"height": 1080,
"refresh": 143998
}
],
"current_mode": {
"width": 1920,
"height": 1080,
"refresh": 143998
},
"max_render_time": 0
}
],
"floating_nodes": [
],
"focus": [
3
],
"fullscreen_mode": 0,
"sticky": false
}
Are you sure you're using the workspaces with numbers?
bindsym $mod+1 workspace number 1 bindsym $mod+2 workspace number 2 bindsym $mod+3 workspace number 3 bindsym $mod+4 workspace number 4 bindsym $mod+5 workspace number 5 bindsym $mod+6 workspace number 6 bindsym $mod+7 workspace number 7 bindsym $mod+8 workspace number 8 bindsym $mod+9 workspace number 9 bindsym $mod+0 workspace number 10
I can't reproduce..
I am using workspace with numbers. My config for this part is the following:
# Switch to workspace
bindsym $mod+1 workspace number 1
bindsym $mod+2 workspace number 2
bindsym $mod+3 workspace number 3
bindsym $mod+4 workspace number 4
bindsym $mod+5 workspace number 5
bindsym $mod+6 workspace number 6
bindsym $mod+7 workspace number 7
bindsym $mod+8 workspace number 8
bindsym $mod+9 workspace number 9
bindsym $mod+0 workspace number 10
Can you share ur sway/config and sworkstyle config?
Sure :
config.toml
fallback = ''
[matching]
"foot" = ""
"Chia Blockchain" = ""
"Steam" = ""
"vlc" = "嗢"
"org.qbittorrent.qBittorrent" = ""
"thunderbird" = ""
"Postman" = ""
"Insomnia" = ""
"Bitwarden" = ""
"Google-chrome" = ""
"Chromium" = ""
"Slack" = ""
"Code" = ""
"code-oss" = ""
"Spotify" = ""
"github" = { type = "generic", value = "" }
"rust" = { type = "generic", value = "" }
"firefox" = ""
"Firefox" = ""
"Nightly" = ""
"Opera" = ""
"firefoxdeveloperedition" = ""
"vim" = { type = "generic", value = "" }
"npm" = { type = "generic", value = "" }
"node" = { type = "generic", value = "" }
"yarn" = { type = "generic", value = "" }
"transmission-remote-gtk" = ""
"Emacs" = "ƛ"
"imv" = ""
"launcher" = ""
"irc" = ""
"mpv" = "🎥"
"switch" = ""
"com.themooltipass.moolticute" = "🔐"
"wlogout" = ""
"wireshark" = "歷"
"com.github.babluboy.bookworm" = "📓"
"pavucontrol" = ""
"ebook" = "📖"
$ grep -v '#' $HOME/.sway/config | uniq
set $mod Mod4
set $left h
set $down j
set $up k
set $right l
set $term footclient
for_window [app_id="^launcher$"] floating enable, sticky enable, resize set 30 ppt 60 ppt, border pixel 05
set $menu exec $term --app-id=launcher sh -c $HOME/.local/share/sway-launcher-desktop/sway-launcher-desktop.sh
output * bg $HOME/.local/share/wallpapers/main.jpg fill
exec swayidle -w \
timeout 300 'swaylock -i $HOME/.local/share/wallpapers/lock.jpg -f -c 000000' \
timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \
before-sleep 'playerctl pause' \
before-sleep 'swaylock -i $HOME/.local/share/wallpapers/lock.jpg -f -c 000000'
bindsym $mod+Return exec $term
bindsym $mod+Shift+q kill
bindsym $mod+d exec $menu
floating_modifier $mod normal
bindsym $mod+Shift+c reload
bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'
bindsym $mod+control+l exec wlogout
bindsym $mod+$left focus left
bindsym $mod+$down focus down
bindsym $mod+$up focus up
bindsym $mod+$right focus right
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
bindsym $mod+Shift+$left move left
bindsym $mod+Shift+$down move down
bindsym $mod+Shift+$up move up
bindsym $mod+Shift+$right move right
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
bindsym $mod+1 workspace number 1
bindsym $mod+2 workspace number 2
bindsym $mod+3 workspace number 3
bindsym $mod+4 workspace number 4
bindsym $mod+5 workspace number 5
bindsym $mod+6 workspace number 6
bindsym $mod+7 workspace number 7
bindsym $mod+8 workspace number 8
bindsym $mod+9 workspace number 9
bindsym $mod+0 workspace number 10
bindsym $mod+Shift+1 move container to workspace number 1
bindsym $mod+Shift+2 move container to workspace number 2
bindsym $mod+Shift+3 move container to workspace number 3
bindsym $mod+Shift+4 move container to workspace number 4
bindsym $mod+Shift+5 move container to workspace number 5
bindsym $mod+Shift+6 move container to workspace number 6
bindsym $mod+Shift+7 move container to workspace number 7
bindsym $mod+Shift+8 move container to workspace number 8
bindsym $mod+Shift+9 move container to workspace number 9
bindsym $mod+Shift+0 move container to workspace number 10
bindsym $mod+b splith
bindsym $mod+v splitv
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
bindsym $mod+f fullscreen
bindsym $mod+Shift+space floating toggle
bindsym $mod+space focus mode_toggle
bindsym $mod+a focus parent
bindsym $mod+Shift+minus move scratchpad
bindsym $mod+minus scratchpad show
mode "resize" {
bindsym $left resize shrink width 10px
bindsym $down resize grow height 10px
bindsym $up resize shrink height 10px
bindsym $right resize grow width 10px
bindsym Left resize shrink width 10px
bindsym Down resize grow height 10px
bindsym Up resize shrink height 10px
bindsym Right resize grow width 10px
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+r mode "resize"
bar {
position top
swaybar_command waybar
}
exec_always $HOME/.config/sway/scripts/import-gsettings
include $HOME/.config/sway/config.d/*.conf
I also have this file in sway/config.d/02-daemon.conf
:
# DBus
exec 'dbus-update-activation-environment --systemd WAYLAND_DISPLAY'
# Foot terminal server
exec 'foot --server'
# avizo
exec 'avizo-service'
# sworkstyle
exec 'sworkstyle > /var/log/sway/sworkstyle.log 2>&1'
# emacs
exec 'emacs --daemon'
Hi,
Any idea about where I should look ?
I found this in log file:
2021-07-11 12:04:59,034 WARN [sworkstyle::config] No match for "Opera" with title "Save File"
2021-07-11 12:04:59,035 WARN [sworkstyle::config] No match for "Opera" with title "Save File"
2021-07-11 12:04:59,036 WARN [sworkstyle::config] No match for "Opera" with title "Save File"
2021-07-11 12:04:59,319 WARN [sworkstyle::config] No match for "Opera" with title "Save File"
I've made a change in the config file:
"Opera" = value` = ""
to
"Opera" = { type = "generic", value = "" }
Is there any update on this? I am encountering the same problem with Thunderbird. @janemba Did you find a workaround? The change in the config file from your last comment (adapted for Thunderbird) does not change anything for me.
@jooert I didn't find any solution so I gave up and uninstalled sworkstyle...sorry.
I was able to get child windows to appear in the same workspace.
If you have an assign
in your Sway config, new windows won't match the workspace name after it is modified by Sworkstyle. In my case, I assign Steam to its own workspace with assign [class="^Steam$"] 6
in my Sway config. When Steam is launched, the workspace is renamed to "6: " by Sworkstyle. When I then open the Steam settings window, Sway is unable to find workspace 6
because it has been renamed, so it creates a new workspace instead.
My solution was to only assign the first window to the workspace and let child windows such as settings assign to the currently focused workspace. Since the title of the main window is "Steam" and the tile of the settings window is "settings", I used the following in my Sway config:
assign [class="^Steam$" title="Steam"] 6
You can do the same for Thunderbird by adding title
to the assign in your Sway config:
assign [app_id="^thunderbird$" title="Mozilla Thunderbird"] 4
Child windows that open on launch will unfortunately appear in your current workspace instead of the workspace assigned to the first window, but the above works for settings windows, composing new emails, etc.
All of this is based off of user troubleshooting and not the code, so apologies if I got something wrong. Hope this helps!
Is this still a problem? I had a really hard time reproducing this bug that is why it has been still for so long. Would love some easy steps to reproduce if this is still a pressing issue.
I was able to reproduce, but only by adding an assign
to my Sway config to bind an application to a specific workspace number. I'm assuming this is also the case in janemba's config above via include $HOME/.config/sway/config.d/*.conf
since they said "Opera and Thunderbird are assigned in their own workspace."
Assuming there is an assign
in the Sway config, I'd say it's more "undesired behavior" than a bug since the programs behave as expected. Example:
1
as assigned1 [icon]
1
, same as beforeIn my opinion, the "fix" would be regex matching on workspace names within Sway itself for assigning windows to workspaces. However, I'm satisfied with changing Sway's matching parameters to only target the main application window and not any pop-ups, effectively executing steps 1 and 2 above but skipping step 3.
Do you think explaining this in the README.md is a good enough solution for this undesired behavior @k4j8 ?
Yes, I think so. Do you want to add something like the following to "Known Issues" on the README?
assign
in the sway config to assign all windows from an application to a specific workspace will cause each window to go in its own individual workspace - this is due to sworkstyle renaming the workspaces from what is listed in the sway configThanks for making such an awesome tool! I feel lost in my workspaces when I use Sway without it.
My bad for completely missing assignment of workspaces caused this. I improved the README accordingly. @janemba and @jooert please follow the newly updated readme and let me know if this worked: https://github.com/Lyr-7D1h/swayest_workstyle#sway-configuration
Hello,
I have an issue when running with Xwayland and Opera application (Opera do not work in pure wayland). While a child-window open like the file system manager to download a file a second workspace is created with a duplicate number. I cannot access that workspace by using a keyboard shortcut so I have to the mouse to access it.
I have made two screenshots, one before clicking a download link and one after clicking on the download link.
before
Click.
after
Is there any workaround for this issue ?