I made a kitten to go to my 'notes' tab and back #5396
tg0h
started this conversation in
Show and tell
Replies: 2 comments
-
This should help:
2efb8f6
|
Beta Was this translation helpful? Give feedback.
0 replies
-
This is brilliant! Loving these types of kittens! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, just wanted to share a kitten I created.
I created a kitten to quickly go to a tab with my notes, then get back to whatever tab I was in before.
Background
I stopped using tmux but wanted a tmux-sessionizer like experience where I had a session which I could navigate in and out of. In this case, instead of sessions, I wanted a tab I could go to and get out of.
Features
When the kitten is called,
In future
How I made this
This kitten is quite simple — it only needs to get a list of tabs, determine if a tab with a title exists, and then create or go to that tab. (and colour the tab)
I have never made a kitten before — I spent 7 hours looking around the kitty source code, github issues and discussions, the source code of other kittens, and also spent 12 hours speed watching a udemy python course lol.
To get a list of tabs, I looked at the boss class and tried to see if there was a list of tabs I could loop though to inspect. After 3 hours, I eventually figured out I could use the convenient match_tabs method
boss.match_tabs('title:^wiki')
The kitty remote control commands are very well documented, but I found that the internal apis available to a kitty are not as well documented. I eventually figured out that I could look at the remote control commands in the kitty repo to grok what to do (In addition to all the other searching I did). For example, to colour the tab orange, I found that
kitty @ set-tab-color inactive_bg=orange inactive_fg=black
did the trick. With this, I looked atrc/set_tab_color.py
for how to do this via a kitten.A random list of references that I used
Code
Beta Was this translation helpful? Give feedback.
All reactions