Re: screen hardstatus alwayslastline with sysctl command - solved

From: ft <ml_at_ft-c.de>
Date: Sun, 03 Nov 2024 15:25:13 UTC
Here is the solution

backtick 1 9 9 /sbin/sysctl -n dev.cpu.0.temperature 
backtick 2 9 9 /sbin/sysctl -n dev.cpu.1.temperature 
backtick 3 9 9 /sbin/sysctl -n dev.cpu.2.temperature 
backtick 4 9 9 /sbin/sysctl -n dev.cpu.3.temperature 

hardstatus alwayslastline "%{= RY} %H %{BW} %l %{Gb} %Y-%m-%d %c %{BW} %1` %2`
%3` %4` %="


On Sun, 2024-11-03 at 15:03 +0100, ft wrote:
> Hello, 
> 
> I work with screen.
> 
> it is possible to integrate the command
> $(/sbin/sysctl dev.cpu.0.temperature)
> or (better)
> $(/sbin/sysctl dev.cpu.0.temperature | cut -d ' ' -f 2 )
> into the screen programm into 
> hardstatus alwayslastline? 
> 
> Now my line is:
> hardstatus alwayslastline "%{= RY}%H %{BW}%l %{Gb}%Y-%m-%d %c%="
> it works fine.
> 
> (1)
> "%{= kw}CPU Temp: %{G}$(/bin/sh -c '/sbin/sysctl dev.cpu.0.temperature')"
> doesn't work.
> it prints the command string $(...)
> 
> (2)
> "%{= RY}%H %{BW}%l %{Gb}%Y-%m-%d %c%{BW}$(/sbin/sysctl
> dev.cpu.0.temperature)%="
> doesn't work.
> 
> (3)
> "%{= RY}%H %{BW}%l %{Gb}%Y-%m-%d %c%{BW}$(cat
> /home/ft/skripte/cronjobs/tempft_screen.log)%="
> doesn't work.
>  
> the following command from (3) works:
> (filecontent with current temperature)
> cat /home/ft/skripte/cronjobs/tempft_screen.log
> 62,1
> 
> Have someone an idea to intgrate the sysctl command into the hardstatus?
> 
> Franz
> 
>