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

programs not starting; layout not restoring #15

Closed
peajack opened this issue Aug 2, 2024 · 5 comments
Closed

programs not starting; layout not restoring #15

peajack opened this issue Aug 2, 2024 · 5 comments

Comments

@peajack
Copy link

peajack commented Aug 2, 2024

This script is just what I needed, but now I can't manage it to work. Say, I made a simple layout (peaclock, cmus and shell). I saved it with swayrst save startup. I added exec swayrst load startup to end of my .config/sway/config, but the windows aren't loading. I tried swayrst -v load startup manually, and it says the next

Window peaclock already in correct workspace 1
Window cmus v2.11.0 already in correct workspace 1
Window swayrst save startup already in correct workspace 1
Total windows: 2
Left 2 untouched
Touched: 0:

...but my workspace had only kitty openned at the moment of running load. What am I doing wrong?

@Nama
Copy link
Owner

Nama commented Aug 2, 2024

swayrst doesn't start applications (but there seems to be a lot of ppl interested in it).
The windows need to be opened already before running swayrst. So putting it in your sway config does nothing.
Edit: Might work in sway config, cause of the two seconds delay swayrst has. Windows taking longer to start will not be affected tho.

The idea behind swayrst is, that you can have your WS and windows on the same usual place after plugging in or out a display (or docking or undocking your notebook). So you would save a profile docked and undocked and swayrst would move everything in its place.

For startup, I'd use the for_window rules in the sway config. (But you can make swayrst work on startup with kanshi.)

...but my workspace had only kitty openned at the moment of running load. What am I doing wrong?

But the debug output says otherwise... There weren't any "not found" windows.

Also, then you say "layout", you don't mean the window arrangement in a workspace? That's not supported (yet).

@peajack
Copy link
Author

peajack commented Aug 2, 2024

Ah, so it isn't really the thing that I need? Sad, will search more then. Still thank you!

@peajack peajack closed this as completed Aug 2, 2024
@peajack
Copy link
Author

peajack commented Aug 16, 2024

I found what I needed - wezterm!

@Nama
Copy link
Owner

Nama commented Aug 16, 2024

could you describe what you mean and how wezterm helps you?
maybe open a discussion, would be really helpful!

@peajack
Copy link
Author

peajack commented Aug 16, 2024

local wezterm = require("wezterm")
local mux = wezterm.mux
local config = wezterm.config_builder()

config.font = wezterm.font("Iosevka Term")
config.color_scheme = "Gruvbox dark, pale (base16)"

config.hide_tab_bar_if_only_one_tab = true

wezterm.on("gui-startup", function(cmd)
	local project_dir = wezterm.home_dir .. "/Projects"
	local tab, main_pane, window = mux.spawn_window({
		workspace = "default",
		cwd = project_dir,
	})
	local cmus_pane = main_pane:split({
		direction = "Bottom",
		size = 0.2,
		cwd = project_dir,
	})
	local peaclock_pane = cmus_pane:split({
		direction = "Right",
		size = 0.3,
		cwd = project_dir,
	})

	cmus_pane:send_text("cmus\n")
	peaclock_pane:send_text("peaclock\n")
end)

return config

this config autostarts and aligns windows in order that I need. it looks like this

image

@Nama Nama pinned this issue Aug 16, 2024
@Nama Nama changed the title Windows aren't loading; says they're already in correct workspace programs not starting; layout not restoring Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants