Skip to content
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

Scratchpad failure #931

Closed
wasamasa opened this issue Oct 5, 2016 · 6 comments
Closed

Scratchpad failure #931

wasamasa opened this issue Oct 5, 2016 · 6 comments

Comments

@wasamasa
Copy link
Contributor

wasamasa commented Oct 5, 2016

I'm using the following lines to have a scratchpad with termite going on:

exec --no-startup-id scratchpad
# ...
for_window [class="scratchpad_termite"] move to scratchpad
bindsym $mod+grave [class="scratchpad_termite"] scratchpad show

Contents of the scratchpad script:

#!/bin/bash
pgrep tmux
if [[ $? -ne 0 ]]; then
  termite --class=scratchpad_termite --exec=tmux
else
  termite --class=scratchpad_termite --exec='tmux a'
fi

Error when using $mod+grave:

Command '[class="scratchpad_termite"] scratchpad show' failed: Can't handle criteria string: Refusing to execute command

Not sure what exactly is going on there. I'd be happy to provide further debug information.

@thejan2009
Copy link
Contributor

There are multiple issues here. First of all, the reported failure to parse criteria. There is also another issue which might be related to upstream: --class=something doesn't change the window's class or appname. Relevant output of command swaymsg -t get_tree when termite was started with --class option:

              "window": 5,
              "window_properties": {
                "class": "termite",
                "title": "js@planica:~",
                "transient_for": null
              },
              "fullscreen_mode": 0,
              "sticky": false,
              "floating": "auto_off",
              "app_id": "termite",

@wasamasa
Copy link
Contributor Author

wasamasa commented Oct 6, 2016

I would also accept an alternative solution for recognizing a specific Termite window as scratchpad.

@thejan2009
Copy link
Contributor

Use title instead of class, e.g. termite --title=scratchpad_termite and for_window [title="scratchpad_termite"] move scratchpad. About the second part - criteria doesn't seem to be implemented as one would expect, it doesn't work with arbitrary commands, only with for_window. That should probably be a separate issue.

@wasamasa
Copy link
Contributor Author

wasamasa commented Oct 8, 2016

Thanks. If I change the script and config as suggested, I get an additional error:

Command 'move' failed: Expected 'move <left|up|right|down>' or 'move <container|window> to workspace <name>' or 'move <container|window> to output <name|direction>' or 'move position mouse'

@ddevault
Copy link
Contributor

Please provide a log.

@wasamasa
Copy link
Contributor Author

Truncated log:

12/27/16 00:23:11 - [commands.c:482] handling config command 'exec --no-startup-id scratchpad'
12/27/16 00:23:11 - [commands.c:328] find_handler(exec) 0
12/27/16 00:23:11 - [config.c:656] Defferring command `exec --no-startup-id scratchpad'
...
12/27/16 00:23:11 - [commands.c:482] handling config command 'for_window [title="scratchpad_termite"] move to scratchpad'
12/27/16 00:23:11 - [commands.c:328] find_handler(for_window) 0
12/27/16 00:23:11 - [criteria.c:101] Parsing criteria: '[title="scratchpad_termite"]'
12/27/16 00:23:11 - [criteria.c:231] title -> /scratchpad_termite/
12/27/16 00:23:11 - [for_window.c:36] for_window: '[title="scratchpad_termite"]' -> 'move to scratchpad' added
12/27/16 00:23:11 - [commands.c:482] handling config command 'bindsym $mod+grave [title="scratchpad_termite"] scratchpad show'
12/27/16 00:23:11 - [commands.c:328] find_handler(bindsym) 0
12/27/16 00:23:11 - [bind.c:85] bindsym - Bound Mod4+grave to command [title="scratchpad_termite"] scratchpad show
...
12/27/16 00:23:12 - [exec_always.c:74] Child process created with pid 12416 for workspace 1
12/27/16 00:23:12 - [commands.c:414] Handling command 'exec --no-startup-id scratchpad'
12/27/16 00:23:12 - [commands.c:328] find_handler(exec) 0
12/27/16 00:23:12 - [exec_always.c:18] exec switch '--no-startup-id' not supported, ignored.
12/27/16 00:23:12 - [exec_always.c:33] Executing scratchpad
12/27/16 00:23:12 - [exec_always.c:74] Child process created with pid 12418 for workspace 1
...
12/27/16 00:23:12 - [exec_always.c:74] Child process created with pid 12416 for workspace 1
12/27/16 00:23:12 - [commands.c:414] Handling command 'exec --no-startup-id scratchpad'
12/27/16 00:23:12 - [commands.c:328] find_handler(exec) 0
12/27/16 00:23:12 - [exec_always.c:18] exec switch '--no-startup-id' not supported, ignored.
12/27/16 00:23:12 - [exec_always.c:33] Executing scratchpad
12/27/16 00:23:12 - [exec_always.c:74] Child process created with pid 12418 for workspace 1
12/27/16 00:23:12 - [main.c:44] [wlc] xwm: unimplemented 29
12/27/16 00:23:12 - [workspace.c:329] looking for workspace for pid 12424
12/27/16 00:23:12 - [workspace.c:344] found pid_workspace for pid 12418, workspace 1
12/27/16 00:23:12 - [handlers.c:341] handle:3 type:0 state:0 parent:0 mask:0 (x:0 y:0 w:642 h:386) title:scratchpad_termite class:(null) appid:termite
12/27/16 00:23:12 - [container.c:290] Adding new view 3:scratchpad_termite to container 0x267d050 2
12/27/16 00:23:12 - [layout.c:62] Adding 0x2babe30 (4, 0.000000x0.000000) to 0x267d050 (2, 1366.000000x751.000000)
12/27/16 00:23:12 - [container.c:240] creating container 0x2bc5050 around 0x2babe30
12/27/16 00:23:12 - [layout.c:62] Adding 0x2babe30 (4, 0.000000x0.000000) to 0x2bc5050 (3, 0.000000x0.000000)
12/27/16 00:23:12 - [ipc-server.c:665] Sending window::new event
12/27/16 00:23:12 - [debug_log.c:94] Setting focus to 0x2babe30:3 (VIEW 'scratchpad_termite')
12/27/16 00:23:12 - [ipc-server.c:665] Sending window::focus event
12/27/16 00:23:12 - [debug_log.c:94] Arranging layout for 0x2bc5050 (CONTAINER '(null)')
12/27/16 00:23:12 - [layout.c:786] Arranging layout for 0x2bc5050 (null) 0.000000x0.000000+0.000000,0.000000
12/27/16 00:23:12 - [layout.c:786] Arranging layout for 0x2babe30 scratchpad_termite 0.000000x0.000000+0.000000,0.000000
12/27/16 00:23:12 - [layout.c:858] Set view to 1 x 1 @ 0, 0
focus:R      |(0x63bf20)(p:(nil)   )(f:0x267b700)(h:18446744073709551615)Type:root|layout:-    |w:1366|h: 768|x:   0|y:   0|g:  0|vis:t|children: 1|name:root
|focus:X     |(0x267b700)(p:0x63bf20)(f:0x267d050)(h: 1)Type:op  |layout:-    |w:1366|h: 768|x:   0|y:   0|g: -1|vis:t|children: 1|name:LVDS-1
|-focus:W    |(0x267d050)(p:0x267b700)(f:0x2bc5050)(h:18446744073709551615)Type:ws  |layout:Horiz|w:1366|h: 751|x:   0|y:  17|g: -1|vis:t|children: 1|name:1
|--focus:X   |(0x2bc5050)(p:0x267d050)(f:0x2babe30)(h:18446744073709551615)Type:cont|layout:Tab  |w:   0|h:   0|x:   0|y:   0|g: -1|vis:t|children: 1|name:(null)
|---focus:K  |(0x2babe30)(p:0x2bc5050)(f:(nil)   )(h: 3)Type:view|layout:-    |w:   1|h:   1|x:   0|y:   0|g: -1|vis:t|children: 0|name:scratchpad_termi
12/27/16 00:23:12 - [debug_log.c:94] Arranging layout for 0x267b700 (OUTPUT 'LVDS-1')
12/27/16 00:23:12 - [layout.c:786] Arranging layout for 0x267b700 LVDS-1 1366.000000x768.000000+0.000000,0.000000
12/27/16 00:23:12 - [debug_log.c:94] Arranging layout for 0x267d050 (WORKSPACE '1')
12/27/16 00:23:12 - [layout.c:786] Arranging layout for 0x267d050 1 1366.000000x751.000000+0.000000,17.000000
12/27/16 00:23:12 - [layout.c:826] -> Found panel for this workspace: 1366x17, position: 0
12/27/16 00:23:12 - [layout.c:848] Arranging workspace '1' at 0.000000, 17.000000
12/27/16 00:23:12 - [layout.c:918] Arranging 0x267d050 horizontally
12/27/16 00:23:12 - [layout.c:922] Calculating arrangement for 0x2bc5050:3 (will scale 1366.000000 by 1.000000)
12/27/16 00:23:12 - [layout.c:786] Arranging layout for 0x2bc5050 (null) 1366.000000x0.000000+0.000000,17.000000
12/27/16 00:23:12 - [layout.c:786] Arranging layout for 0x2babe30 scratchpad_termite 1.000000x1.000000+0.000000,17.000000
12/27/16 00:23:12 - [layout.c:858] Set view to 1366 x 751 @ 0, 17
focus:R      |(0x63bf20)(p:(nil)   )(f:0x267b700)(h:18446744073709551615)Type:root|layout:-    |w:1366|h: 768|x:   0|y:   0|g:  0|vis:t|children: 1|name:root
|focus:X     |(0x267b700)(p:0x63bf20)(f:0x267d050)(h: 1)Type:op  |layout:-    |w:1366|h: 768|x:   0|y:   0|g: -1|vis:t|children: 1|name:LVDS-1
|-focus:W    |(0x267d050)(p:0x267b700)(f:0x2bc5050)(h:18446744073709551615)Type:ws  |layout:Horiz|w:1366|h: 751|x:   0|y:  17|g: -1|vis:t|children: 1|name:1
|--focus:X   |(0x2bc5050)(p:0x267d050)(f:0x2babe30)(h:18446744073709551615)Type:cont|layout:Tab  |w:1366|h: 751|x:   0|y:  17|g: -1|vis:t|children: 1|name:(null)
|---focus:K  |(0x2babe30)(p:0x2bc5050)(f:(nil)   )(h: 3)Type:view|layout:-    |w:1366|h: 751|x:   0|y:  17|g: -1|vis:t|children: 0|name:scratchpad_termi
12/27/16 00:23:12 - [handlers.c:393] for_window '[title="scratchpad_termite"]' matches new view 0x2babe30, cmd: 'move to scratchpad'
12/27/16 00:23:12 - [commands.c:414] Handling command 'move to scratchpad'
12/27/16 00:23:12 - [commands.c:328] find_handler(move) 0
12/27/16 00:23:12 - [handlers.c:396] Command 'move' failed: Expected 'move <left|right|up|down>' or 'move <container|window> to workspace <name>' or 'move <container|window|workspace> to output <name|direction>' or 'move position mouse'
12/27/16 00:23:12 - [debug_log.c:94] Setting focus to 0x2babe30:3 (VIEW 'scratchpad_termite')
12/27/16 00:23:12 - [ipc-server.c:665] Sending window::focus event
12/27/16 00:23:12 - [debug_log.c:94] Arranging layout for 0x2bc5050 (CONTAINER '(null)')
12/27/16 00:23:12 - [layout.c:786] Arranging layout for 0x2bc5050 (null) 1366.000000x751.000000+0.000000,17.000000
12/27/16 00:23:12 - [layout.c:786] Arranging layout for 0x2babe30 scratchpad_termite 1366.000000x751.000000+0.000000,17.000000
12/27/16 00:23:12 - [layout.c:858] Set view to 1366 x 751 @ 0, 17
focus:R      |(0x63bf20)(p:(nil)   )(f:0x267b700)(h:18446744073709551615)Type:root|layout:-    |w:1366|h: 768|x:   0|y:   0|g:  0|vis:t|children: 1|name:root
|focus:X     |(0x267b700)(p:0x63bf20)(f:0x267d050)(h: 1)Type:op  |layout:-    |w:1366|h: 768|x:   0|y:   0|g: -1|vis:t|children: 1|name:LVDS-1
|-focus:W    |(0x267d050)(p:0x267b700)(f:0x2bc5050)(h:18446744073709551615)Type:ws  |layout:Horiz|w:1366|h: 751|x:   0|y:  17|g: -1|vis:t|children: 1|name:1
|--focus:X   |(0x2bc5050)(p:0x267d050)(f:0x2babe30)(h:18446744073709551615)Type:cont|layout:Tab  |w:1366|h: 751|x:   0|y:  17|g: -1|vis:t|children: 1|name:(null)
|---focus:K  |(0x2babe30)(p:0x2bc5050)(f:(nil)   )(h: 3)Type:view|layout:-    |w:1366|h: 751|x:   0|y:  17|g: -1|vis:t|children: 0|name:scratchpad_termi
12/27/16 00:23:12 - [handlers.c:496] geometry request for 3 642x386 @ 0,17
12/27/16 00:23:12 - [handlers.c:496] geometry request for 3 1366x751 @ 0,17
12/27/16 00:23:13 - [input.c:52] rewritten name Power_Button
12/27/16 00:23:13 - [handlers.c:131] Found input device (0:1:Power_Button)
12/27/16 00:23:13 - [input.c:52] rewritten name Video_Bus
12/27/16 00:23:13 - [handlers.c:131] Found input device (0:6:Video_Bus)
12/27/16 00:23:13 - [input.c:52] rewritten name Sleep_Button
12/27/16 00:23:13 - [handlers.c:131] Found input device (0:3:Sleep_Button)
12/27/16 00:23:13 - [input.c:52] rewritten name AT_Translated_Set_2_keyboard
12/27/16 00:23:13 - [handlers.c:131] Found input device (1:1:AT_Translated_Set_2_keyboard)
12/27/16 00:23:13 - [input.c:52] rewritten name TPPS/2_IBM_TrackPoint
12/27/16 00:23:13 - [handlers.c:131] Found input device (2:10:TPPS/2_IBM_TrackPoint)
12/27/16 00:23:13 - [input.c:52] rewritten name ThinkPad_Extra_Buttons
12/27/16 00:23:13 - [handlers.c:131] Found input device (6058:20564:ThinkPad_Extra_B)
12/27/16 00:23:13 - [debug_log.c:94] Setting focus to 0x2babe30:3 (VIEW 'scratchpad_termite')
12/27/16 00:23:13 - [ipc-server.c:665] Sending window::focus event
12/27/16 00:23:13 - [debug_log.c:94] Arranging layout for 0x2bc5050 (CONTAINER '(null)')
12/27/16 00:23:13 - [layout.c:786] Arranging layout for 0x2bc5050 (null) 1366.000000x751.000000+0.000000,17.000000
12/27/16 00:23:13 - [layout.c:786] Arranging layout for 0x2babe30 scratchpad_termite 1366.000000x751.000000+0.000000,17.000000
12/27/16 00:23:13 - [layout.c:858] Set view to 1366 x 751 @ 0, 17
focus:R      |(0x63bf20)(p:(nil)   )(f:0x267b700)(h:18446744073709551615)Type:root|layout:-    |w:1366|h: 768|x:   0|y:   0|g:  0|vis:t|children: 1|name:root
|focus:X     |(0x267b700)(p:0x63bf20)(f:0x267d050)(h: 1)Type:op  |layout:-    |w:1366|h: 768|x:   0|y:   0|g: -1|vis:t|children: 1|name:LVDS-1
|-focus:W    |(0x267d050)(p:0x267b700)(f:0x2bc5050)(h:18446744073709551615)Type:ws  |layout:Horiz|w:1366|h: 751|x:   0|y:  17|g: -1|vis:t|children: 1|name:1
|--focus:X   |(0x2bc5050)(p:0x267d050)(f:0x2babe30)(h:18446744073709551615)Type:cont|layout:Tab  |w:1366|h: 751|x:   0|y:  17|g: -1|vis:t|children: 1|name:(null)
|---focus:K  |(0x2babe30)(p:0x2bc5050)(f:(nil)   )(h: 3)Type:view|layout:-    |w:1366|h: 751|x:   0|y:  17|g: -1|vis:t|children: 0|name:scratchpad_termi
12/27/16 00:23:14 - [handlers.c:592] Command '[title="scratchpad_termite"] scratchpad show' failed: Can't handle criteria string: Refusing to execute command
12/27/16 00:23:15 - [handlers.c:592] Command '[title="scratchpad_termite"] scratchpad show' failed: Can't handle criteria string: Refusing to execute command
12/27/16 00:23:15 - [handlers.c:592] Command '[title="scratchpad_termite"] scratchpad show' failed: Can't handle criteria string: Refusing to execute command
12/27/16 00:23:15 - [handlers.c:592] Command '[title="scratchpad_termite"] scratchpad show' failed: Can't handle criteria string: Refusing to execute command
12/27/16 00:23:15 - [handlers.c:592] Command '[title="scratchpad_termite"] scratchpad show' failed: Can't handle criteria string: Refusing to execute command
12/27/16 00:23:15 - [workspace.c:329] looking for workspace for pid 12425
12/27/16 00:23:15 - [handlers.c:341] handle:4 type:0 state:0 parent:0 mask:0 (x:0 y:0 w:656 h:576) title:emacs@odonien class:emacs appid:(null)
12/27/16 00:23:15 - [container.c:290] Adding new view 4:emacs@odonien to container 0x2babe30 4
12/27/16 00:23:15 - [ipc-server.c:665] Sending window::new event
12/27/16 00:23:15 - [debug_log.c:94] Setting focus to 0x2bcf700:4 (VIEW 'emacs@odonien')
12/27/16 00:23:15 - [ipc-server.c:665] Sending window::focus event
12/27/16 00:23:15 - [debug_log.c:94] Arranging layout for 0x2bc5050 (CONTAINER '(null)')
12/27/16 00:23:15 - [layout.c:786] Arranging layout for 0x2bc5050 (null) 1366.000000x751.000000+0.000000,17.000000
12/27/16 00:23:15 - [layout.c:786] Arranging layout for 0x2babe30 scratchpad_termite 1366.000000x751.000000+0.000000,17.000000
12/27/16 00:23:15 - [layout.c:858] Set view to 1366 x 751 @ 0, 17
12/27/16 00:23:15 - [layout.c:786] Arranging layout for 0x2bcf700 emacs@odonien 0.000000x0.000000+0.000000,17.000000
12/27/16 00:23:15 - [layout.c:858] Set view to 1366 x 751 @ 0, 17
focus:R      |(0x63bf20)(p:(nil)   )(f:0x267b700)(h:18446744073709551615)Type:root|layout:-    |w:1366|h: 768|x:   0|y:   0|g:  0|vis:t|children: 1|name:root
|focus:X     |(0x267b700)(p:0x63bf20)(f:0x267d050)(h: 1)Type:op  |layout:-    |w:1366|h: 768|x:   0|y:   0|g: -1|vis:t|children: 1|name:LVDS-1
|-focus:W    |(0x267d050)(p:0x267b700)(f:0x2bc5050)(h:18446744073709551615)Type:ws  |layout:Horiz|w:1366|h: 751|x:   0|y:  17|g: -1|vis:t|children: 1|name:1
|--focus:X   |(0x2bc5050)(p:0x267d050)(f:0x2bcf700)(h:18446744073709551615)Type:cont|layout:Tab  |w:1366|h: 751|x:   0|y:  17|g: -1|vis:t|children: 2|name:(null)
|---focus:X  |(0x2babe30)(p:0x2bc5050)(f:(nil)   )(h: 3)Type:view|layout:-    |w:1366|h: 751|x:   0|y:  17|g: -1|vis:f|children: 0|name:scratchpad_termi
|---focus:K  |(0x2bcf700)(p:0x2bc5050)(f:(nil)   )(h: 4)Type:view|layout:-    |w:1366|h: 751|x:   0|y:  17|g: -1|vis:t|children: 0|name:emacs@odonien
12/27/16 00:23:15 - [debug_log.c:94] Arranging layout for 0x267b700 (OUTPUT 'LVDS-1')
12/27/16 00:23:15 - [layout.c:786] Arranging layout for 0x267b700 LVDS-1 1366.000000x768.000000+0.000000,0.000000
12/27/16 00:23:15 - [debug_log.c:94] Arranging layout for 0x267d050 (WORKSPACE '1')
12/27/16 00:23:15 - [layout.c:786] Arranging layout for 0x267d050 1 1366.000000x751.000000+0.000000,17.000000
12/27/16 00:23:15 - [layout.c:826] -> Found panel for this workspace: 1366x17, position: 0
12/27/16 00:23:15 - [layout.c:848] Arranging workspace '1' at 0.000000, 17.000000
12/27/16 00:23:15 - [layout.c:918] Arranging 0x267d050 horizontally
12/27/16 00:23:15 - [layout.c:922] Calculating arrangement for 0x2bc5050:3 (will scale 1366.000000 by 1.000000)
12/27/16 00:23:15 - [layout.c:786] Arranging layout for 0x2bc5050 (null) 1366.000000x751.000000+0.000000,17.000000
12/27/16 00:23:15 - [layout.c:786] Arranging layout for 0x2babe30 scratchpad_termite 1366.000000x751.000000+0.000000,17.000000
12/27/16 00:23:15 - [layout.c:858] Set view to 1366 x 751 @ 0, 17
12/27/16 00:23:15 - [layout.c:786] Arranging layout for 0x2bcf700 emacs@odonien 1366.000000x751.000000+0.000000,17.000000
12/27/16 00:23:15 - [layout.c:858] Set view to 1366 x 751 @ 0, 17
focus:R      |(0x63bf20)(p:(nil)   )(f:0x267b700)(h:18446744073709551615)Type:root|layout:-    |w:1366|h: 768|x:   0|y:   0|g:  0|vis:t|children: 1|name:root
|focus:X     |(0x267b700)(p:0x63bf20)(f:0x267d050)(h: 1)Type:op  |layout:-    |w:1366|h: 768|x:   0|y:   0|g: -1|vis:t|children: 1|name:LVDS-1
|-focus:W    |(0x267d050)(p:0x267b700)(f:0x2bc5050)(h:18446744073709551615)Type:ws  |layout:Horiz|w:1366|h: 751|x:   0|y:  17|g: -1|vis:t|children: 1|name:1
|--focus:X   |(0x2bc5050)(p:0x267d050)(f:0x2bcf700)(h:18446744073709551615)Type:cont|layout:Tab  |w:1366|h: 751|x:   0|y:  17|g: -1|vis:t|children: 2|name:(null)
|---focus:X  |(0x2babe30)(p:0x2bc5050)(f:(nil)   )(h: 3)Type:view|layout:-    |w:1366|h: 751|x:   0|y:  17|g: -1|vis:f|children: 0|name:scratchpad_termi
|---focus:K  |(0x2bcf700)(p:0x2bc5050)(f:(nil)   )(h: 4)Type:view|layout:-    |w:1366|h: 751|x:   0|y:  17|g: -1|vis:t|children: 0|name:emacs@odonien
12/27/16 00:23:15 - [handlers.c:496] geometry request for 4 656x576 @ 0,34
12/27/16 00:23:15 - [handlers.c:496] geometry request for 4 1366x734 @ 0,34
12/27/16 00:23:15 - [handlers.c:496] geometry request for 4 1360x720 @ 0,34
12/27/16 00:23:15 - [handlers.c:496] geometry request for 4 1360x720 @ 0,34
12/27/16 00:23:15 - [handlers.c:496] geometry request for 4 1366x734 @ 0,34
12/27/16 00:23:15 - [ipc-server.c:665] Sending window::title event
12/27/16 00:23:17 - [commands.c:414] Handling command 'exit'
12/27/16 00:23:17 - [commands.c:328] find_handler(exit) 0
12/27/16 00:23:17 - [main.c:46] [wlc] Terminating wlc...
12/27/16 00:23:17 - [main.c:46] [wlc] Terminating compositor...
12/27/16 00:23:17 - [main.c:46] [wlc] Output (1) terminated...
12/27/16 00:23:17 - [container.c:439] OUTPUT: Destroying output '1'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants