diff options
author | awy <awy@awy.one> | 2025-07-31 00:40:32 +0300 |
---|---|---|
committer | awy <awy@awy.one> | 2025-07-31 00:40:32 +0300 |
commit | 55f823f367e30b80080c63de1253c6e29b51458d (patch) | |
tree | c8c67c4fbc5e8a37c1cadf645eacc542fc448ab2 | |
parent | 5883ef3bed4ddabc9b89ce6a386090c242110af9 (diff) | |
download | hyprdots-55f823f367e30b80080c63de1253c6e29b51458d.tar.gz |
album cover waybar module
-rw-r--r-- | .config/rmpc/config.ron | 50 | ||||
-rw-r--r-- | .config/rmpc/themes/def.ron | 102 | ||||
-rw-r--r-- | .config/waybar/config.json | 9 | ||||
-rw-r--r-- | .config/waybar/style.css | 10 | ||||
-rwxr-xr-x | .local/bin/rmpcover | 6 |
5 files changed, 99 insertions, 78 deletions
diff --git a/.config/rmpc/config.ron b/.config/rmpc/config.ron index 0818ddb..31ec749 100644 --- a/.config/rmpc/config.ron +++ b/.config/rmpc/config.ron @@ -91,114 +91,114 @@ "d": Delete, "i": ShowInfo, "C": JumpToCurrent, - }, + }, ), search: ( case_sensitive: false, mode: Contains, tags: [ - (value: "any", label: "Any Tag"), - (value: "artist", label: "Artist"), - (value: "album", label: "Album"), - (value: "albumartist", label: "Album Artist"), - (value: "title", label: "Title"), + (value: "any", label: "Any Tag"), + (value: "artist", label: "Artist"), + (value: "album", label: "Album"), + (value: "albumartist", label: "Album Artist"), + (value: "title", label: "Title"), ], ), tabs: [ - ( + ( name: "Queue", border_type: None, pane: Split( direction: Horizontal, panes: [ - ( + ( size: "40%", borders: "RIGHT", pane: Split( direction: Vertical, panes: [ - ( + ( size: "3", pane: Pane(Lyrics), ), - ( + ( size: "100%", pane: Pane(AlbumArt), ) ], ), ), - ( + ( size: "60%", pane: Pane(Queue), ), ], ), ), - ( + ( name: "Directories", border_type: None, pane: Pane(Directories), ), - ( + ( name: "Artists", border_type: None, pane: Pane(Artists), ), - ( + ( name: "Album Artists", border_type: None, pane: Pane(AlbumArtists), ), - ( + ( name: "Albums", border_type: None, pane: Pane(Albums), ), - ( + ( name: "Playlists", border_type: None, pane: Pane(Playlists), ), - ( + ( name: "Search", border_type: None, pane: Pane(Search), ), - ( + ( name: "Testing", border_type: Single, pane: Split( direction: Horizontal, panes: [ - ( + ( size: "40%", pane: Pane(Queue), ), - ( + ( size: "60%", pane: Split( direction: Vertical, panes: [ - ( + ( size: "50%", pane: Pane(Directories), ), - ( + ( size: "50%", pane: Split( direction: Horizontal, panes: [ - ( + ( size: "60%", pane: Split( direction: Vertical, panes: [ - ( + ( size: "50%", pane: Pane(Albums), ), - ( + ( size: "50%", pane: Pane(Artists), ), diff --git a/.config/rmpc/themes/def.ron b/.config/rmpc/themes/def.ron index c4baa27..f64694b 100644 --- a/.config/rmpc/themes/def.ron +++ b/.config/rmpc/themes/def.ron @@ -13,98 +13,98 @@ layout: Split( direction: Vertical, panes: [ - ( + ( size: "4", borders: "ALL", pane: Split( direction: Vertical, panes: [ - ( + ( size: "1", direction: Vertical, pane: Split( direction: Horizontal, panes: [ - ( + ( size: "23", pane: Pane(Property( content: [ - (kind: Text("["), style: (fg: "yellow", modifiers: "Bold")), - (kind: Property(Status(StateV2())), style: (fg: "yellow", modifiers: "Bold")), - (kind: Text("]"), style: (fg: "yellow", modifiers: "Bold")), + (kind: Text("["), style: (fg: "yellow", modifiers: "Bold")), + (kind: Property(Status(StateV2())), style: (fg: "yellow", modifiers: "Bold")), + (kind: Text("]"), style: (fg: "yellow", modifiers: "Bold")), ], align: Left, )), ), - ( + ( size: "100%", borders: "LEFT | RIGHT", pane: Pane(Property( content: [ - (kind: Property(Song(Filename)), style: (modifiers: "Bold"), - default: (kind: Text("No Song"), style: (modifiers: "Bold"))) + (kind: Property(Song(Filename)), style: (modifiers: "Bold"), + default: (kind: Text("No Song"), style: (modifiers: "Bold"))) ], align: Center, scroll_speed: 1 )), ), - ( + ( size: "23", pane: Pane(Property( content: [ - (kind: Property(Widget(Volume)), style: (fg: "blue", modifiers: "Bold")) + (kind: Property(Widget(Volume)), style: (fg: "blue", modifiers: "Bold")) ], align: Right )), ), ], ), ), - ( + ( size: "1", direction: Vertical, pane: Split( direction: Horizontal, panes: [ - ( + ( size: "23", pane: Pane(Property( content: [ - (kind: Property(Status(Elapsed))), - (kind: Text(" / ")), - (kind: Property(Status(Duration))), - (kind: Group([ - (kind: Text(" (")), - (kind: Property(Status(Bitrate))), - (kind: Text(" kbps)")), + (kind: Property(Status(Elapsed))), + (kind: Text(" / ")), + (kind: Property(Status(Duration))), + (kind: Group([ + (kind: Text(" (")), + (kind: Property(Status(Bitrate))), + (kind: Text(" kbps)")), ])), ], align: Left, )), ), - ( + ( size: "100%", borders: "LEFT | RIGHT", pane: Pane(Property( content: [ - (kind: Property(Song(Artist)), style: (fg: "yellow", modifiers: "Bold"), - default: (kind: Text("Unknown"), style: (fg: "yellow", modifiers: "Bold"))), - (kind: Text(" - ")), - (kind: Property(Song(Album)), default: (kind: Text("Unknown Album"))) + (kind: Property(Song(Artist)), style: (fg: "yellow", modifiers: "Bold"), + default: (kind: Text("Unknown"), style: (fg: "yellow", modifiers: "Bold"))), + (kind: Text(" - ")), + (kind: Property(Song(Album)), default: (kind: Text("Unknown Album"))) ], align: Center, scroll_speed: 2 )), ), - ( + ( size: "23", pane: Pane(Property(content: [ - (kind: Property(Status(RepeatV2( + (kind: Property(Status(RepeatV2( on_label: " ", off_label: " ", on_style: (fg: "yellow", modifiers: "Bold"), off_style: (fg: "blue", modifiers: "Dim"), )))), - (kind: Property(Status(RandomV2( + (kind: Property(Status(RandomV2( on_label: " ", off_label: " ", on_style: (fg: "yellow", modifiers: "Bold"), off_style: (fg: "blue", modifiers: "Dim"), )))), - (kind: Property(Status(SingleV2( + (kind: Property(Status(SingleV2( on_label: " ", off_label: " ", oneshot_label: " ", @@ -112,7 +112,7 @@ off_style: (fg: "blue", modifiers: "Dim"), oneshot_style: (fg: "red", modifiers: "Bold"), )))), - (kind: Property(Status(ConsumeV2( + (kind: Property(Status(ConsumeV2( on_label: " ", off_label: " ", oneshot_label: "", @@ -128,40 +128,40 @@ ] ) ), - ( + ( size: "3", borders: "ALL", pane: Pane(Tabs), ), - ( + ( size: "100%", borders: "ALL", background_color: "red", pane: Pane(TabContent), ), - ( + ( size: "3", borders: "ALL", pane: Split( direction: Horizontal, panes: [ - ( + ( pane: Pane(Property(content: [(kind: Property(Status(StateV2(playing_label: " ", paused_label: " ", stopped_label: " ", playing_style: (fg: "blue"), paused_style: (fg: "green"), stopped_style: (fg: "red") - ))))], align: Left)), + ))))], align: Left)), size: "3", ), - ( + ( size: "100%", pane: Pane(ProgressBar), ), - ( + ( size: "13", pane: Pane(Property( content: [ - (kind: Property(Status(Elapsed))), - (kind: Text(" / ")), - (kind: Property(Status(Duration))), + (kind: Property(Status(Elapsed))), + (kind: Text(" / ")), + (kind: Property(Status(Duration))), ], align: Right, )), ), @@ -190,17 +190,17 @@ ), browser_column_widths: [20, 38, 42], browser_song_format: [ - ( + ( kind: Group([ - (kind: Property(Track)), - (kind: Text(" ")), + (kind: Property(Track)), + (kind: Text(" ")), ]) ), - ( + ( kind: Group([ - (kind: Property(Artist)), - (kind: Text(" - ")), - (kind: Property(Title)), + (kind: Property(Artist)), + (kind: Text(" - ")), + (kind: Property(Title)), ]), default: (kind: Property(Filename)) ), @@ -214,20 +214,20 @@ borders_style: (fg: "blue", modifiers: "Bold"), highlight_border_style: (fg: "red"), song_table_format: [ - ( + ( prop: (kind: Property(Other("albumartist")), default: (kind: Property(Artist), default: (kind: Text("Unknown")))), width: "20%", label: "Artist" ), - ( + ( prop: (kind: Property(Title), default: (kind: Text("Unknown"))), width: "35%", ), - ( + ( prop: (kind: Property(Album), default: (kind: Text("Unknown Album"))), width: "45%", ), - ( + ( prop: (kind: Property(Duration),default: (kind: Text("-"))), width: "5", alignment: Right, diff --git a/.config/waybar/config.json b/.config/waybar/config.json index e04c578..4333e54 100644 --- a/.config/waybar/config.json +++ b/.config/waybar/config.json @@ -9,6 +9,7 @@ ], "modules-right": [ "custom/recording", + "image#album-art", "custom/tasks", "custom/music", "custom/packages", @@ -41,6 +42,14 @@ "exec" : "cat /tmp/recordingicon 2> /dev/null" }, + "image#album-art": { + "cursor": "false", + "signal": 11, + "size": 32, + "exec": "rmpcover", + "on-click": "mpc toggle" + }, + "custom/tasks" : { "cursor": false, "tooltip": false, diff --git a/.config/waybar/style.css b/.config/waybar/style.css index 4c4d7e0..3fd3cb2 100644 --- a/.config/waybar/style.css +++ b/.config/waybar/style.css @@ -52,8 +52,14 @@ window#waybar { /* color: #fff; */ } -#custom-test { - color: green; +#image.album-art { + border-radius: 10px; + padding-top: 5px; + padding-bottom: 5px; + padding-right: 10px; +} + +#custom-recording { padding-right: 10px; } diff --git a/.local/bin/rmpcover b/.local/bin/rmpcover new file mode 100755 index 0000000..f737dd1 --- /dev/null +++ b/.local/bin/rmpcover @@ -0,0 +1,6 @@ +#!/bin/sh + +prefix="/mnt/ssd/music" +albumdir=$(rmpc song | jq -r '.file' | sed 's#/[^/]*$##') +final=$(fd . -e jpg -e png -t f "$prefix/$albumdir/" | head -n 1) +echo $final |