Few more noise commands
This commit is contained in:
parent
2d671ea750
commit
c86079b929
|
@ -4,6 +4,7 @@ let configPath = $"($env.XDG_CONFIG_HOME? | default $"($env.HOME)/.config")/irs.
|
|||
let config = if ($configPath | path exists) { open $configPath }
|
||||
|
||||
let mpdHost = $config.noise.host? | default 'localhost:6600'
|
||||
let current = mpc --host $mpdHost current
|
||||
|
||||
def notify [message: string] {
|
||||
do { mpc --host $mpdHost -f "%file%" current | xargs -I{} mpc --host $mpdHost albumart {} } | save -f /tmp/mpc_current.png
|
||||
|
@ -12,19 +13,25 @@ def notify [message: string] {
|
|||
|
||||
# Displays the currently playing song
|
||||
def main [] {
|
||||
notify (mpc --host $mpdHost current)
|
||||
mpc --host $mpdHost
|
||||
notify $current
|
||||
}
|
||||
|
||||
# Lists currently playing son
|
||||
def "main tail" [] {
|
||||
while true { mpc --host $mpdHost idle player | ignore; mpc --host partitacastellum current}
|
||||
}
|
||||
|
||||
# Skips to next song
|
||||
def "main next" [] {
|
||||
mpc --host $mpdHost next
|
||||
notify $"Switching to:\n(mpc --host $mpdHost current)"
|
||||
notify $"Switching to:\n($current)"
|
||||
}
|
||||
|
||||
# Moves back a song in the que
|
||||
def "main prev" [] {
|
||||
mpc --host $mpdHost prev
|
||||
notify $"Switching to:\n(mpc --host $mpdHost current)"
|
||||
notify $"Switching to:\n($current)"
|
||||
}
|
||||
|
||||
# Shuffles the current que
|
||||
|
@ -48,5 +55,24 @@ def "main start" [] {
|
|||
# Toggles playback of the current que
|
||||
def "main toggle" [] {
|
||||
mpc --host $mpdHost toggle
|
||||
notify $"Toggling playback of:\n(mpc --host $mpdHost current)"
|
||||
notify $"Toggling playback of:\n($current)"
|
||||
}
|
||||
|
||||
def "main search" [...query: string] {
|
||||
mpc --host $mpdHost search any $"(echo ...$query | str join ' ')"
|
||||
}
|
||||
|
||||
def "main insert" [] {
|
||||
$in | mpc insert --host $mpdHost
|
||||
}
|
||||
|
||||
def "main add" [] {
|
||||
$in | mpc add --host $mpdHost
|
||||
}
|
||||
|
||||
def "main crossfade" [ time?: int ] {
|
||||
match ($time | is-empty) {
|
||||
true => { mpc --host $mpdHost crossfade }
|
||||
false => { mpc --host $mpdHost crossfade $time }
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue