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

fix: hyprpaper not starting without hyprpaper.conf #19

Merged
merged 2 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ An unofficial GUI for setting wallpapers with multiple backends, built with GTK4
</div>

## Requirements
- Hyprland with IPC enabled & hyprpaper.conf created **(only applies to hyprland / hyprpaper users)**
- IPC enabled **(only for hyprland / hyprpaper users)**
- any backend listed above installed
- GTK-4 installed

Expand Down
11 changes: 11 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,17 @@ async fn ensure_backend_running() -> Result<(), String> {
async fn ensure_hyprpaper_running() -> Result<(), String> {
if !is_process_running("hyprpaper").await {
println!("hyprpaper is not running. Attempting to start it...");

let hyprpaper_config_path = tilde("~/.config/hypr/hyprpaper.conf").into_owned();
let hyprpaper_config_path = Path::new(&hyprpaper_config_path);

if !hyprpaper_config_path.exists() {
std::fs::create_dir_all(hyprpaper_config_path.parent().unwrap())
.expect("Failed to create ~/.config/hypr");
std::fs::File::create(hyprpaper_config_path)
.expect("Failed to create ~/.config/hypr/hyprpaper.conf");
}

start_process("hyprpaper").await?;
}
Ok(())
Expand Down