diff --git a/home/linux/hyprland/default.nix b/home/linux/hyprland/default.nix index 9fd7554c..97646d82 100644 --- a/home/linux/hyprland/default.nix +++ b/home/linux/hyprland/default.nix @@ -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; diff --git a/home/linux/hyprland/hypr-conf/scripts/statusbar b/home/linux/hyprland/hypr-conf/scripts/statusbar index 217feada..84237f2c 100755 --- a/home/linux/hyprland/hypr-conf/scripts/statusbar +++ b/home/linux/hyprland/hypr-conf/scripts/statusbar @@ -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 diff --git a/home/linux/hyprland/hypr-conf/waybar/config b/home/linux/hyprland/hypr-conf/waybar/config.json similarity index 59% rename from home/linux/hyprland/hypr-conf/waybar/config rename to home/linux/hyprland/hypr-conf/waybar/config.json index 314176e0..ce2e95d8 100644 --- a/home/linux/hyprland/hypr-conf/waybar/config +++ b/home/linux/hyprland/hypr-conf/waybar/config.json @@ -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": "\uf001 {title}", - "format-disconnected": "", - "format-paused": "\uf001 {title}", - "format-stopped": "\uf001", - "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} {}", + "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": "", + "Playing": "" + } }, "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" } } diff --git a/home/linux/hyprland/hypr-conf/waybar/style.css b/home/linux/hyprland/hypr-conf/waybar/style.css index ca90d09b..cb5e2d5e 100644 --- a/home/linux/hyprland/hypr-conf/waybar/style.css +++ b/home/linux/hyprland/hypr-conf/waybar/style.css @@ -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); */ diff --git a/home/linux/hyprland/mpd/mpd.conf b/home/linux/hyprland/mpd/mpd.conf new file mode 100644 index 00000000..15c359f4 --- /dev/null +++ b/home/linux/hyprland/mpd/mpd.conf @@ -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"