forked from Shinonome/dots-hyprland
music controls: not spawn dupes if there's plasma integration
This commit is contained in:
@@ -10,6 +10,7 @@ export const hasFlatpak = !!exec(`bash -c 'command -v flatpak'`);
|
||||
const LIGHTDARK_FILE_LOCATION = `${GLib.get_user_cache_dir()}/ags/user/colormode.txt`;
|
||||
const colorMode = Utils.exec('bash -c "sed -n \'1p\' $HOME/.cache/ags/user/colormode.txt"');
|
||||
export let darkMode = !(Utils.readFile(LIGHTDARK_FILE_LOCATION).trim() == 'light');
|
||||
export const hasPlasmaIntegration = !!Utils.exec('bash -c "command -v plasma-browser-integration-host"');
|
||||
|
||||
export const getDistroIcon = () => {
|
||||
// Arches
|
||||
|
||||
@@ -9,7 +9,7 @@ const { Box, EventBox, Icon, Scrollable, Label, Button, Revealer } = Widget;
|
||||
import { fileExists } from '../.miscutils/files.js';
|
||||
import { AnimatedCircProg } from "../.commonwidgets/cairo_circularprogress.js";
|
||||
import { showMusicControls } from '../../variables.js';
|
||||
import { darkMode } from '../.miscutils/system.js';
|
||||
import { darkMode, hasPlasmaIntegration } from '../.miscutils/system.js';
|
||||
|
||||
const COMPILED_STYLE_DIR = `${GLib.get_user_cache_dir()}/ags/user/generated`
|
||||
const LIGHTDARK_FILE_LOCATION = `${GLib.get_user_cache_dir()}/ags/user/colormode.txt`;
|
||||
@@ -20,6 +20,7 @@ var lastCoverPath = '';
|
||||
|
||||
function isRealPlayer(player) {
|
||||
return (
|
||||
(hasPlasmaIntegration && !player.busName.startsWith('org.mpris.MediaPlayer2.firefox')) && // Firefox mpris dbus is useless
|
||||
!player.busName.startsWith('org.mpris.MediaPlayer2.playerctld') && // Doesn't have cover art
|
||||
!player.busName.endsWith('.mpd') // Non-instance mpd bus
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user