felixhageloh / uebersicht

ˈyːbɐˌzɪçt
GNU General Public License v3.0
4.6k stars 165 forks source link

HELP shell script formatting ignored? #514

Open 101Dude opened 1 year ago

101Dude commented 1 year ago

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 commented 10 months ago

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>
"""