avatsaev / touchbar_nyancat

Stupid nyancat animation on your +$2k MacBook Pro's Touchbar

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How can I keep Nyan Cat always running in the touch bar?

mark248am opened this issue · comments

Is there a way to keep nyan cat always running in the touch bar no matter what application i am in? (preferably without sound)

unfortunately no.

Why not? iTunes can display a song scrubber in the Touch Bar, even when iTunes is not in front.

I want this too!

This would be life-giving. Without sound tho.

My touchbar is still useless, Nyan cat would make it better.

totally need

I'm sorry guys, I have a full time job and not a lot of time, and I don't have a MacBook anymore to test this on 😂

@avatsaev Since you coded this and have more insight how it works, could you give a hint for anyone that is looking into making this feature? It is very important to me to have nyan visible at all times.

According to the official documentation, the gif always staying on the touch bar is not possible.

Finally in 2020, I found a solution.

GIF EXAMPLE

I've been able to use the GIF that was used in this project at the Better Touch Tool (BTT)
so that the nyan cat could remain on the touchbar anywhere.

스크린샷 2020-06-28 오전 3 14 47

The source code is as follows:

var basePath = `/Users/hm/Documents/Touchbar/` // YOUR PATH
var baseName = `nyan-`
var extension = `.png`
var startFrame = 0
var numFrames = 4

var frame = startFrame
var render = () => {
    if (frame == numFrames)
        frame = startFrame

    returnToBTT(JSON.stringify({
        text: ' ',
        icon_path: `${basePath}${baseName}${frame}${extension}`,
        background_color: ""
    }))
    frame++
}

render()
setInterval(render, 200)

Touchbar.zip

After downloading the resources below, you must place them
in the desired path and enter the path in basePath below.

Default.bttpreset.zip

If it's inconvenient to enter the above code,
I think it's a good idea to get my BTT preset.

@hmmhmmhm sickkkk dudeeeee. Thanks!

@hmmhmmhm What a phenomenal workaround! I assume this opens up possibilities for some of the other touchbar apps out there, or anything else really. 👍

EDIT:

For anyone who wants to use @hmmhmmhm 's workaround with the other popular touchbar KnightTouchBar2000:

Download the following zip containing the KITT frames:
kittFrames.zip

Add the files in 'kittFrames' to the directory where you saved the nyan cat touchbar frames.

Then change to these lines in the script (interval should be around 30 or less to be fast enough):

var baseName = `kitt-`
var numFrames = 87
setInterval(render, 30)

Note: The scale of the frames aren't quite exact to the original KnightTouchBar2000 app, being a bit smaller, but I think they look okay. I think its something to do with the area that images can be put into with this workaround.

kittFrames

@Bloumbs Ohh... Wow... Thank you for sharing your wonderful resources. 🥳

commented

I just had an idea of creating and adding NyanCat to the touch bar and apparently, there was already one! Welp, time to add nyan cat to my touch bar 🤣 Thanks for the this and the workaround. 🥳

@hmmhmmhm I'm really new to all this and am having trouble implementing your code. Do you have a preset for just the nyan cat 'button'

@hmmhmmhm U got the download file?

wait wait , I attempted to do this and failed since there was nothing there and only some Japanese letters on my Touch Bar could someone help me out ?

wait wait , I attempted to do this and failed since there was nothing there and only some Japanese letters on my Touch Bar could someone help me out ?

Same for me plz help

We mean for the better touch tool version, I got that one already it’s rlly funny lol

yeah I want the btt always on but it just aint showing

Mhm the @hmmhmmhm person said they were gonna help but never got round to it

also what does the guy mean by putting the images in the directory where's the directory in btt ??

lol this convo has been going on for 4 years

commented

Make sure that you check these in the 'Common' section :

  • Show only icon, no text
  • Icon Width = 600
  • Always show, even if other global actions are hidden.

I did what you said but this what happened. SyntaxError: Unexpected identifier 'nyan'. Expected ';' after variable declaration.
Screen Shot 2021-09-23 at 10 19 49 AM

needs a new update stat