pop-os: Add service for playerctl bindings in stumpwm
This commit is contained in:
parent
46c9198adc
commit
a5eff7a9cc
3 changed files with 57 additions and 3 deletions
|
@ -33,7 +33,9 @@
|
|||
home-stumpwm-gaps-service-type
|
||||
home-stumpwm-gaps-configuration
|
||||
home-stumpwm-stumptray-service-type
|
||||
home-stumpwm-stumptray-configuration))
|
||||
home-stumpwm-stumptray-configuration
|
||||
home-stumpwm-playerctl-service-type
|
||||
home-stumpwm-playerctl-configuration))
|
||||
#:use-module (oni home services zsh)
|
||||
#:use-module ((oni packages emacs)
|
||||
#:select (emacs-php-ts-mode))
|
||||
|
@ -156,4 +158,8 @@
|
|||
(configurations
|
||||
(list (mixed-text-file "config-stumptray"
|
||||
"(require 'stumptray)\n"
|
||||
"(stumptray::stumptray)\n"))))))))
|
||||
"(stumptray::stumptray)\n")))))
|
||||
(service home-stumpwm-playerctl-service-type
|
||||
(home-stumpwm-playerctl-configuration
|
||||
(configurations
|
||||
(list (local-file "../services/stumpwm/playerctl.lisp"))))))))
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
serialize-text-config))
|
||||
#:use-module ((gnu packages lisp)
|
||||
#:select (sbcl))
|
||||
#:use-module ((gnu packages music)
|
||||
#:select (playerctl))
|
||||
#:use-module ((gnu packages wm)
|
||||
#:select (stumpwm
|
||||
stumpish
|
||||
|
@ -38,7 +40,10 @@
|
|||
home-stumpwm-gaps-configuration
|
||||
|
||||
home-stumpwm-stumptray-service-type
|
||||
home-stumpwm-stumptray-configuration))
|
||||
home-stumpwm-stumptray-configuration
|
||||
|
||||
home-stumpwm-playerctl-service-type
|
||||
home-stumpwm-playerctl-configuration))
|
||||
|
||||
(define (serialize-integer field value)
|
||||
"")
|
||||
|
@ -193,3 +198,40 @@
|
|||
(compose identity)
|
||||
(default-value (home-stumpwm-stumptray-configuration))
|
||||
(description "Install and configure stumpwm-stumptray.")))
|
||||
|
||||
(define-configuration/no-serialization home-stumpwm-playerctl-configuration
|
||||
(package
|
||||
(package playerctl)
|
||||
"Package to use for setting playerctl in stumpwm.")
|
||||
(configurations
|
||||
(text-config '())
|
||||
"Configuration for playerctl in stumpwm."))
|
||||
|
||||
(define (add-stumpwm-playerctl-packages config)
|
||||
(list (home-stumpwm-playerctl-configuration-package config)))
|
||||
|
||||
(define (add-stumpwm-playerctl config)
|
||||
(home-stumpwm-extension
|
||||
(configurations
|
||||
(append
|
||||
(list
|
||||
(mixed-text-file
|
||||
"playerctl.lisp"
|
||||
"(defvar *playerctl-program* \""
|
||||
(home-stumpwm-playerctl-configuration-package config)
|
||||
"/bin/playerctl\")\n"))
|
||||
(home-stumpwm-playerctl-configuration-configurations config)))))
|
||||
|
||||
(define home-stumpwm-playerctl-service-type
|
||||
(service-type
|
||||
(name 'home-stumpwm-playerctl)
|
||||
(extensions
|
||||
(list (service-extension
|
||||
home-stumpwm-service-type
|
||||
add-stumpwm-playerctl)
|
||||
(service-extension
|
||||
home-profile-service-type
|
||||
add-stumpwm-playerctl-packages)))
|
||||
(compose identity)
|
||||
(default-value (home-stumpwm-playerctl-configuration))
|
||||
(description "Install and configure playerctl in stumpwm.")))
|
||||
|
|
6
oni/home/services/stumpwm/playerctl.lisp
Normal file
6
oni/home/services/stumpwm/playerctl.lisp
Normal file
|
@ -0,0 +1,6 @@
|
|||
(defvar *playerctl-bindings*
|
||||
(let ((m (make-sparse-keymap)))
|
||||
(define-key m (kbd "SPC") (format nil "exec ~a play-pause" *playerctl-program*))
|
||||
m))
|
||||
|
||||
(define-key *user-bindings* (kbd "p") '*playerctl-bindings*)
|
Loading…
Add table
Reference in a new issue