setting up mpd stuff

This commit is contained in:
William Ball 2026-04-05 11:36:13 -04:00
parent aa4a80360f
commit 4ccb5d0b59
Signed by: wball
SSH key fingerprint: SHA256:3K3IvjUp1U5HwsIRYy/vosnG8l/A84LPUSAKQ6oCGKI
6 changed files with 94 additions and 32 deletions

View file

@ -0,0 +1,8 @@
host = localhost
port = 6600
music-dir = /home/wball/Nextcloud/Music
text-topic = Music
text-play = Playing <b>%t</b>\nby <i>%a</i>\nfrom <i>%A</i>
text-pause = Paused <b>%t</b>\nby <i>%a</i>\nfrom <i>%A</i>
text-stop = Stopped playback
timeout = 5

10
mpd/.config/mpd/mpd.conf Normal file
View file

@ -0,0 +1,10 @@
music_directory "~/Nextcloud/Music"
playlist_directory "~/Nextcloud/Music/Playlists"
auto_update "yes"
restore_paused "yes"
audio_output {
type "pipewire"
name "PipeWire output"
}

View file

@ -0,0 +1,15 @@
#!/bin/sh
case "$1" in
--connect)
notify-send 'bluetooth' 'Connecting to Headphones'
bluetoothctl connect "88:C9:E8:D7:60:85"
;;
--disconnect)
notify-send 'bluetooth' 'Disconnecting Headphones'
bluetoothctl disconnect "88:C9:E8:D7:60:85"
;;
*)
exit 1
;;
esac

View file

@ -21,16 +21,15 @@ riverctl map normal $mod+Shift Return spawn $term
riverctl map normal $mod R span "bemenu-run -p launch" riverctl map normal $mod R span "bemenu-run -p launch"
riverctl map normal $mod Semicolon spawn "bemenu-run -p launch" riverctl map normal $mod Semicolon spawn "bemenu-run -p launch"
riverctl map normal $mod+Shift P spawn "$config/power_mode.sh" riverctl map normal $mod+Shift P spawn "$config/power_mode.sh"
# riverctl map normal $mod+Shift P spawn "passmenu -p password"
riverctl map normal $mod BracketRight spawn "$browser" riverctl map normal $mod BracketRight spawn "$browser"
riverctl map normal $mod T spawn "$email" riverctl map normal $mod T spawn "$email"
riverctl map normal $mod Z spawn "$books" riverctl map normal $mod Z spawn "$books"
riverctl map normal $mod Y spawn "$papers" riverctl map normal $mod Y spawn "$papers"
riverctl map normal $mod E spawn "$emacs" riverctl map normal $mod E spawn "$emacs"
riverctl map normal $mod+Control O spawn "swaylock" riverctl map normal $mod+ctrl O spawn "swaylock"
riverctl map normal $mod B spawn "bluetoothctl connect 88:C9:E8:D7:60:85" riverctl map normal $mod B spawn "$config/bluetooth.sh --connect"
riverctl map normal $mod+Shift B spawn "bluetoothctl disconnect 88:C9:E8:D7:60:85" riverctl map normal $mod+Shift B spawn "$config/bluetooth.sh --disconnect"
riverctl map normal $mod+Control S spawn "$config/screenshot.sh clip" riverctl map normal $mod+ctrl S spawn "$config/screenshot.sh clip"
riverctl map normal $mod+Shift E spawn "$config/screenshot.sh menu" riverctl map normal $mod+Shift E spawn "$config/screenshot.sh menu"
# Close windows & exit wm # Close windows & exit wm
@ -64,10 +63,10 @@ riverctl map normal $mod+Alt J move down 100
riverctl map normal $mod+Alt K move up 100 riverctl map normal $mod+Alt K move up 100
riverctl map normal $mod+Alt L move right 100 riverctl map normal $mod+Alt L move right 100
riverctl map normal $mod+Alt+Control H snap left riverctl map normal $mod+Alt+ctrl H snap left
riverctl map normal $mod+Alt+Control J snap down riverctl map normal $mod+Alt+ctrl J snap down
riverctl map normal $mod+Alt+Control K snap up riverctl map normal $mod+Alt+ctrl K snap up
riverctl map normal $mod+Alt+Control L snap right riverctl map normal $mod+Alt+ctrl L snap right
riverctl map normal $mod+Alt+Shift H resize horizontal -100 riverctl map normal $mod+Alt+Shift H resize horizontal -100
riverctl map normal $mod+Alt+Shift J resize vertical 100 riverctl map normal $mod+Alt+Shift J resize vertical 100
@ -85,8 +84,8 @@ do
riverctl map normal $mod $i set-focused-tags $tags riverctl map normal $mod $i set-focused-tags $tags
riverctl map normal $mod+Shift $i set-view-tags $tags riverctl map normal $mod+Shift $i set-view-tags $tags
riverctl map normal $mod+Control $i toggle-focused-tags $tags riverctl map normal $mod+ctrl $i toggle-focused-tags $tags
riverctl map normal $mod+Shift+Control $i toggle-view-tags $tags riverctl map normal $mod+Shift+ctrl $i toggle-view-tags $tags
done done
all_tags=$(((1 << 32) - 1)) all_tags=$(((1 << 32) - 1))
@ -98,10 +97,10 @@ riverctl map normal $mod Space toggle-float
riverctl map normal $mod F toggle-fullscreen riverctl map normal $mod F toggle-fullscreen
# change layout orientation # change layout orientation
riverctl map normal $mod+Control K send-layout-cmd rivertile "main-location top" riverctl map normal $mod+ctrl K send-layout-cmd rivertile "main-location top"
riverctl map normal $mod+Control L send-layout-cmd rivertile "main-location right" riverctl map normal $mod+ctrl L send-layout-cmd rivertile "main-location right"
riverctl map normal $mod+Control J send-layout-cmd rivertile "main-location bottom" riverctl map normal $mod+ctrl J send-layout-cmd rivertile "main-location bottom"
riverctl map normal $mod+Control H send-layout-cmd rivertile "main-location left" riverctl map normal $mod+ctrl H send-layout-cmd rivertile "main-location left"
# passthrough mode # passthrough mode
riverctl declare-mode passthrough riverctl declare-mode passthrough
@ -113,12 +112,12 @@ for mode in normal locked
do do
riverctl map $mode None XF86Eject spawn 'eject -T' riverctl map $mode None XF86Eject spawn 'eject -T'
riverctl map $mode None XF86AudioRaiseVolume spawn "~/.config/river/volume.sh up 0.02" riverctl map $mode None XF86AudioRaiseVolume spawn "$config/volume.sh up 0.02"
riverctl map $mode None XF86AudioLowerVolume spawn "~/.config/river/volume.sh down 0.02" riverctl map $mode None XF86AudioLowerVolume spawn "$config/volume.sh down 0.02"
riverctl map $mode Shift XF86AudioRaiseVolume spawn "~/.config/river/volume.sh up 0.01" riverctl map $mode Shift XF86AudioRaiseVolume spawn "$config/volume.sh up 0.01"
riverctl map $mode Shift XF86AudioLowerVolume spawn "~/.config/river/volume.sh down 0.01" riverctl map $mode Shift XF86AudioLowerVolume spawn "$config/volume.sh down 0.01"
riverctl map $mode Control XF86AudioRaiseVolume spawn "~/.config/river/volume.sh up 0.10" riverctl map $mode ctrl XF86AudioRaiseVolume spawn "$config/volume.sh up 0.10"
riverctl map $mode Control XF86AudioLowerVolume spawn "~/.config/river/volume.sh down 0.10" riverctl map $mode ctrl XF86AudioLowerVolume spawn "$config/volume.sh down 0.10"
riverctl map $mode None XF86AudioMute exec spawn "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle" riverctl map $mode None XF86AudioMute exec spawn "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
riverctl map $mode None XF86AudioMedia spawn 'playerctl play-pause' riverctl map $mode None XF86AudioMedia spawn 'playerctl play-pause'
@ -131,7 +130,7 @@ do
done done
# "caffeine" # "caffeine"
riverctl map normal $mod+Control C spawn "$HOME/.config/river/toggle_caffeine.sh" riverctl map normal $mod+ctrl C spawn "$config/toggle_caffeine.sh"
# colors # colors
riverctl background-color 0x1e1e2e riverctl background-color 0x1e1e2e
@ -166,22 +165,18 @@ riverctl float-filter-add app-id blueman-manager
scratch_tag=$((1 << 20)) scratch_tag=$((1 << 20))
riverctl map normal $mod Slash toggle-focused-tags $scratch_tag riverctl map normal $mod Slash toggle-focused-tags $scratch_tag
riverctl map normal $mod+Shift Slash set-view-tags $scratch_tag riverctl map normal $mod+Shift Slash set-view-tags $scratch_tag
riverctl map normal $mod+Control Slash toggle-view-tags $scratch_tag riverctl map normal $mod+ctrl Slash toggle-view-tags $scratch_tag
riverctl map normal $mod S spawn "$term_float" riverctl map normal $mod S spawn "$term_float"
riverctl rule-add -app-id float float riverctl rule-add -app-id float float
# SSD (so GTK apps show border) # SSD (so GTK apps show border)
riverctl rule-add -app-id firefox ssd
riverctl rule-add -app-id librewolf ssd riverctl rule-add -app-id librewolf ssd
riverctl rule-add -app-id thunderbird ssd riverctl rule-add -app-id thunderbird ssd
riverctl rule-add -app-id betterbird ssd
riverctl rule-add -app-id emacs ssd riverctl rule-add -app-id emacs ssd
riverctl rule-add -app-id gnucash ssd riverctl rule-add -app-id gnucash ssd
riverctl rule-add -app-id pcmanfm ssd riverctl rule-add -app-id pcmanfm ssd
riverctl rule-add -app-id steam ssd riverctl rule-add -app-id steam ssd
riverctl rule-add -app-id drracket ssd
riverctl rule-add -app-id org.pwmt.zathura ssd riverctl rule-add -app-id org.pwmt.zathura ssd
riverctl rule-add -app-id org.gnome.Boxes ssd
riverctl rule-add -app-id com.github.xournalpp.xournalpp ssd riverctl rule-add -app-id com.github.xournalpp.xournalpp ssd
# spawn stuff # spawn stuff
@ -207,14 +202,18 @@ emacs --daemon &
nextcloud & nextcloud &
# pianobar # pianobar
riverctl map normal $mod+Shift S spawn '~/.config/pianobar/change_station.sh' # riverctl map normal $mod+Shift S spawn '~/.config/pianobar/change_station.sh'
riverctl map normal $mod P spawn 'echo "p" > ~/.config/pianobar/ctl' # riverctl map normal $mod P spawn 'echo "p" > ~/.config/pianobar/ctl'
riverctl map normal $mod C spawn '~/.config/pianobar/display_info.sh' # riverctl map normal $mod N spawn 'echo "n" > ~/.config/pianobar/ctl'
riverctl map normal $mod N spawn 'echo "n" > ~/.config/pianobar/ctl' # riverctl map normal $mod C spawn '~/.config/pianobar/display_info.sh'
riverctl map normal $mod P spawn 'mpc toggle'
riverctl map normal $mod+Shift S spawn "$config/music_command.sh --playlist"
riverctl map normal $mod+ctrl S spawn "$config/music_command.sh --song"
riverctl map normal $mod N spawn 'mpc next'
# swayidle # swayidle
pgrep swayidle || swayidle -w \ pgrep swayidle || swayidle -w \
timeout 300 '$HOME/.config/river/timeout.sh' \ timeout 300 "$config/timeout.sh" \
before-sleep 'swaylock -f -c 000000' & before-sleep 'swaylock -f -c 000000' &
# gnome-keyring (needed for nextcloud to remember login) # gnome-keyring (needed for nextcloud to remember login)

View file

@ -0,0 +1,29 @@
#!/bin/bash
dmenu="bemenu -p playlist --center --list 20 down --width-factor 0.5 --border 2 --bdr #f6c2e7"
case "$1" in
--playlist)
choice=$(mpc lsplaylists | $dmenu)
if [[ -n $choice ]]; then
mpc clear
mpc load $choice
mpc shuffle
mpc next
mpc play
fi
;;
--song)
choice=$(mpc listall | $dmenu)
echo $choice
if [[ -n $choice ]]; then
mpc add "$choice"
mpc searchplay "$choice"
fi
;;
*)
exit 1
;;
esac

View file

@ -10,6 +10,7 @@ export BEMENU_OPTS='--ignorecase --fb "#1e1e2e" --ff "#cdd6f4" --nb "#1e1e2e" --
export XDG_CACHE_HOME="$HOME/.cache" export XDG_CACHE_HOME="$HOME/.cache"
export XDG_CONFIG_HOME="$HOME/.config" export XDG_CONFIG_HOME="$HOME/.config"
export XDG_DATA_HOME="$HOME/.local/share" export XDG_DATA_HOME="$HOME/.local/share"
export XDG_MUSIC_DIR="$HOME/Nextcloud/Music"
# General environment variables # General environment variables
export EDITOR=nvim export EDITOR=nvim