maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   [Announce] QtLockscreen: highly configurable lockscreen replacement (https://talk.maemo.org/showthread.php?t=75150)

sakya 2012-05-07 21:30

Re: [Announce] QtLockscreen: highly configurable lockscreen replacement
 
Quote:

Originally Posted by D@vIcHoJD (Post 1203229)
How I can add the widget of the cpu, memory and IP, which is in the screenshot.

The widget in the screenshot is made by this script (put it in /opt/qtlockscreen and call it sysinfo.sh):
Code:

#!/bin/sh
echo `awk '{print $1/1000" MHz"}' /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq`

echo `awk '/mT/ {memttl = $2}; /mF/ {memfre = $2}; /Bu/ {membff = $2}; $1 == "Cached:" {memcch = $2} END {printf ("%.1f MB\n",(memttl-memfre-membff-memcch)/1024)}' /proc/meminfo`

CONN=$(/sbin/route | awk '/default/ {print $NF}')
IP="-"
if [ "$CONN" == "wlan0" ]; then
    IP=$(/sbin/ifconfig wlan0 | awk -F "[: ]" '/Bc/ {print $13}')
fi

if [ "$CONN" == "gprs0" ]; then
    IP=$(/sbin/ifconfig gprs0 | awk -F "[: ]" '/P-t-P/ {print $13}')
fi
echo -n $IP

And these widgets in the config file (one for the background, one for the text and one for the values from the script):
Code:

[SystemInfoBackground]
PosL="5;220"
PosP="5;220"
SizeP="150;70"
SizeL="150;70"
Radius=5
Color="0;0;0;150"

[SystemInfoText]
PosL="8;220"
PosP="8;220"
SizeP="150;70"
SizeL="150;70"
Font=";12;normal;0"
Color="50;255;25;255"
Alignment="left;center"
Multiline=1
Text="CPU:\nMem:\nIP:"

[SystemInfo]
PosL="5;220"
PosP="5;220"
SizeP="147;70"
SizeL="147;70"
Font=";12;normal;0"
Alignment="right;center"
Multiline=1
Command="/opt/qtlockscreen/sysinfo.sh"
UpdateIntervalSeconds=1

You need to add the widgets in the widget list (adjust the numbers and don't forget to update the size field):
Code:

Widgets\25\Name="Rect.SystemInfoBackground"
Widgets\26\Name="Text.SystemInfoText"
Widgets\27\Name="TextCommand.SystemInfo"

For info on available widgets and some info refer to the wiki:
http://wiki.maemo.org/QtLockscreen

D@vIcHoJD 2012-05-08 03:18

Re: [Announce] QtLockscreen: highly configurable lockscreen replacement
 
1 Attachment(s)
I have a small problem with the script, I get error 127, I did something wrong, or is an error in the script, thanks for your help.
I followed all the instructions you indicated me.:D:D

sakya 2012-05-08 07:29

Re: [Announce] QtLockscreen: highly configurable lockscreen replacement
 
Quote:

Originally Posted by D@vIcHoJD (Post 1203311)
I followed all the instructions you indicated me.:D:D

Did you set the script's execute permission?
What happens if you launch the script from the terminal?
Code:

/opt/qtlockscreen/sysinfo.sh

D@vIcHoJD 2012-05-08 07:48

Re: [Announce] QtLockscreen: highly configurable lockscreen replacement
 
Quote:

Originally Posted by sakya (Post 1203370)
Did you set the script's execute permission?
What happens if you launch the script from the terminal?
Code:

/opt/qtlockscreen/sysinfo.sh

I went out that did not find the folder, but this way I throw this error:

-sh: /opt/qtlockscreen/sysinfo.sh: not found
~ $ root


BusyBox v1.20.0 (Debian 1.20.0power1) built-in shell (ash)
Enter 'help' for a list of built-in commands.

Nokia-N900:~# opt/qtlockscreen/sysinfo.sh
-sh: opt/qtlockscreen/sysinfo.sh: not found
Nokia-N900:~# /opt/qtlockscreen/sysinfo.sh
-sh: /opt/qtlockscreen/sysinfo.sh: not found
Nokia-N900:~# /opt/qtlockscreen/
-sh: /opt/qtlockscreen/: Permission denied
Nokia-N900:~# cd opt/qtlockscreen
-sh: cd: can't cd to opt/qtlockscreen
Nokia-N900:~# cd opt/qtlockscreen/
-sh: cd: can't cd to opt/qtlockscreen/
Nokia-N900:~# cd /opt/qtlockscreen/
Nokia-N900:/opt/qtlockscreen# sysinfo.sh
-sh: sysinfo.sh: not found
Nokia-N900:/opt/qtlockscreen# sysinfo.sh
-sh: sysinfo.sh: not found
Nokia-N900:/opt/qtlockscreen# sh sysinfo.sh
805 MHz
: not found line 3:
162.1 MB
: not found line 5:
sysinfo.sh: line 15: syntax error: unexpected end of file (expecting "then")
Nokia-N900:/opt/qtlockscreen#

Please help me, Am I doing something wrong:D

sakya 2012-05-08 07:56

Re: [Announce] QtLockscreen: highly configurable lockscreen replacement
 
1 Attachment(s)
Quote:

Originally Posted by D@vIcHoJD (Post 1203377)
Please help me, Am I doing something wrong:D

Use the attached script (rename it sysinfo.sh)
Give the file execute permission:
Code:

root
chmod a+x /opt/qtlockscreen/sysinfo.sh


D@vIcHoJD 2012-05-08 08:01

Re: [Announce] QtLockscreen: highly configurable lockscreen replacement
 
Quote:

Originally Posted by sakya (Post 1203387)
Use the attached script (rename it sysinfo.sh)
Give the file execute permission:
Code:

root
chmod a+x /opt/qtlockscreen/sysinfo.sh


Thank very much sakya. Problem solved and thanks again for the script.:D:D

D@vIcHoJD 2012-05-08 08:33

Re: [Announce] QtLockscreen: highly configurable lockscreen replacement
 
In the last version 0.1.26 is repeated 2 times the widget 26, I corrected it manually.

J4ZZ 2012-05-09 10:23

Re: [Announce] QtLockscreen: highly configurable lockscreen replacement
 
Sakya I still need your help. Like I wrote a few posts back. Qtlockscreen doesn't load at boot. So I always need to re-apply my theme with Lockscreen-Config...

Can I somehow check if it's properly in startup? And where do I have to look?

Regards,

J4ZZ

sakya 2012-05-09 10:30

Re: [Announce] QtLockscreen: highly configurable lockscreen replacement
 
Quote:

Originally Posted by J4ZZ (Post 1203937)
Like I wrote a few posts back.

Sorry, I didn't notice your message.

The autostart script is /etc/event.d/qtlockscreen
It should be like this:
Code:

start on started hildon-desktop

respawn

script
  exec su - user -c "exec /usr/bin/qtlockscreen"
end script


J4ZZ 2012-05-09 14:05

Re: [Announce] QtLockscreen: highly configurable lockscreen replacement
 
Quote:

Originally Posted by sakya (Post 1203939)
The autostart script is /etc/event.d/qtlockscreen
It should be like this:
Code:

  exec su - user -c "exec /usr/bin/qtlockscreen"

What is expected output/behaviour of this command?

I get something like
Code:

Maemo applications must be run with the run-standalone.sh script"
qtlockscreen: cannot connect to X server

when executing the line in Terminal. (bash is default shell)

Regards,

J4ZZ


All times are GMT. The time now is 23:05.

vBulletin® Version 3.8.8