fix: waybar, mpd

This commit is contained in:
Ryan Yin
2023-07-26 00:09:40 +08:00
parent bc08dc1949
commit 29129215a5
5 changed files with 106 additions and 40 deletions

View File

@@ -17,6 +17,13 @@
home.file.".gtkrc-2.0".source = ./gtkrc-2.0;
home.file.".config/hypr/wallpapers/wallpaper.png".source = ../wallpapers/wallpaper.png;
# music player - mpd
home.file.".config/mpd" = {
source = ./mpd;
recursive = true;
};
# allow fontconfig to discover fonts and configurations installed through home.packages
fonts.fontconfig.enable = true;

View File

@@ -2,7 +2,7 @@
## launch waybar with alt config
CONFIG="$HOME/.config/hypr/waybar/config"
CONFIG="$HOME/.config/hypr/waybar/config.json"
STYLE="$HOME/.config/hypr/waybar/style.css"
if [[ ! $(pidof waybar) ]]; then

View File

@@ -1,4 +1,45 @@
{
"position": "top",
"layer": "top",
"modules-left": [
"custom/launcher",
"temperature",
"wlr/workspaces"
],
"modules-center": [
"custom/playerctl"
],
"modules-right": [
"mpd",
"pulseaudio",
"backlight",
"memory",
"cpu",
"network",
"clock",
"custom/powermenu",
"tray"
],
"wlr/workspaces": {
"format": "{icon}",
"on-click": "activate",
"format-icons": {
"1": "",
"2": "",
"3": "",
"4": "",
"5": "",
"6": "",
"7": "",
"8": "",
"9": "",
"10": "",
"focused": "",
"default": ""
}
},
"clock": {
"interval": 60,
"align": 0,
@@ -31,7 +72,6 @@
},
"tooltip": false
},
"layer": "top",
"memory": {
"format": "\udb83\udee0 {percentage}%",
"interval": 1,
@@ -39,37 +79,40 @@
"warning": 85
}
},
"modules-center": [
"clock"
],
"modules-left": [
"custom/launcher",
"temperature",
"mpd",
"custom/cava-internal"
],
"modules-right": [
"pulseaudio",
"backlight",
"memory",
"cpu",
"network",
"custom/powermenu",
"tray"
],
"mpd": {
"format": "<span foreground='#bb9af7'>\uf001</span> {title}",
"format-disconnected": "",
"format-paused": "\uf001 {title}",
"format-stopped": "<span foreground='#bb9af7'>\uf001</span>",
"max-length": 25,
"on-click": "mpc --quiet toggle",
"on-click-middle": "kitty --class='ncmpcpp' ncmpcpp ",
"on-click-right": "mpc update; mpc ls | mpc add",
"on-scroll-down": "mpc --quiet next",
"on-scroll-up": "mpc --quiet prev",
"smooth-scrolling-threshold": 5,
"tooltip-format": "{title} - {artist} ({elapsedTime:%M:%S}/{totalTime:%H:%M:%S})"
"interval": 2,
"unknown-tag": "N/A",
"format": "{stateIcon} {artist} - {title}",
"format-disconnected": " Disconnected",
"format-paused": "{stateIcon} {artist} - {title}",
"format-stopped": "Stopped ",
"state-icons": {
"paused": "",
"playing": ""
},
"tooltip-format": "MPD (connected)",
"tooltip-format-disconnected": "MPD (disconnected)",
// Commands to execute on events
"on-click": "mpc toggle",
"on-click-middle": "mpc prev",
"on-click-right": "mpc next",
"on-update": "",
"on-scroll-up": "mpc seek +00:00:01",
"on-scroll-down": "mpc seek -00:00:01",
"smooth-scrolling-threshold": 1
},
"custom/playerctl": {
"format": "{icon} <span>{}</span>",
"return-type": "json",
"max-length": 55,
"exec": "playerctl -a metadata --format '{\"text\": \" {{markup_escape(title)}}\", \"tooltip\": \"{{playerName}} : {{markup_escape(title)}}\", \"alt\": \"{{status}}\", \"class\": \"{{status}}\"}' -F",
"on-click-middle": "playerctl previous",
"on-click": "playerctl play-pause",
"on-click-right": "playerctl next",
"format-icons": {
"Paused": "<span foreground='#6dd9d9'></span>",
"Playing": "<span foreground='#82db97'></span>"
}
},
"network": {
"interval": 5,
@@ -79,10 +122,9 @@
"format-linked": " {ifname} (No IP)",
"format-disconnected": "睊 Disconnected",
"format-disabled": "睊 Disabled",
"format-format": " {bandwidthUpBits} |  {bandwidthDownBits}",
"tooltip-alt": " {ifname} via {gwaddr}",
"format-alt": " {bandwidthUpBits} |  {bandwidthDownBits}",
"tooltip-format": " {ifname} via {gwaddr}",
},
"position": "top",
"pulseaudio": {
//"format": "{volume}% {icon} {format_source}",
"format": "{icon} {volume}%",
@@ -117,9 +159,5 @@
"tray": {
"icon-size": 15,
"spacing": 5
},
"wlr/workspaces": {
"format": "{icon}",
"on-click": "activate"
}
}

View File

@@ -78,7 +78,11 @@ tooltip label {
#pulseaudio,
#network,
#battery,
#custom-powermenu,
#custom-powermenu {
padding-left: 10px;
padding-right: 10px;
}
/* #mode { */
/* margin-left: 10px; */
/* background-color: rgb(248, 189, 150); */

View File

@@ -0,0 +1,17 @@
# Recommended location for database
db_file "~/.config/mpd/database"
# If running mpd using systemd, delete this line to log directly to systemd.
log_file "syslog"
# The music directory is by default the XDG directory, uncomment to amend and choose a different directory
#music_directory "~/Music"
# Uncomment to refresh the database whenever files in the music_directory are changed
#auto_update "yes"
# Uncomment to enable the functionalities
#playlist_directory "~/.config/mpd/playlists"
#pid_file "~/.config/mpd/pid"
#state_file "~/.local/state/mpd/state"
#sticker_file "~/.config/mpd/sticker.sql"