File tree Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -56,10 +56,6 @@ particular desktop, but it should work for most major desktop environments.
5656 # Update the paths to the kitty and its icon in the kitty.desktop file(s)
5757 sed -i " s|Icon=kitty|Icon=/home/$USER /.local/kitty.app/share/icons/hicolor/256x256/apps/kitty.png|g" ~ /.local/share/applications/kitty* .desktop
5858 sed -i " s|Exec=kitty|Exec=/home/$USER /.local/kitty.app/bin/kitty|g" ~ /.local/share/applications/kitty* .desktop
59- # Install the man pages
60- mkdir -p ~ /.local/share/man/man1 ~ /.local/share/man/man5
61- ln -s ~ /.local/kitty.app/share/man/man1/kitty.1 ~ /.local/share/man/man1
62- ln -s ~ /.local/kitty.app/share/man/man5/kitty.conf.5 ~ /.local/share/man/man5
6359
6460 .. note ::
6561 In :file: `kitty-open.desktop `, kitty is registered to handle some supported
Original file line number Diff line number Diff line change @@ -318,6 +318,22 @@ def ensure_kitty_in_path() -> None:
318318 os .environ ['PATH' ] = prepend_if_not_present (rpath , env_path )
319319
320320
321+ def setup_manpath (env : Dict [str , str ]) -> None :
322+ # Ensure kitty manpages are available in frozen builds
323+ if not getattr (sys , 'frozen' , False ):
324+ return
325+ from .constants import local_docs
326+ mp = os .environ .get ('MANPATH' , env .get ('MANPATH' , '' ))
327+ d = os .path .dirname
328+ kitty_man = os .path .join (d (d (d (local_docs ()))), 'man' )
329+ if not mp :
330+ env ['MANPATH' ] = f'{ kitty_man } :'
331+ elif mp .startswith (':' ):
332+ env ['MANPATH' ] = f':{ kitty_man } :{ mp } '
333+ else :
334+ env ['MANPATH' ] = f'{ kitty_man } :{ mp } '
335+
336+
321337def setup_environment (opts : Options , cli_opts : CLIOptions ) -> None :
322338 from_config_file = False
323339 if not cli_opts .listen_on and opts .listen_on .startswith ('unix:' ):
@@ -334,6 +350,7 @@ def setup_environment(opts: Options, cli_opts: CLIOptions) -> None:
334350 # the other values mean the user doesn't want a PATH
335351 if child_path not in ('' , DELETE_ENV_VAR ) and child_path is not None :
336352 env ['PATH' ] = prepend_if_not_present (os .path .dirname (kitty_path ), env ['PATH' ])
353+ setup_manpath (env )
337354 set_default_env (env )
338355
339356
You can’t perform that action at this time.
0 commit comments