You are not logged in.

#1 2018-11-10 17:37:07

hughitt1
Member
Registered: 2010-02-18
Posts: 82
Website

[SOLVED] Silently load one or more scratchpads when launching sway?

Greetings,

I've been trying out sway the past few days, and so far I really like it. One of the things I'm having trouble getting to work, however, is configuring a couple termite instances to automatically load and go to the scratch pad when I start sway.

Ideally, I'd like to have the terminal instances start silently in the background so that way their visibility can be toggled at a later time and nothing will have to be loaded.

I've spent some time searching around for various (mostly i3) solutions, but so far I haven't gotten it to work.

What I have now is:

# "exec_always" is useful to ensure that the commands are executed even when I just reload sway's config
exec_always --no-startup-id termite --name=terminal_scratchpad --geometry 1920x480
exec_always --no-startup-id termite --name=r_scratchpad --geometry 1920x480

bindsym Mod1+Return [instance="terminal_scratchpad"] scratchpad show
bindsym Mod1+space [instance="r_scratchpad"] scratchpad show

for_window [instance="terminal_scratchpad"] move scratchpad, border 1pixel
for_window [instance="r_scratchpad"] move scratchpad, border 1pixel

The goal is to have two separate terminal instances, one that can be toggled with "alt + enter" and the other with "alt + space".

Currently, the two termite instances are spawn when I start sway, but they are visible and are not added to the scratch pad. Neither of the key bindings have any effect either.

Anyone know what the problem could be?

Any advice would be greatly appreciated.

Thanks!
Keith

Last edited by hughitt1 (2018-11-13 17:21:18)

Offline

#2 2018-11-13 17:21:05

hughitt1
Member
Registered: 2010-02-18
Posts: 82
Website

Re: [SOLVED] Silently load one or more scratchpads when launching sway?

It turns out native Wayland apps don't use class, name, etc. window properties (see here for a more thorough discussion). Instead, the same effect can be achieved using the "app_id" field.

An example:

# console terminal (alt + enter)
exec termite --name=terminal_scratchpad

# R terminal (alt + space)
exec termite --name=r_scratchpad -e R

for_window [app_id="terminal_scratchpad"] move scratchpad, resize set 1440 810
for_window [app_id="r_scratchpad"] move scratchpad, resize set 1440 810

bindsym Mod1+Return [app_id="terminal_scratchpad"] scratchpad show
bindsym Mod1+space [app_id="r_scratchpad"] scratchpad show

Offline

Board footer

Powered by FluxBB