Class AppRules

java.lang.Object
lol.trq.orpheus.AppRules

public final class AppRules extends Object
Decides which sessions of other applications are visible. Operating system sessions include browsers, video players and calls, and the media kind they report cannot be trusted, so the default is an allow list.

A rule is a name such as spotify. Names are split into parts at dots, underscores, hyphens, slashes, spaces and exclamation marks, ignoring case, and a rule matches an application whose id contains the parts of the rule in a row. So spotify matches Spotify.exe, com.spotify.client and org.mpris.MediaPlayer2.spotify, and com.apple.music matches only that id. A denied application is never visible. Instances are immutable; every method returns a new one.

  • Method Details

    • defaults

      public static AppRules defaults()
      Well-known dedicated music players only. Browsers and unknown applications stay hidden until allowed.
    • none

      public static AppRules none()
      Nothing is visible until allowed.
    • all

      public static AppRules all()
      Every session is visible, including browser tabs (private ones too), video players and calls. Only for programs whose user asked for exactly that.
    • allow

      public AppRules allow(String... apps)
    • deny

      public AppRules deny(String... apps)
    • allowVideo

      public AppRules allowVideo(String... apps)
      Allows applications and also shows what they report as video.
    • visible

      public boolean visible(SourceApp app, MediaKind kind)
      Whether a session of app reporting kind may be shown.
    • matches

      public static boolean matches(String rule, String appId)
      Whether the single rule rule matches the application id appId.