Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HELP shell script formatting ignored? #514

Open
101Dude opened this issue Aug 21, 2023 · 1 comment
Open

HELP shell script formatting ignored? #514

101Dude opened this issue Aug 21, 2023 · 1 comment

Comments

@101Dude
Copy link

101Dude commented Aug 21, 2023

Just started using uebersicht. moving from GeekTool.

I have a shell script that has formatting built in. A bunch of functions that I call at the end of the script.

How can I pass the formatting through without uebersicht interfering?

An example. In this case the output


#ANSI Colors
W="\033[38;5;250m" #Light Grey
BK="\033[38;5;0m"
O="\033[38;5;214m"
G="\033[38;5;76m"
NC="\033[0m"

#### FUNCTION BEGIN
header() {
  MYTIME="$(date "+%[%X%]")"
  script_name=$(basename "$0" \
  |tr '[:lower:]' '[:upper:]')
  
  printf  '%b\n' "${BK}${MYTIME} — ${script_name}" \
  "$(ps -o pid,uid,time,pcpu,comm,xstat $$ |column -t)
  ${NC}"
}

header

Using the same shell script - uebersicht on top and GeekTool on bottom. I am looking for output like I see from GeekTool

Screenshot 2023-08-20 at 8 58 11 PM
@fsmbrad
Copy link

fsmbrad commented Jan 12, 2024

Have you tried wrapping your output in pre tags? Something like this:

command: """
header() {
  MYTIME="$(date "+%[%X%]")"
  script_name=$(basename "$0" \
  |tr '[:lower:]' '[:upper:]')
  
  printf  '%b\n' "${BK}${MYTIME} — ${script_name}" \
  "$(ps -o pid,uid,time,pcpu,comm,xstat $$ |column -t)
  ${NC}"
}

header
""";

refreshFrequency: 60000

style: """
  top: 10%;
  left: 10px;
  width: auto;
  margin: auto;

pre {
  text-align: left;
  color: black
}
"""

render: (output) -> """
<pre>#{output}</pre>
"""

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

No branches or pull requests

2 participants