Created a now_playing script for waybar to show currently playing song in cmus
This commit is contained in:
parent
7ccc5cdc19
commit
e5b9b32e4d
80
home-manager/dots/way-displays/cfg.yaml
Normal file
80
home-manager/dots/way-displays/cfg.yaml
Normal 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"
|
||||||
|
|
@ -8,7 +8,8 @@
|
|||||||
"river/mode"
|
"river/mode"
|
||||||
],
|
],
|
||||||
"modules-center": [
|
"modules-center": [
|
||||||
"river/window"
|
"river/window",
|
||||||
|
"custom/now_playing"
|
||||||
],
|
],
|
||||||
"modules-right": [
|
"modules-right": [
|
||||||
"wlr/taskbar",
|
"wlr/taskbar",
|
||||||
@ -20,6 +21,13 @@
|
|||||||
"num-tags": 9,
|
"num-tags": 9,
|
||||||
"tag-labels": ["1","2","3","4","5","6","7","8","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": {
|
"wlr/taskbar": {
|
||||||
"on-click": "activate",
|
"on-click": "activate",
|
||||||
"on-click-middle": "close",
|
"on-click-middle": "close",
|
||||||
|
4
home-manager/dots/waybar/now_playing.sh
Executable file
4
home-manager/dots/waybar/now_playing.sh
Executable file
@ -0,0 +1,4 @@
|
|||||||
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
|
NOWPLAYING=$(basename "$(cmus-remote -Q | grep file | cut -f 2- -d ' ')")
|
||||||
|
echo "{\"text\":\"\"$NOWPLAYING\"}"
|
@ -30,5 +30,10 @@
|
|||||||
target = "waybar";
|
target = "waybar";
|
||||||
recursive = true;
|
recursive = true;
|
||||||
};
|
};
|
||||||
|
"way-displays" = {
|
||||||
|
source = ./dots/way-displays;
|
||||||
|
target = "way-displays";
|
||||||
|
recursive = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user