From c18d9186611bb3f25178d53ed2985eee278a42ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Gabriel?= Date: Thu, 17 Sep 2020 00:26:08 -0300 Subject: [PATCH 1/6] add vlc support, and fixes multiple active players conflict bug. --- conky/np.lua | 11 ++++++++--- conky/npart.lua | 10 ++++++---- scripts/fetch-art | 11 +++++++++-- 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/conky/np.lua b/conky/np.lua index d8e68bd..7dc8adc 100644 --- a/conky/np.lua +++ b/conky/np.lua @@ -33,14 +33,19 @@ conky.config = { conky.text = [[ ${if_running spotify}${color #fff}${font Gotham Book:pixelsize=18}NOW PLAYING: ${color #fff}${font Gotham Book:pixelsize=15} - ${color #fff}${font Gotham:style=bold:pixelsize=44} ${font Gotham:style=bold:pixelsize=46}${exec playerctl -p spotify metadata artist}${font Gotham:style=bold:pixelsize=10} ${color #fff}${font Gotham Book:pixelsize=44} ${font Gotham Book:pixelsize=23}${exec playerctl -p spotify metadata title} -${else}${if_running cmus}${color #fff}${font Gotham Book:pixelsize=18}NOW PLAYING: + +${else}${if_match "" != "${exec playerctl -p vlc status}"}${color #fff}${font Gotham Book:pixelsize=18}NOW PLAYING: ${color #fff}${font Gotham Book:pixelsize=15} +${color #fff}${font Gotham:style=bold:pixelsize=44} ${font Gotham:style=bold:pixelsize=46}${exec playerctl -p vlc metadata artist}${font Gotham:style=bold:pixelsize=10} +${color #fff}${font Gotham Book:pixelsize=44} ${font Gotham Book:pixelsize=23}${exec playerctl -p vlc metadata title} +${else}${if_running cmus}${color #fff}${font Gotham Book:pixelsize=18}NOW PLAYING: +${color #fff}${font Gotham Book:pixelsize=15} ${color #fff}${font Gotham:style=bold:pixelsize=44} ${font Gotham:style=bold:pixelsize=46}${exec cmus-remote -Q 2>/dev/null | grep 'tag artist' | cut -d " " -f 3-}${font Gotham:style=bold:pixelsize=10} ${color #fff}${font Gotham:style=bold:pixelsize=44} ${font Gotham Book:pixelsize=23}${exec cmus-remote -Q 2>/dev/null | grep title | cut -d " " -f 3- } + ${else}${color #fff}${font Gotham Book:pixelsize=80}${time %H:%M:%S}${font Gotham Book:pixelsize=65} -${color #fff}${font Montserrat Light:pixelsize=35}${time %B} ${time %d}${if_match ${time %d}==1}st${else}${if_match ${time %d}==2}nd${else}${if_match ${time %d}==3}rd${else}${if_match ${time %d}==4}th${else}${if_match ${time %d}==5}th${else}${if_match ${time %d}==5}th${else}${if_match ${time %d}==7}th${else}${if_match ${time %d}==8}th${else}${if_match ${time %d}==9}th${else}${if_match ${time %d}==10}th${else}${if_match ${time %d}==11}th${else}${if_match ${time %d}==12}th${else}${if_match ${time %d}==13}th${else}${if_match ${time %d}==14}th${else}${if_match ${time %d}==15}th${else}${if_match ${time %d}==16}th${else}${if_match ${time %d}==17}th${else}${if_match ${time %d}==18}th${else}${if_match ${time %d}==19}th${else}${if_match ${time %d}==20}th${else}${if_match ${time %d}==21}st${else}${if_match ${time %d}==22}nd${else}${if_match ${time %d}==23}rd${else}${if_match ${time %d}==24}th${else}${if_match ${time %d}==25}th${else}${if_match ${time %d}==26}th${else}${if_match ${time %d}==27}th${else}${if_match ${time %d}==28}th${else}${if_match ${time %d}==29}th${else}${if_match ${time %d}==30}th${else}${if_match ${time %d}==31}st${else}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif} ${time %Y}${endif}${endif} +${color #fff}${font Montserrat Light:pixelsize=35}${time %B} ${time %d}${if_match ${time %d}==1}st${else}${if_match ${time %d}==2}nd${else}${if_match ${time %d}==3}rd${else}${if_match ${time %d}==4}th${else}${if_match ${time %d}==5}th${else}${if_match ${time %d}==5}th${else}${if_match ${time %d}==7}th${else}${if_match ${time %d}==8}th${else}${if_match ${time %d}==9}th${else}${if_match ${time %d}==10}th${else}${if_match ${time %d}==11}th${else}${if_match ${time %d}==12}th${else}${if_match ${time %d}==13}th${else}${if_match ${time %d}==14}th${else}${if_match ${time %d}==15}th${else}${if_match ${time %d}==16}th${else}${if_match ${time %d}==17}th${else}${if_match ${time %d}==18}th${else}${if_match ${time %d}==19}th${else}${if_match ${time %d}==20}th${else}${if_match ${time %d}==21}st${else}${if_match ${time %d}==22}nd${else}${if_match ${time %d}==23}rd${else}${if_match ${time %d}==24}th${else}${if_match ${time %d}==25}th${else}${if_match ${time %d}==26}th${else}${if_match ${time %d}==27}th${else}${if_match ${time %d}==28}th${else}${if_match ${time %d}==29}th${else}${if_match ${time %d}==30}th${else}${if_match ${time %d}==31}st${else}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif} ${time %Y}${endif}${endif}${endif} ]]; diff --git a/conky/npart.lua b/conky/npart.lua index 46a8577..b318a01 100644 --- a/conky/npart.lua +++ b/conky/npart.lua @@ -27,10 +27,12 @@ conky.config = { conky.text = [[ ${if_running spotify}${exec ./scripts/fetch-art spotify} -${image ./data/spotify.png -p 0,0 -s 125x125 -n} + ${image ./data/spotify.png -p 0,0 -s 125x125 -n} +${else}${if_match "" != "${exec playerctl -p vlc status}"}${exec ./scripts/fetch-art vlc} + ${image ./data/vlc.png -p 0,0 -s 125x125 -n} +${else}${if_running cmus}${exec ./scripts/fetch-art cmus} + ${image ./data/cmus.png -p 0,0 -s 125x125 -n} +${endif} ${endif} - -${if_running cmus}${exec ./scripts/fetch-art cmus} -${image ./data/cmus.png -p 0,0 -s 125x125 -n} ${endif} ]]; diff --git a/scripts/fetch-art b/scripts/fetch-art index 0fa4dc1..8a1576c 100755 --- a/scripts/fetch-art +++ b/scripts/fetch-art @@ -21,9 +21,16 @@ if [ "$source" = spotify ]; then fi url="$(playerctl -p spotify metadata mpris:artUrl | sed 's;https://open.spotify.com;http://i.scdn.co;g')" +elif [ "$source" = vlc ]; then + if ! command -v playerctl >/dev/null; then + echo "Missing playerctl!" + exit 1 + fi + + url="$(playerctl -p vlc metadata mpris:artUrl)" elif [ "$source" = cmus ]; then - if ! command -v cmus-remote >/dev/null; then - echo "Missing cmus-remote!" + if ! command -v ffmpeg >/dev/null; then + echo "Missing ffmpeg!" exit 1 fi From 632be33f729f8e011b91b66d9a087c927ca57382 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Gabriel?= Date: Thu, 17 Sep 2020 00:28:11 -0300 Subject: [PATCH 2/6] add vlc support to REAMDME.MD --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 0c30ab6..4604569 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,7 @@ ### Supported Players - [Spotify](https://www.spotify.com/) +- [VLC](https://www.videolan.org/) - [cmus](https://cmus.github.io/) ## Installation From 17059ee5856c4c2c3e25d3f117f21f5cfdfcc789 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Gabriel?= Date: Thu, 17 Sep 2020 00:38:24 -0300 Subject: [PATCH 3/6] fix bug from recent commit: checks wrong executable when getting cmus art --- scripts/fetch-art | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/fetch-art b/scripts/fetch-art index 8a1576c..a749c32 100755 --- a/scripts/fetch-art +++ b/scripts/fetch-art @@ -29,8 +29,8 @@ elif [ "$source" = vlc ]; then url="$(playerctl -p vlc metadata mpris:artUrl)" elif [ "$source" = cmus ]; then - if ! command -v ffmpeg >/dev/null; then - echo "Missing ffmpeg!" + if ! command -v cmus-remote >/dev/null; then + echo "Missing cmus-remote!" exit 1 fi From 4c43f7035deb521cd2ba094da53b1738f5d4a32e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Gabriel?= Date: Sun, 4 Oct 2020 11:58:29 -0300 Subject: [PATCH 4/6] zombie player detectin, bugfix. --- conky/np.lua | 2 +- conky/npart.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/conky/np.lua b/conky/np.lua index 7dc8adc..ce0c749 100644 --- a/conky/np.lua +++ b/conky/np.lua @@ -31,7 +31,7 @@ conky.config = { }; conky.text = [[ -${if_running spotify}${color #fff}${font Gotham Book:pixelsize=18}NOW PLAYING: +${if_match "" != "${exec playerctl -p spotify status}}${color #fff}${font Gotham Book:pixelsize=18}NOW PLAYING: ${color #fff}${font Gotham Book:pixelsize=15} ${color #fff}${font Gotham:style=bold:pixelsize=44} ${font Gotham:style=bold:pixelsize=46}${exec playerctl -p spotify metadata artist}${font Gotham:style=bold:pixelsize=10} ${color #fff}${font Gotham Book:pixelsize=44} ${font Gotham Book:pixelsize=23}${exec playerctl -p spotify metadata title} diff --git a/conky/npart.lua b/conky/npart.lua index b318a01..9a0e4e8 100644 --- a/conky/npart.lua +++ b/conky/npart.lua @@ -26,7 +26,7 @@ conky.config = { }; conky.text = [[ -${if_running spotify}${exec ./scripts/fetch-art spotify} +${if_match "" != "${exec playerctl -p spotify status}}${exec ./scripts/fetch-art spotify} ${image ./data/spotify.png -p 0,0 -s 125x125 -n} ${else}${if_match "" != "${exec playerctl -p vlc status}"}${exec ./scripts/fetch-art vlc} ${image ./data/vlc.png -p 0,0 -s 125x125 -n} From dd1e271fcb791cd6fbe4a16782a2492bf86dac23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Gabriel?= Date: Fri, 30 Jul 2021 22:41:34 -0300 Subject: [PATCH 5/6] Update README.md --- README.md | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/README.md b/README.md index 4604569..4b63fea 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@

Now Clocking

-

Made with :heart: by @gamehelp16 and @Rayzr522

+

Made with :heart: by @gamehelp16, @Rayzr522 and @jgabriel98

> **Now Clocking** is a Conky widget which shows a Monstercat style Now Playing when music is played via Spotify or cmus, or a clock when no music is playing. @@ -72,13 +72,3 @@ $ path/to/now-clocking/start.sh > **Why are there 2 Conky widgets?** Originally, this had to do with weird transparency issues in Conky that required a non-transparent album artwork. However, that has long since been patched in Conky. The widgets have remained separated, however, so as to make aligning everything easier, especially since one widget functions both as the track info *and* a clock. - -## Credits - -Huge props to the original creator, [@gamehelp16](https://github.com/gamehelp16). I used this script back in 2017/2018 and rediscovered it in 2020, and decided to rework it to be more portable, efficient, and updated to modern Conky config standards. - -Also huge props to Hoefler & Frere-Jones for the wonderful Gotham fonts, and Julieta Ulanovsky (and crew) for the slick Montserrat font. - -## Join Me - -[![Discord Badge](https://github.com/Rayzr522/ProjectResources/raw/master/RayzrDev/badge-small.png)](https://rayzr.dev/join) From f781a25b8458228bb59dc0f3dc85f88de8adf713 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Gabriel?= Date: Fri, 30 Jul 2021 22:42:03 -0300 Subject: [PATCH 6/6] Update README.md --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 4b63fea..4e621c2 100644 --- a/README.md +++ b/README.md @@ -16,8 +16,6 @@ - [Supported Players](#supported-players) - [Installation](#installation) - [FAQ](#faq) -- [Credits](#credits) -- [Join Me](#join-me) ## Requirements