Browse Source

feat: add ncspot configs

master
Tovi Jaeschke-Rogers 2 weeks ago
parent
commit
8ea6534671
6 changed files with 24 additions and 3 deletions
  1. +2
    -1
      .local/bin/spotify-next
  2. +2
    -1
      .local/bin/spotify-prev
  3. +2
    -1
      .local/bin/spotify-toggle
  4. +11
    -0
      .local/bin/status-music
  5. +5
    -0
      .local/bin/tmux-music
  6. +2
    -0
      .tmux.conf

+ 2
- 1
.local/bin/spotify-next View File

@ -1,3 +1,4 @@
#!/bin/sh #!/bin/sh
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.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next
playerctl -p ncspot next

+ 2
- 1
.local/bin/spotify-prev View File

@ -1,3 +1,4 @@
#!/bin/sh #!/bin/sh
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.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous
playerctl -p ncspot previous

+ 2
- 1
.local/bin/spotify-toggle View File

@ -1,3 +1,4 @@
#!/bin/sh #!/bin/sh
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.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause
playerctl -p ncspot play-pause

+ 11
- 0
.local/bin/status-music View File

@ -0,0 +1,11 @@
#!/bin/bash
# Check if ncspot is playing
status=$(playerctl -p ncspot status 2>/dev/null)
# Only output song info if ncspot is playing
if [ "$status" = "Playing" ]; then
playerctl -p ncspot metadata --format "{{ artist }} - {{ title }}" 2>/dev/null
else
echo "-"
fi

+ 5
- 0
.local/bin/tmux-music View File

@ -0,0 +1,5 @@
#!/usr/bin/env bash
if ! tmux has-session -t="music" 2> /dev/null; then
tmux new-session -ds "music" -c "$HOME" ncspot
fi
tmux switch-client -t "music"

+ 2
- 0
.tmux.conf View File

@ -70,6 +70,8 @@ bind S command-prompt -p "New Session:" "new-session -A -s '%%'"
bind-key -r f run-shell "tmux neww ~/.local/bin/tmux-sessionizer" bind-key -r f run-shell "tmux neww ~/.local/bin/tmux-sessionizer"
bind-key -r m run-shell "~/.local/bin/tmux-music"
# List of plugins # List of plugins
set -g @plugin 'tmux-plugins/tpm' set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible' set -g @plugin 'tmux-plugins/tmux-sensible'


Loading…
Cancel
Save