Created a now_playing script for waybar to show currently playing song in cmus

This commit is contained in:
Thai Noodles 2024-01-10 18:38:06 -08:00
parent 7ccc5cdc19
commit e5b9b32e4d
4 changed files with 98 additions and 1 deletions

View File

@ -0,0 +1,80 @@
# Default cfg.yaml for way-displays.
# Copy this to ~/.config/way-displays/cfg.yaml and edit it to your liking.
#
# See https://github.com/alex-courtis/way-displays/blob/master/doc/CONFIGURATION.md
# Arrange displays in a ROW (default, left to right) or a COLUMN (top to bottom)
ARRANGE: ROW
# Align ROWs at the TOP (default), MIDDLE or BOTTOM
# Align COLUMNs at the LEFT (default), MIDDLE or RIGHT
ALIGN: TOP
# The default ORDER is simply the order in which the displays are discovered.
# Define your own.
ORDER:
- 'DP-1'
- 'DP-2'
# Enable scaling, overrides AUTO_SCALE and SCALE
SCALING: TRUE
# The default is to scale each display by DPI.
# This may be disabled and scale 1 will be used, unless a SCALE has been specified.
AUTO_SCALE: TRUE
# Auto scale may be overridden for each display.
SCALE:
#- NAME_DESC: 'monitor description'
# SCALE: 1.75
# Override the preferred mode.
# WARNING: this may result in an unusable display. See https://github.com/alex-courtis/way-displays#known-issues-with-workarounds
# for a possible workaround.
MODE:
# Resolution and refresh
#- NAME_DESC: HDMI-A-1
# WIDTH: 1920
# HEIGHT: 1080
# HZ: 60
# Resolution with highest refresh
#- NAME_DESC: 'monitor description'
# WIDTH: 2560
# HEIGHT: 1440
# Highest available
- NAME_DESC: DP-1
MAX: TRUE
- NAME_DESC: DP-2
MAX: TRUE
# Rotate or translate the display.
# 90, 180, 270, FLIPPED, FLIPPED-90, FLIPPED-180, FLIPPED-270
TRANSFORM:
# - NAME_DESC: 'monitor description'
# TRANSFORM: 270
# VRR / adaptive sync is enabled by default. Disable it per display.
VRR_OFF:
# - DP-2
# - '!.*my monitor.*'
# Laptop displays usually start with eDP e.g. eDP-1. This may be overridden if
# your laptop is different.
#LAPTOP_DISPLAY_PREFIX: 'eDP'
# One of: ERROR, WARNING, INFO (default), DEBUG
LOG_THRESHOLD: INFO
# Disable the specified displays.
DISABLED:
#- "eDP-1"

View File

@ -8,7 +8,8 @@
"river/mode"
],
"modules-center": [
"river/window"
"river/window",
"custom/now_playing"
],
"modules-right": [
"wlr/taskbar",
@ -20,6 +21,13 @@
"num-tags": 9,
"tag-labels": ["1","2","3","4","5","6","7","8","9"]
},
"custom/now_playing": {
"exec": "~/.config/waybar/now_playing.sh",
"return-type": "text",
"format": "{}",
"tooltip": false,
"interval": 900
},
"wlr/taskbar": {
"on-click": "activate",
"on-click-middle": "close",

View File

@ -0,0 +1,4 @@
#!/usr/bin/env sh
NOWPLAYING=$(basename "$(cmus-remote -Q | grep file | cut -f 2- -d ' ')")
echo "{\"text\":\"\"$NOWPLAYING\"}"

View File

@ -30,5 +30,10 @@
target = "waybar";
recursive = true;
};
"way-displays" = {
source = ./dots/way-displays;
target = "way-displays";
recursive = true;
};
};
}