Add spotify module; use spotifyd
This commit is contained in:
		
							parent
							
								
									c897191831
								
							
						
					
					
						commit
						abe9d26a79
					
				|  | @ -75,11 +75,11 @@ XF86AudioRaiseVolume | |||
| 	amixer -q set Master 10%+ unmute | ||||
| 
 | ||||
| XF86Audio{Play,Pause} | ||||
| 	dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause | ||||
| 	dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotifyd /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause | ||||
| XF86AudioNext | ||||
| 	dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next | ||||
| 	dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotifyd /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next | ||||
| XF86AudioPrev | ||||
| 	dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous | ||||
| 	dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotifyd /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous | ||||
| 
 | ||||
| # X86Search | ||||
| 
 | ||||
|  |  | |||
|  | @ -10,6 +10,7 @@ | |||
| 
 | ||||
|     ./modules/audio/audacity.nix | ||||
|     ./modules/audio/lmms.nix | ||||
|     ./modules/audio/spotify.nix | ||||
|     ./modules/browser/firefox.nix | ||||
|     ./modules/dev | ||||
|     ./modules/editors/emacs.nix | ||||
|  |  | |||
|  | @ -12,6 +12,7 @@ in { | |||
| 
 | ||||
|     ./modules/desktop/bspwm.nix | ||||
| 
 | ||||
|     ./modules/audio/spotify.nix | ||||
|     ./modules/browser/firefox.nix | ||||
|     ./modules/dev | ||||
|     ./modules/graphics/aseprite.nix | ||||
|  |  | |||
							
								
								
									
										24
									
								
								modules/audio/spotify.nix
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								modules/audio/spotify.nix
									
									
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,24 @@ | |||
| { config, lib, pkgs, ... }: | ||||
| 
 | ||||
| let unstable = import <nixpkgs-unstable> {}; | ||||
| in | ||||
| { | ||||
|   environment.systemPackages = with pkgs; [ | ||||
|     # services.spotifyd doesn't work so... | ||||
|     spotifyd | ||||
|     (writeScriptBin "spt" '' | ||||
|       #!${stdenv.shell} | ||||
|       if ! pgrep -x spotifyd >/dev/null; then | ||||
|         spotifyd --backend pulseaudio \ | ||||
|                  --cache_path ~/.cache/spotifyd \ | ||||
|                  --username accounts@v0.io \ | ||||
|                  --password $(pass www/spotify.com) | ||||
|       fi | ||||
|       ${unstable.spotify-tui}/bin/spt | ||||
|     '') | ||||
| 
 | ||||
|     # spotify-tui is fine for selecting and playing music, but incomplete. We | ||||
|     # occasionally still need the official client. | ||||
|     spotify | ||||
|   ]; | ||||
| } | ||||
|  | @ -14,7 +14,6 @@ | |||
|     # Useful apps | ||||
|     evince    # pdf reader | ||||
|     (callPackage <packages/ripcord.nix> {}) | ||||
|     spotify | ||||
|   ]; | ||||
| 
 | ||||
|   sound.enable = true; | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue