kitten panel cmd vs kitty cmd on x11 and Gnome Ubuntu #8864
Replies: 3 comments
|
I have no idea what you are trying to do. You seem to be running kitty inside the panel kitten? That will simply start a new kitty window. Instead run the actual command you want to run. The panel kitten already creates a new window. And if you want to resize existing panel windows you can do so via remote control, once you enable it, using kitten @ resize-os-window --action=os-panel |
|
Thank you for:
Start a new kitty window
Indeed, that is the purpose of options A and B. Well to start a new kitty panel and also resize it and send a zsh-command. So...
Resize existing panelYour answer
The
My new proposalIf to activate remote control are needed alike next config settings, based on remote-control and conf/#opt-kitty.allow_remote_control ...then it's weird, cause kitty_panel_resize() {
# Example usage: kitty_panel_resize 65 50 false
# 65% width, 50% height of current terminal screen
# 3rd args means false to left align, ergo right align
# https://github.com/kovidgoyal/kitty/discussions/8864
# Get screen dimensions
read screen_width screen_height < <(xdotool getdisplaygeometry)
# Calculate new dimensions
local width_pct="${1:-50}" # Default to 50% if not provided
local height_pct="${2:-100}" # Default to 100% if not provided
local new_width=$((screen_width * width_pct / 100))
local new_height=$((screen_height * height_pct / 100))
# right/left align
local align_left="${3:-true}" # Default to left align
# Resize current Kitty terminal
# Un-maximize the panel screen
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz
# Resize
# https://sw.kovidgoyal.net/kitty/generated/rc/#resize-os-window
kitty @ resize-os-window --unit pixels --width $new_width --height $new_height --action resize
# Align
win_id=$(xdotool getactivewindow)
local align_horiz_px=$((screen_width * 50 / 100))
if $align_left; then
align_horiz_px=0
fi
xdotool windowmove $win_id $align_horiz_px 0
}Further questionsUn-maximize the kitty panelAs soon as I exit the maximized screen I can resize it, so to un-maximize it I propose next ways (2nd and 3rd need answers please):
Align
|
|
I'm afraid I dont have the time to guide you through all that.
I'll just leave you with a couple of tips.
1) The docs for remote control are in
https://sw.kovidgoyal.net/kitty/remote-control/
with docs for individual commands in
https://sw.kovidgoyal.net/kitty/remote-control/#kitten
or just run kitten @ command --help or man ***@***.***
2) You want to change config settings the relevant command is
kitten @ load-config --override
3) You cannot use remote control without either turning it on globally
via kitty.conf *before* starting kitty or using a mapping such as
map f1 launch --allow-remote-control ...
or
map f1 remote_control_script ....
Read the docs for actions you can map at
https://sw.kovidgoyal.net/kitty/actions/
Good luck.
|
Uh oh!
There was an error while loading. Please reload this page.
https://sw.kovidgoyal.net/kitty/kittens_intro/
I wonder about the kitten panel command for my specs (see top: X11 & GNOME), which is full compatible based on Compatibility with various platforms section.
I coded below (
kitty_terminal_newzsh function) how to create a new resized kitty panel, and also send it a zsh-command via:kitty(if true)kitty +kitten panel(else)Notice just the option A works, the B does not proper left align, and no idea how to send commands.
Questions:
Thanks in advance!
PD:
These programs are called kittenssays https://sw.kovidgoyal.net/kitty/kittens_intro/. Maybe the word "kittens" there should be cursive since the word "kitty" is cursive in docs; for consistency. Same happens in most, but not all, "kitten(s)" of https://sw.kovidgoyal.net/kitty/kittens/panel/All reactions