Add workspace app icon side-effects and add wiki link for settings. (#387)

* Add side-effect for app icons for workspaces and udated mpris types.

* Add links to workspace icon toggles.

* Add subtitle
This commit is contained in:
Jas Singh
2024-10-28 00:03:28 -07:00
committed by GitHub
parent 4e2a774c7e
commit 5bc1c1e7d4
8 changed files with 90 additions and 30 deletions

View File

@@ -1,7 +1,6 @@
import icons from 'lib/icons';
import { BoxWidget } from 'lib/types/widget';
import { getPlayerInfo } from '../../helpers';
import { MprisPlayer } from 'types/service/mpris';
import { isLoopActive, isValidLoopStatus } from './helpers';
const media = await Service.import('mpris');
@@ -36,7 +35,7 @@ export const loopControl = (): BoxWidget => {
child: Widget.Icon({
setup: (self) => {
self.hook(media, () => {
const foundPlayer: MprisPlayer = getPlayerInfo();
const foundPlayer = getPlayerInfo();
if (foundPlayer === undefined) {
self.icon = icons.mpris.loop['none'];

View File

@@ -1,6 +1,5 @@
const media = await Service.import('mpris');
import { getPlayerInfo } from '../../helpers';
import { MprisPlayer } from 'types/service/mpris';
import { isValidPlaybackStatus } from './helpers';
import Button from 'types/widgets/button';
import Icon from 'types/widgets/icon';
@@ -26,10 +25,12 @@ export const playPause = (): Button<Icon<Attribute>, Attribute> => {
},
child: Widget.Icon({
icon: Utils.watch(icons.mpris.paused, media, 'changed', () => {
const foundPlayer: MprisPlayer = getPlayerInfo();
const foundPlayer = getPlayerInfo();
if (foundPlayer === undefined) {
return icons.mpris['paused'];
}
const playbackStatus = foundPlayer.play_back_status?.toLowerCase();
if (playbackStatus && isValidPlaybackStatus(playbackStatus)) {