[feat] add chill-player

This commit is contained in:
SouthFox 2024-12-30 13:01:41 +08:00
parent 9e02cb192a
commit b5d0efc88f
4 changed files with 27 additions and 2 deletions

View file

@ -48,11 +48,22 @@
"pavucontrol" "pavucontrol"
)) ))
(define %arch-misc
(list
"hy"
"python-requests"
"mpv"
))
(define arch-packages (define arch-packages
(append (append
%arch-base-packages %arch-base-packages
(if (not (equal? "lighthouse" (getlogin))) (if (not (equal? "lighthouse" (getlogin)))
%arch-de-things (begin
%arch-de-things
%arch-misc
)
'()))) '())))
(define arch-services (define arch-services

10
files/bin/chill-player Executable file
View file

@ -0,0 +1,10 @@
#!/usr/bin/env hy
(import json)
(import requests)
(import subprocess)
(while True
(for [item (.json (requests.get "https://stream.chillhop.com/live/12355"))]
(print f"Now playing: {(:title item)} - {(:artists item)} - {(:fileId item)}")
(subprocess.run f"mpv https://stream.chillhop.com/mp3/{(:fileId item)}" :shell True :capture_output True)))

View file

@ -69,6 +69,7 @@ ZSH_THEME="fox"
export LANG=en_US.UTF-8 export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8 export LC_ALL=en_US.UTF-8
export PATH="$HOME/.local/bin:$PATH"
. $HOME/.guix-home/setup-environment . $HOME/.guix-home/setup-environment

View file

@ -54,7 +54,10 @@
(service home-files-service-type (service home-files-service-type
`((".config/hypr/hyprland.conf" ,(local-file "files/hyprland.conf")) `((".config/hypr/hyprland.conf" ,(local-file "files/hyprland.conf"))
(".config/hypr/hyprlock.conf" ,(local-file "files/hyprlock.conf")) (".config/hypr/hyprlock.conf" ,(local-file "files/hyprlock.conf"))
(".config/hypr/hyprpaper.conf" ,(local-file "files/hyprpaper.conf")))) (".config/hypr/hyprpaper.conf" ,(local-file "files/hyprpaper.conf"))
;; bin
(".local/bin" ,(local-file "files/bin" #:recursive? #t))
))
(service home-zsh-service-type (service home-zsh-service-type
(home-zsh-configuration (home-zsh-configuration
(zshrc (list (local-file "files/zshrc")))))))) (zshrc (list (local-file "files/zshrc"))))))))