feat(home-manager): service defs and fmt

fmt: reformatted using nixpkgs-fmt prettifier
mpd: created configuration
hypr: add window rules
commons: add usingMusicPlayerDaemon variable
This commit is contained in:
Zhongheng Liu 2025-01-08 14:12:29 +02:00
commit 7d88765f5d
Signed by: steven
GPG key ID: 805A28B071DAD84B
67 changed files with 633 additions and 573 deletions

View file

@ -1,7 +1,7 @@
const hyprland = await Service.import("hyprland")
const dispatch = ws => hyprland.messageAsync(`dispatch workspace ${ws}`);
const wsSymbols = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10"]
const wsSymbols = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20"]
const Workspaces = () => Widget.EventBox({
onScrollUp: () => dispatch('+1'),
onScrollDown: () => dispatch('-1'),

View file

@ -0,0 +1,17 @@
const mpris = await Service.import('mpris')
/**
* @param {import('types/service/mpris').MprisPlayer} player
* */
const Player = (player, count) => Widget.Button({
onClicked: () => player.playPause(),
child: Widget.Label().hook(player, label => {
const { track_artists, track_title } = player;
label.label = `${count} PLAYING`;
}),
})
export const players = Widget.Box({
children: mpris.bind('players').as(p => p.map(
(this_player, index, array) => { return Player(this_player, array.length) }))
})

View file

@ -1,7 +1,6 @@
{
pkgs,
config,
...
{ pkgs
, config
, ...
}: {
config = {
home.file = {