Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Terminal font #251

Closed
Brottweiler opened this issue May 16, 2016 · 7 comments · Fixed by #252
Closed

Terminal font #251

Brottweiler opened this issue May 16, 2016 · 7 comments · Fixed by #252

Comments

@Brottweiler
Copy link

Brottweiler commented May 16, 2016

Description

When displaying GTK2/3 fonts, also display font used in terminal.

Maybe this is harder to look for, since it's specified in the config of the terminal application.

Neofetch version

1.7

@dylanaraps
Copy link
Owner

Here's my reddit comment for clarity:

Terminal font will be more difficult to add due to there being no standard for getting the info.

Neofetch will have to first figure out which terminal emulator it's running inside of to avoid issues when users have more than one type of terminal emulator open at once.

Once we figure out the terminal emulator we need to figure out where it's config file is or if there's a command to get the information.

I have an idea on how to do all this and I will give it a try, there's no guarantee though.

@Brottweiler
Copy link
Author

As soon as I made the issue I realised how it would get the font, since it's in the config file and that's different depending on emulator.

@dylanaraps
Copy link
Owner

dylanaraps commented May 16, 2016

I've started work on this feature, please test out the function below and let me
know if it works.

This function prints the current terminal emulator that neofetch is running from.

Issues

  • Doesn't work when used inside tmux.
getterminalemulator () {
    parent="$(ps -p ${1:-$PPID} -o ppid=)"
    name="$(ps -p $parent -o comm=)"

    case "$name" in
        "${SHELL/*\/}" | *"sh") getterminalemulator "$parent" ;;
        *) terminalemulator="$name" ;;
    esac
}
getterminalemulator

printf "%s\n" "$terminalemulator"

@Brottweiler
Copy link
Author

It detects the terminal emulator properly for me, yes.

@dylanaraps
Copy link
Owner

Awesome, Thanks.

I've just updated the function above and it should now work
when running nested shells.

Example:

  1. Open bash
  2. Open zsh
  3. Open bash
  4. Open bash
  5. etc

The function will still correctly find the terminal emulator.

@dylanaraps
Copy link
Owner

I've opened #252, which aims to close this issue and implement terminal font.

@dylanaraps
Copy link
Owner

dylanaraps commented Jun 2, 2016

#252 will be merged once I do some more testing.

Note:

  • Support for terminal emulators with profile based configs won't be
    included with this PR.
  • Support for tmux won't be included with this PR.

I'm going to open a new issue to track these features.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants