avatsaev / touchbar_nyancat

Stupid nyancat animation on your +$2k MacBook Pro's Touchbar
2.99k stars 155 forks source link

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

Open mark248am opened 7 years ago

mark248am commented 7 years ago

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

avatsaev commented 7 years ago

unfortunately no.

ryandesign commented 7 years ago

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

shannonio commented 7 years ago

I want this too!

FrancescoSaverioZuppichini commented 7 years ago

Yes please :)

kgotiwale commented 6 years ago

This would be life-giving. Without sound tho.

shannonio commented 6 years ago

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

looneym commented 6 years ago

image

kilinkis commented 5 years ago

totally need

avatsaev commented 5 years ago

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 πŸ˜‚

sanderfoobar commented 5 years ago

@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.

andermattmarco commented 5 years ago

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

hmmhmmhm commented 4 years ago

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.

kilinkis commented 4 years ago

@hmmhmmhm sickkkk dudeeeee. Thanks!

956MB commented 4 years ago

@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

hmmhmmhm commented 4 years ago

@Bloumbs Ohh... Wow... Thank you for sharing your wonderful resources. πŸ₯³

mikoyats commented 4 years ago

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. πŸ₯³

DANRKX commented 3 years ago

@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'

DANRKX commented 3 years ago

@hmmhmmhm U got the download file?

Taha101x commented 3 years ago

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 ?

DANRKX commented 3 years ago

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

avatsaev commented 3 years ago

Official downloads are here: https://github.com/avatsaev/touchbar_nyancat/releases

DANRKX commented 3 years ago

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

Taha101x commented 3 years ago

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

DANRKX commented 3 years ago

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

Taha101x commented 3 years ago

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

Taha101x commented 3 years ago

lol this convo has been going on for 4 years

hamza-salah commented 3 years ago

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

Jake-ops commented 3 years ago

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
Taha101x commented 3 years ago

needs a new update stat