Files
xmonad/polybar/scripts/get-media-playing.sh
Sravan Balaji a6d1175a5a Fix Spacing, Rofi Keybindings, & Use ~/.scripts
- Fix spacing around and between windows
- Add keybindings for rofi-rbw & control center
- Replace keybindings for actions with rofi menu
- Move system restore processes to the end of startup hook
- Use scripts in ~/.scripts with command line arguments where possible
- Remove unnecessary shebangs at the start of scripts
- Replace polybar powermenu with clickable icon that launches rofi
2021-05-16 14:17:24 -04:00

19 lines
633 B
Bash
Executable File

#!/bin/bash
mediaStatus=$(playerctl --player=playerctld metadata 2>&1)
if [[ "$mediaStatus" == "No player could handle this command" ]]; then
echo " N/A"
else
artist=$(playerctl --player=playerctld metadata --format '{{ artist }}')
title=$(playerctl --player=playerctld metadata --format '{{ title }}')
status=$(playerctl --player=playerctld metadata --format '{{ status }}')
if [[ $status == "Paused" ]]; then
status_icon=" "
elif [[ $status == "Playing" ]]; then
status_icon=" "
fi
echo "$status_icon $artist - $title"
fi