Prevent screen turning off during playback

Closes: #157

XDG portals expose a D-Bus interface allowing apps to prevent screen
idling, user switching, and other actions. That interface,
org.freedesktop.portal.Inhibit, does all of the heavy lifting here.

Idling = the screen dimming or shutting off.

Idling is inhibited when a video is actively playing.
Idling is NOT inhibited when videos aren't playing - this includes
paused or stopped videos.
This commit is contained in:
Josh Megnauth 2025-11-09 21:33:47 -05:00
parent fa1637fe51
commit bb087578df
No known key found for this signature in database
GPG key ID: 70813183462EFAD3
10 changed files with 331 additions and 40 deletions

View file

@ -1,13 +1,12 @@
// SPDX-License-Identifier: GPL-3.0-only
use cosmic::{
theme,
widget::menu::{self, key_bind::KeyBind, ItemHeight, ItemWidth, MenuBar},
Element,
Element, theme,
widget::menu::{self, ItemHeight, ItemWidth, MenuBar, key_bind::KeyBind},
};
use std::{collections::HashMap, path::PathBuf};
use crate::{fl, Action, Config, ConfigState, Message};
use crate::{Action, Config, ConfigState, Message, fl};
pub fn menu_bar<'a>(
_config: &Config,