You are not logged in.

#1 2021-05-03 05:53:24

AirsoftHamster
Member
Registered: 2020-11-10
Posts: 74

[SOLVED] ZSH only run certain command if in certain terminals

Hi there, I wanted to run neofetch when I open a TTY or kitty. I use the terminal in vscode and jetbrains IDEs quite often, and having neofetch autostart in them is really annoying as I can't see much. Is there a way that I can make neofetch only run if zsh is only running in kitty or a tty. Is this even possible?

Last edited by AirsoftHamster (2021-05-05 16:54:36)

Offline

#2 2021-05-03 07:09:00

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,520

Re: [SOLVED] ZSH only run certain command if in certain terminals

[[ "$(cat /proc/$PPID/comm)" =~ "(kitty|urxvt|xterm)" ]] && neofetch

You can obviously invert the logics to rule out specific terminals. For the console compare the outputs of "tty"

Last edited by seth (2021-05-03 07:09:18)

Online

Board footer

Powered by FluxBB