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

Drop daemonizing logic #230

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Drop daemonizing logic #230

wants to merge 1 commit into from

Conversation

WhyNotHugo
Copy link
Contributor

Run in foreground, which is what service managers expect. Usages like running exec swww in sway's config continue to work fine. User session start-up scripts can simply run swww &.

Fixes: #182

@LGFae
Copy link
Owner

LGFae commented Mar 11, 2024

Thanks, Hugo. As mentioned in #182, could you maybe also delete the swww init command?

@WhyNotHugo WhyNotHugo force-pushed the main branch 3 times, most recently from 0389f02 to a0dd6ee Compare June 7, 2024 16:44
Rely on `swww-daemon` instead. It runs in foreground, which is what
service managers expect. Usages like running `exec swww` in sway's
config continue to work fine. User session start-up scripts can simply
run `swww-daemon &`.

Fixes: LGFae#182
Comment on lines -24 to -39
match is_daemon_running() {
Ok(false) => {
let socket_path = get_socket_path();
if socket_path.exists() {
eprintln!(
"WARNING: socket file {} was not deleted when the previous daemon exited",
socket_path.to_string_lossy()
);
if let Err(e) = std::fs::remove_file(socket_path) {
return Err(format!("failed to delete previous socket: {e}"));
}
}
}
Ok(true) => {
return Err("There seems to already be another instance running...".to_string())
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I actually need to move this logic into the daemon, right?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's already there, actually :).

Comment on lines 220 to +221
Importantly, **cache will only be loaded during initialization if you use swww
init**. That is, calling `swww-daemon` directly will **NOT** load the cache, but
calling `swww-init` will.
init**. That is, calling `swww-daemon` directly will **NOT** load the cache.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, this isn't true anymore. swww-daemon loads the cache now, unless you pass it the --no-cache flag.

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

Successfully merging this pull request may close these issues.

Don't run in background by default
2 participants