diff --git a/CHANGELOG.md b/CHANGELOG.md index b9b6c0bc..df135ca5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,8 @@ Versioning](https://semver.org/spec/v2.0.0.html). update. If you use a distro packaged version of yabridge, then that means yabridge can now be updated safely without requiring any action from your side. +- Added support for the `effBeginLoadBank` and `effBeginLoadProgram` VST2 + opcodes for loading state as a program or a program bank. ### Changed @@ -103,6 +105,10 @@ Versioning](https://semver.org/spec/v2.0.0.html). idea. I've come across at least one binary this new parser can't handle (https://github.com/m4b/goblin/issues/307), so it will still fall back to winedump in some cases. +- After `yabridgectl sync` has finished setting up plugins, yabridgectl will now + also check whether `notify-send` is installed as part of its post-install + verification process. If `notify-send` is missing then yabridge won't be able + to send any notifications when things are going terribly wrong. - `yabridgectl status` now shows the locations where bridged VST2 and VST3 plugins will be set up. - `yabridgectl sync --prune` now also considers broken symlinks. diff --git a/tools/yabridgectl/src/actions.rs b/tools/yabridgectl/src/actions.rs index 1f2d5af6..2fa478ac 100644 --- a/tools/yabridgectl/src/actions.rs +++ b/tools/yabridgectl/src/actions.rs @@ -28,7 +28,7 @@ use crate::config::{ }; use crate::files::{self, NativeFile, Plugin, Vst2Plugin}; use crate::util::{self, get_file_type}; -use crate::util::{verify_path_setup, verify_wine_setup}; +use crate::util::{verify_external_dependencies, verify_path_setup, verify_wine_setup}; use crate::vst3_moduleinfo::ModuleInfo; pub mod blacklist; @@ -682,6 +682,10 @@ pub fn do_sync(config: &mut Config, options: &SyncOptions) -> Result<()> { // This check is only performed once per combination of Wine and yabridge versions verify_wine_setup(config)?; + // Yabridge uses notify-send to relay important information when something's very wrong, so + // we'll check whether this is installed + verify_external_dependencies()?; + Ok(()) } diff --git a/tools/yabridgectl/src/util.rs b/tools/yabridgectl/src/util.rs index c439b0c8..ad978f51 100644 --- a/tools/yabridgectl/src/util.rs +++ b/tools/yabridgectl/src/util.rs @@ -29,6 +29,7 @@ use std::os::unix::process::CommandExt; use std::path::{Path, PathBuf}; use std::process::{Command, Stdio}; use textwrap::Wrapper; +use which::which; use crate::config::{self, Config, KnownConfig, YABRIDGE_HOST_32_EXE_NAME, YABRIDGE_HOST_EXE_NAME}; use crate::files::{LibArchitecture, NativeFile}; @@ -463,6 +464,25 @@ pub fn verify_wine_setup(config: &mut Config) -> Result<()> { Ok(()) } +/// Check whether `notify-send` is installed, as this is used to relay important information when +/// something's very wrong. +pub fn verify_external_dependencies() -> Result<()> { + if which("notify-send").is_err() { + eprintln!( + "\n{}", + wrap(&format!( + "Warning: Could not find '{}'. This will not prevent yabridge from working, but \ + you will also not receive any notifcations when something is wrong. It is \ + usually part of the libnotify package, but your distro might have moved it into a \ + separate libnotify-tools package.", + "notify-send".bright_white(), + )) + ); + } + + Ok(()) +} + /// Wrap a long paragraph of text to terminal width, or 80 characters if the width of the terminal /// can't be determined. Everything after the first line gets indented with four spaces. pub fn wrap(text: &str) -> String {