Jump to content


zaccomass

Member Since 1 Feb 2012
Offline Last Active 23 Jan 2020 11:42
-----

Posts I've Made

In Topic: help hotkey function

17 October 2019 - 08:48

Hi,

 

 

I found out that the PPanel was missing

 

yes that's right, you want a example ok here a short one;

 

put a script with name memory_capacity.sh in the directory /usr/script, then make it executable with the following command;

chmod 755 /usr/script/memory_capacity.sh

the content of the script with name memory_capacity.sh looks as following;

#!/bin/sh

TMP=/tmp
READFILE=$TMP/memory_capacity.txt
rm -f $READFILE
df -h >> $READFILE &&

FESTPLATTEN_MOUNT="/media/hdd"
PLATTE="$(cat /tmp/memory_capacity.txt | grep -m1 "$FESTPLATTEN_MOUNT$" | awk '{print $1}')"
SIZE_0="$(cat /tmp/memory_capacity.txt | grep -m1 "$FESTPLATTEN_MOUNT$" | awk '{print $2}')"
USED_0="$(cat /tmp/memory_capacity.txt | grep -m1 "$FESTPLATTEN_MOUNT$" | awk '{print $3}')"
AVAILABLE_0="$(cat /tmp/memory_capacity.txt | grep -m1 "$FESTPLATTEN_MOUNT$" | awk '{print $4}')"
USED_IN_PERCENT_0="$(cat /tmp/memory_capacity.txt | grep -m1 "$FESTPLATTEN_MOUNT$" | awk '{print $5}')"
MOUNTED_ON_0="$(cat /tmp/memory_capacity.txt | grep -m1 "$FESTPLATTEN_MOUNT$" | awk '{print $6}')"

USBSTICK_MOUNT="/media/usb"
USBSTICK="$(cat /tmp/memory_capacity.txt | grep "$USBSTICK_MOUNT$" | awk '{print $1}')"
SIZE_0_0="$(cat /tmp/memory_capacity.txt | grep "$USBSTICK_MOUNT$" | awk '{print $2}')"
USED_0_0="$(cat /tmp/memory_capacity.txt | grep "$USBSTICK_MOUNT$" | awk '{print $3}')"
AVAILABLE_0_0="$(cat /tmp/memory_capacity.txt | grep "$USBSTICK_MOUNT$" | awk '{print $4}')"
USED_IN_PERCENT_0_0="$(cat /tmp/memory_capacity.txt | grep "$USBSTICK_MOUNT$" | awk '{print $5}')"
MOUNTED_ON_0_0="$(cat /tmp/memory_capacity.txt | grep "$USBSTICK_MOUNT$" | awk '{print $6}')"

UBI0_ROOTFS="/"
SIZE="$(cat /tmp/memory_capacity.txt | grep "$UBI0_ROOTFS$" | awk '{print $2}')"
USED="$(cat /tmp/memory_capacity.txt | grep "$UBI0_ROOTFS$" | awk '{print $3}')"
AVAILABLE="$(cat /tmp/memory_capacity.txt | grep "$UBI0_ROOTFS$" | awk '{print $4}')"
USED_IN_PERCENT="$(cat /tmp/memory_capacity.txt | grep "$UBI0_ROOTFS$" | awk '{print $5}')"
MOUNTED_ON="$(cat /tmp/memory_capacity.txt | grep "$UBI0_ROOTFS$" | awk '{print $6}')"

#TMPFS="/dev$"
TMPFS="devtmpfs"
SIZE_1="$(cat /tmp/memory_capacity.txt | grep -m 1 "$TMPFS" | awk '{print $2}')"
USED_1="$(cat /tmp/memory_capacity.txt | grep -m 1 "$TMPFS" | awk '{print $3}')"
AVAILABLE_1="$(cat /tmp/memory_capacity.txt | grep -m 1 "$TMPFS" | awk '{print $4}')"
USED_IN_PERCENT_1="$(cat /tmp/memory_capacity.txt | grep -m 1 "$TMPFS" | awk '{print $5}')"
MOUNTED_ON_1="$(cat /tmp/memory_capacity.txt | grep -m 1 "$TMPFS" | awk '{print $6}')"

TMPFS_2="/var/volatile"
SIZE_2="$(cat /tmp/memory_capacity.txt | grep "$TMPFS_2" | awk '{print $2}')"
USED_2="$(cat /tmp/memory_capacity.txt | grep "$TMPFS_2" | awk '{print $3}')"
AVAILABLE_2="$(cat /tmp/memory_capacity.txt | grep "$TMPFS_2" | awk '{print $4}')"
USED_IN_PERCENT_2="$(cat /tmp/memory_capacity.txt | grep "$TMPFS_2" | awk '{print $5}')"
MOUNTED_ON_2="$(cat /tmp/memory_capacity.txt | grep "$TMPFS_2" | awk '{print $6}')"

echo -e "\tFestplatte:"
echo -e "Platte:\t\t $PLATTE"
echo -e "Speicherplatz gesammt:\t $SIZE_0"
echo -e "Speicherplatz (frei):\t $AVAILABLE_0"
echo -e "Speicherplatz belegt:\t $USED_0"
echo -e "Speicherplatz belegt (%):\t $USED_IN_PERCENT_0"
echo -e "Gemountet nach:\t $MOUNTED_ON_0\n"

echo -e "\tUsb-Stick:"
echo -e "Stick:\t\t $USBSTICK"
echo -e "Speicherplatz gesammt:\t $SIZE_0_0"
echo -e "Speicherplatz (frei):\t $AVAILABLE_0_0"
echo -e "Speicherplatz belegt:\t $USED_0_0"
echo -e "Speicherplatz belegt (%):\t $USED_IN_PERCENT_0_0"
echo -e "Gemountet nach:\t $MOUNTED_ON_0_0\n"

echo -e "\tubi0:rootfs"
echo -e "Speicherplatz gesammt:\t $SIZE"
echo -e "Speicherplatz (frei):\t $AVAILABLE"
echo -e "Speicherplatz belegt:\t $USED"
echo -e "Speicherplatz belegt (%):\t $USED_IN_PERCENT"
echo -e "Gemountet nach:\t $MOUNTED_ON\n"

echo -e "\ttmpfs"
echo -e "Platz gesammt:\t\t $SIZE_1"
echo -e "Platz (frei):\t\t $AVAILABLE_1"
echo -e "Platz belegt:\t\t $USED_1"
echo -e "Platz belegt (%):\t\t $USED_IN_PERCENT_1"
echo -e "Gemountet nach:\t $MOUNTED_ON_1\n"

echo -e "\ttmpfs"
echo -e "Platz gesammt:\t\t $SIZE_2"
echo -e "Platz (frei):\t\t $AVAILABLE_2"
echo -e "Platz belegt:\t\t $USED_2"
echo -e "Platz belegt (%):\t\t $USED_IN_PERCENT_2"
echo -e "Gemountet nach:\t $MOUNTED_ON_2\n"


exit

and now you need in /etc/ppanel a file in this case with name my.xml with the following content;

<directory name="My PPanel">
	<execute name="Speicherplatz Anzeige" target="sh /usr/script/memory_capacity.sh" quit="exit"/>
	</directory>


and at last put the plugin ppanel to a button with hotkey if you want.

 

 

regards

Pike

Thanks very kind


In Topic: help hotkey function

16 October 2019 - 09:41

this is the script

 

#!/bin/sh
#PAUSE/PLAY
#
THIS COMMAND FOR PAUSE
======================
wget -q -O - http://127.0.0.1/web...rol?command=164 >/dev/null (COMMAND PAUSE/PLAY)


at this point I need a command that waits for me to press the same key or any other key to resume with play (next line)
PS. I tried the read command but it doesn't work

 
 
wget -q -O - http://127.0.0.1/web...rol?command=164 >/dev/null (COMMAND PAUSE/PLAY)


In Topic: help hotkey function

16 October 2019 - 09:34

Finally I managed to get my scripts working through the Hotkey function, I found out that the PPanel was missing, installed that now goes. I have only one problem when I run the script that has to pause me, I can't insert the key waiting command which, once pressed, starts streaming again.


In Topic: help hotkey function

16 October 2019 - 06:49

if it is not important for you to start a script with only one button you can try the plugin ppanel, i use both (hotkey and ppanel)

for ppanel we have a .xml to start scripts betweeen.

 

 

regards

Pike

Give me an example
with ppanel with an .xml with the keys I need (see above)


In Topic: help hotkey function

15 October 2019 - 13:51

I tried but by pressing the yellow button it goes into audio .... it doesn't go