Skip to content

Conversation

@bfabio
Copy link

@bfabio bfabio commented Jun 19, 2024

libmacchina uses /proc//comm, which is limited to 15 chars and it's not guaranteed to hold a user friendly name.

For example GNOME Terminal is actually /usr/libexec/gnome-terminal-server and its comm is gnome-terminal-.

Add a replacement function that returns user friendly names and that can be expanded with more.

libmacchina uses /proc/<pid>/comm, which is limited to 15 chars and
it's not guaranteed to hold a user friendly name.

For example GNOME Terminal is actually /usr/libexec/gnome-terminal-server
and its `comm` is `gnome-terminal-`.

Add a replacement function that returns user friendly names and
that can be expanded with more.
@grtcdr
Copy link
Member

grtcdr commented Jun 19, 2024

While the current method for looking up the terminal emulator is a complete hack - it's probably best to ask the display server or compositor what the current window is, but to my knowledge Wayland still does not offer this - this is a good initiative.

Comment on lines 442 to +443
let terminal = terminal_name();
let terminal = terminal_replacements(&terminal);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be a one-liner, the function should also be renamed to convey its function more clearly.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wdyt about terminal_user_friendy_name() or terminal_display_name()?

What do you mean about it being a one liner? Like the whole PR or the changes to terminal_name()?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants