Fvwm ChangeSize crashes
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I use simple script to make dynamic status bar of cpu usage (see below).
After starting fvwm it works but after 3-4 minutes the bar disappears! The cpu.sh is simple (see below). Without ChangeSize there is no crashing (but there is no dynamic bar, static only). The cpu.sh gives integer number because ChangeSize needs for integer number. What maybe reason of this crashing? I spent already two days and do not understand reason.
WindowTitle Status
WindowSize 120 30
##### Global Style
Font "xft:DejaVu Sans:size=8:bold"
Init
Begin
Set $probarColor = #cccccc
##### Widgets
ChangeBackColor 1 $probarColor
ChangeBackColor 3 $probarColor
End
PeriodicTasks
Begin
##### CPU Status
If (RemainderOfDiv (GetTime) 2) == 0 Then
Begin
Set $length = (GetOutput echo $(bash $HOME/.fvwm/scripts/StaTux/cpu.sh) 1 -1)
ChangeSize 3 $length 3
End
End
Widget 1
Property
Type ItemDraw
Size 120 4
Position 0 0
Flags NoFocus NoReliefString
Main
Case message of
End
Widget 2
Property
Type ItemDraw
Size 118 2
Position 1 1
Flags NoFocus NoReliefString
Main
Case message of
End
Widget 3
Property
Type ItemDraw
Size 118 2
Position 1 1
Flags NoFocus NoReliefString
Main
Case message of
End
cpu.sh
#!/bin/sh
DELAY=$1:-1
cat /proc/stat; sleep "$DELAY"; cat /proc/stat; | awk '/^cpu / usr=$2-usr; sys=$4-sys; idle=$5-idle; iow=$6-iow END total=usr+sys+idle+iow; print int((total-idle)*118/total)'
fvwm
 |Â
show 2 more comments
up vote
1
down vote
favorite
I use simple script to make dynamic status bar of cpu usage (see below).
After starting fvwm it works but after 3-4 minutes the bar disappears! The cpu.sh is simple (see below). Without ChangeSize there is no crashing (but there is no dynamic bar, static only). The cpu.sh gives integer number because ChangeSize needs for integer number. What maybe reason of this crashing? I spent already two days and do not understand reason.
WindowTitle Status
WindowSize 120 30
##### Global Style
Font "xft:DejaVu Sans:size=8:bold"
Init
Begin
Set $probarColor = #cccccc
##### Widgets
ChangeBackColor 1 $probarColor
ChangeBackColor 3 $probarColor
End
PeriodicTasks
Begin
##### CPU Status
If (RemainderOfDiv (GetTime) 2) == 0 Then
Begin
Set $length = (GetOutput echo $(bash $HOME/.fvwm/scripts/StaTux/cpu.sh) 1 -1)
ChangeSize 3 $length 3
End
End
Widget 1
Property
Type ItemDraw
Size 120 4
Position 0 0
Flags NoFocus NoReliefString
Main
Case message of
End
Widget 2
Property
Type ItemDraw
Size 118 2
Position 1 1
Flags NoFocus NoReliefString
Main
Case message of
End
Widget 3
Property
Type ItemDraw
Size 118 2
Position 1 1
Flags NoFocus NoReliefString
Main
Case message of
End
cpu.sh
#!/bin/sh
DELAY=$1:-1
cat /proc/stat; sleep "$DELAY"; cat /proc/stat; | awk '/^cpu / usr=$2-usr; sys=$4-sys; idle=$5-idle; iow=$6-iow END total=usr+sys+idle+iow; print int((total-idle)*118/total)'
fvwm
You are not callingcpu.sh
with an argument, so DELAY=-1, andsleep -1
is no sleep at all, so 2 successive cats of/proc/stat
might give the same results twice, so the total will be 0 and you will have an awk division by 0 with no output on stdout.
â meuh
Jul 12 at 8:16
@meuh I changed "$DELAY" to 1 or "1" with the same result - after some time the bar disappeared.
â nail
Jul 12 at 10:26
@meuh I think I found the reason of crushing. It is crushed if we have zero size: ChangeSize 3 0 2 is crashed.
â nail
Jul 12 at 14:09
Yes, you are right. I was just trying your script and when it crashed cpu.sh had returned 0 and there was an X Error in the stderr of fvwm: Error: 2 (BadValue (integer parameter out of range for operation)) Major opcode of failed request: 12 (ConfigureWindow) and a core dump.
â meuh
Jul 12 at 14:55
@meuh Thank you for confirming. I saw this error in .xsession-errors. But I was confused by "integer parameter". I saw discussion in fvwm forum that ChangeSize needs for integer parameter and thought that this error due to this integer parameter. There is also official information "FvwmScript crashes if widgets are accessed that have not been defined." Maybe it means that for zero size the widget is not defined?
â nail
Jul 13 at 1:00
 |Â
show 2 more comments
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I use simple script to make dynamic status bar of cpu usage (see below).
After starting fvwm it works but after 3-4 minutes the bar disappears! The cpu.sh is simple (see below). Without ChangeSize there is no crashing (but there is no dynamic bar, static only). The cpu.sh gives integer number because ChangeSize needs for integer number. What maybe reason of this crashing? I spent already two days and do not understand reason.
WindowTitle Status
WindowSize 120 30
##### Global Style
Font "xft:DejaVu Sans:size=8:bold"
Init
Begin
Set $probarColor = #cccccc
##### Widgets
ChangeBackColor 1 $probarColor
ChangeBackColor 3 $probarColor
End
PeriodicTasks
Begin
##### CPU Status
If (RemainderOfDiv (GetTime) 2) == 0 Then
Begin
Set $length = (GetOutput echo $(bash $HOME/.fvwm/scripts/StaTux/cpu.sh) 1 -1)
ChangeSize 3 $length 3
End
End
Widget 1
Property
Type ItemDraw
Size 120 4
Position 0 0
Flags NoFocus NoReliefString
Main
Case message of
End
Widget 2
Property
Type ItemDraw
Size 118 2
Position 1 1
Flags NoFocus NoReliefString
Main
Case message of
End
Widget 3
Property
Type ItemDraw
Size 118 2
Position 1 1
Flags NoFocus NoReliefString
Main
Case message of
End
cpu.sh
#!/bin/sh
DELAY=$1:-1
cat /proc/stat; sleep "$DELAY"; cat /proc/stat; | awk '/^cpu / usr=$2-usr; sys=$4-sys; idle=$5-idle; iow=$6-iow END total=usr+sys+idle+iow; print int((total-idle)*118/total)'
fvwm
I use simple script to make dynamic status bar of cpu usage (see below).
After starting fvwm it works but after 3-4 minutes the bar disappears! The cpu.sh is simple (see below). Without ChangeSize there is no crashing (but there is no dynamic bar, static only). The cpu.sh gives integer number because ChangeSize needs for integer number. What maybe reason of this crashing? I spent already two days and do not understand reason.
WindowTitle Status
WindowSize 120 30
##### Global Style
Font "xft:DejaVu Sans:size=8:bold"
Init
Begin
Set $probarColor = #cccccc
##### Widgets
ChangeBackColor 1 $probarColor
ChangeBackColor 3 $probarColor
End
PeriodicTasks
Begin
##### CPU Status
If (RemainderOfDiv (GetTime) 2) == 0 Then
Begin
Set $length = (GetOutput echo $(bash $HOME/.fvwm/scripts/StaTux/cpu.sh) 1 -1)
ChangeSize 3 $length 3
End
End
Widget 1
Property
Type ItemDraw
Size 120 4
Position 0 0
Flags NoFocus NoReliefString
Main
Case message of
End
Widget 2
Property
Type ItemDraw
Size 118 2
Position 1 1
Flags NoFocus NoReliefString
Main
Case message of
End
Widget 3
Property
Type ItemDraw
Size 118 2
Position 1 1
Flags NoFocus NoReliefString
Main
Case message of
End
cpu.sh
#!/bin/sh
DELAY=$1:-1
cat /proc/stat; sleep "$DELAY"; cat /proc/stat; | awk '/^cpu / usr=$2-usr; sys=$4-sys; idle=$5-idle; iow=$6-iow END total=usr+sys+idle+iow; print int((total-idle)*118/total)'
fvwm
edited Jul 12 at 0:18
asked Jul 12 at 0:01
nail
62
62
You are not callingcpu.sh
with an argument, so DELAY=-1, andsleep -1
is no sleep at all, so 2 successive cats of/proc/stat
might give the same results twice, so the total will be 0 and you will have an awk division by 0 with no output on stdout.
â meuh
Jul 12 at 8:16
@meuh I changed "$DELAY" to 1 or "1" with the same result - after some time the bar disappeared.
â nail
Jul 12 at 10:26
@meuh I think I found the reason of crushing. It is crushed if we have zero size: ChangeSize 3 0 2 is crashed.
â nail
Jul 12 at 14:09
Yes, you are right. I was just trying your script and when it crashed cpu.sh had returned 0 and there was an X Error in the stderr of fvwm: Error: 2 (BadValue (integer parameter out of range for operation)) Major opcode of failed request: 12 (ConfigureWindow) and a core dump.
â meuh
Jul 12 at 14:55
@meuh Thank you for confirming. I saw this error in .xsession-errors. But I was confused by "integer parameter". I saw discussion in fvwm forum that ChangeSize needs for integer parameter and thought that this error due to this integer parameter. There is also official information "FvwmScript crashes if widgets are accessed that have not been defined." Maybe it means that for zero size the widget is not defined?
â nail
Jul 13 at 1:00
 |Â
show 2 more comments
You are not callingcpu.sh
with an argument, so DELAY=-1, andsleep -1
is no sleep at all, so 2 successive cats of/proc/stat
might give the same results twice, so the total will be 0 and you will have an awk division by 0 with no output on stdout.
â meuh
Jul 12 at 8:16
@meuh I changed "$DELAY" to 1 or "1" with the same result - after some time the bar disappeared.
â nail
Jul 12 at 10:26
@meuh I think I found the reason of crushing. It is crushed if we have zero size: ChangeSize 3 0 2 is crashed.
â nail
Jul 12 at 14:09
Yes, you are right. I was just trying your script and when it crashed cpu.sh had returned 0 and there was an X Error in the stderr of fvwm: Error: 2 (BadValue (integer parameter out of range for operation)) Major opcode of failed request: 12 (ConfigureWindow) and a core dump.
â meuh
Jul 12 at 14:55
@meuh Thank you for confirming. I saw this error in .xsession-errors. But I was confused by "integer parameter". I saw discussion in fvwm forum that ChangeSize needs for integer parameter and thought that this error due to this integer parameter. There is also official information "FvwmScript crashes if widgets are accessed that have not been defined." Maybe it means that for zero size the widget is not defined?
â nail
Jul 13 at 1:00
You are not calling
cpu.sh
with an argument, so DELAY=-1, and sleep -1
is no sleep at all, so 2 successive cats of /proc/stat
might give the same results twice, so the total will be 0 and you will have an awk division by 0 with no output on stdout.â meuh
Jul 12 at 8:16
You are not calling
cpu.sh
with an argument, so DELAY=-1, and sleep -1
is no sleep at all, so 2 successive cats of /proc/stat
might give the same results twice, so the total will be 0 and you will have an awk division by 0 with no output on stdout.â meuh
Jul 12 at 8:16
@meuh I changed "$DELAY" to 1 or "1" with the same result - after some time the bar disappeared.
â nail
Jul 12 at 10:26
@meuh I changed "$DELAY" to 1 or "1" with the same result - after some time the bar disappeared.
â nail
Jul 12 at 10:26
@meuh I think I found the reason of crushing. It is crushed if we have zero size: ChangeSize 3 0 2 is crashed.
â nail
Jul 12 at 14:09
@meuh I think I found the reason of crushing. It is crushed if we have zero size: ChangeSize 3 0 2 is crashed.
â nail
Jul 12 at 14:09
Yes, you are right. I was just trying your script and when it crashed cpu.sh had returned 0 and there was an X Error in the stderr of fvwm: Error: 2 (BadValue (integer parameter out of range for operation)) Major opcode of failed request: 12 (ConfigureWindow) and a core dump.
â meuh
Jul 12 at 14:55
Yes, you are right. I was just trying your script and when it crashed cpu.sh had returned 0 and there was an X Error in the stderr of fvwm: Error: 2 (BadValue (integer parameter out of range for operation)) Major opcode of failed request: 12 (ConfigureWindow) and a core dump.
â meuh
Jul 12 at 14:55
@meuh Thank you for confirming. I saw this error in .xsession-errors. But I was confused by "integer parameter". I saw discussion in fvwm forum that ChangeSize needs for integer parameter and thought that this error due to this integer parameter. There is also official information "FvwmScript crashes if widgets are accessed that have not been defined." Maybe it means that for zero size the widget is not defined?
â nail
Jul 13 at 1:00
@meuh Thank you for confirming. I saw this error in .xsession-errors. But I was confused by "integer parameter". I saw discussion in fvwm forum that ChangeSize needs for integer parameter and thought that this error due to this integer parameter. There is also official information "FvwmScript crashes if widgets are accessed that have not been defined." Maybe it means that for zero size the widget is not defined?
â nail
Jul 13 at 1:00
 |Â
show 2 more comments
1 Answer
1
active
oldest
votes
up vote
0
down vote
As discussed in the comments, it seems FvwmScript
crashes due to an X error BadValue when the value returned by the shell script is 0. This is probably because it is trying to configure the window to a size of 0.
An alternative solution is to use the HDipstick
widget, which is a horizontal bar in a box of fixed length. Here is a short but complete example:
WindowTitle Status
WindowSize 120 30
WindowPosition 900 1
Init
Begin
ChangeBackColor 3 #000
End
PeriodicTasks
Begin
If (RemainderOfDiv (GetTime) 2) == 0 Then
Begin
Set $length = (GetOutput bash $HOME/.fvwm/scripts/StaTux/cpu.sh 1 -1)
ChangeValue 3 $length
End
End
Widget 3
Property
Type HDipstick
Value 0
MinValue 0
MaxValue 200
ForeColor #f00
Size 110 20
Position 5 5
Main
Case message of
End
The MinValue
and MaxValue
set the expected limits on the number you are getting back from your script. I chose 200 arbitrarily. The PeriodicTasks
call of your script gets this number and uses ChangeValue
to set the Value
property to it. It will be scaled by dividing by 200 and multiplying by the width of the horizontal bar, given here in Size
as 110 pixels.
When playing with this I noticed a bug in my version of FvwmScript which would draw a full bar for certain low values. For example, setting a MaxValue
of 700 meant values 7 to 26 gave a full bar.
Yes, it works. I did not know that ChangeValue changes parameter Value. I did not find in man of HDipstick how possible to change geometry of bar. If I set Size 118 1 the bar does not change. For any height it has the same form.
â nail
Jul 14 at 19:03
It says the minimum size is 30 by 11.
â meuh
Jul 14 at 19:07
!Valid XHTML
â nail
Jul 15 at 21:02
Whats a pity. I prefer thin bars !Valid XHTML. Another observation with this script - it must be loaded last. I use dropbox and it is loaded longest and delete bar if they are and I need to restart fvwm do get bars. For this reason I use delay + I Schedule 30000 Module FvwmScript [FVWM_USERDIR]/scripts/StaTux/Status
â nail
Jul 15 at 21:12
1
Appears another problem. I use Mathematica ant it occupies 4 cpu for 100% long time and appears division on zero. I solved all problems with zero and division on zero by changing total=usr+sys+idle+iow; print int((total-idle)*118/total) to total=1+usr+sys+idle+iow; print int(1+(total-idle)*117/total). Now it works correct without zero length and division on zero.
â nail
Jul 22 at 23:33
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
As discussed in the comments, it seems FvwmScript
crashes due to an X error BadValue when the value returned by the shell script is 0. This is probably because it is trying to configure the window to a size of 0.
An alternative solution is to use the HDipstick
widget, which is a horizontal bar in a box of fixed length. Here is a short but complete example:
WindowTitle Status
WindowSize 120 30
WindowPosition 900 1
Init
Begin
ChangeBackColor 3 #000
End
PeriodicTasks
Begin
If (RemainderOfDiv (GetTime) 2) == 0 Then
Begin
Set $length = (GetOutput bash $HOME/.fvwm/scripts/StaTux/cpu.sh 1 -1)
ChangeValue 3 $length
End
End
Widget 3
Property
Type HDipstick
Value 0
MinValue 0
MaxValue 200
ForeColor #f00
Size 110 20
Position 5 5
Main
Case message of
End
The MinValue
and MaxValue
set the expected limits on the number you are getting back from your script. I chose 200 arbitrarily. The PeriodicTasks
call of your script gets this number and uses ChangeValue
to set the Value
property to it. It will be scaled by dividing by 200 and multiplying by the width of the horizontal bar, given here in Size
as 110 pixels.
When playing with this I noticed a bug in my version of FvwmScript which would draw a full bar for certain low values. For example, setting a MaxValue
of 700 meant values 7 to 26 gave a full bar.
Yes, it works. I did not know that ChangeValue changes parameter Value. I did not find in man of HDipstick how possible to change geometry of bar. If I set Size 118 1 the bar does not change. For any height it has the same form.
â nail
Jul 14 at 19:03
It says the minimum size is 30 by 11.
â meuh
Jul 14 at 19:07
!Valid XHTML
â nail
Jul 15 at 21:02
Whats a pity. I prefer thin bars !Valid XHTML. Another observation with this script - it must be loaded last. I use dropbox and it is loaded longest and delete bar if they are and I need to restart fvwm do get bars. For this reason I use delay + I Schedule 30000 Module FvwmScript [FVWM_USERDIR]/scripts/StaTux/Status
â nail
Jul 15 at 21:12
1
Appears another problem. I use Mathematica ant it occupies 4 cpu for 100% long time and appears division on zero. I solved all problems with zero and division on zero by changing total=usr+sys+idle+iow; print int((total-idle)*118/total) to total=1+usr+sys+idle+iow; print int(1+(total-idle)*117/total). Now it works correct without zero length and division on zero.
â nail
Jul 22 at 23:33
add a comment |Â
up vote
0
down vote
As discussed in the comments, it seems FvwmScript
crashes due to an X error BadValue when the value returned by the shell script is 0. This is probably because it is trying to configure the window to a size of 0.
An alternative solution is to use the HDipstick
widget, which is a horizontal bar in a box of fixed length. Here is a short but complete example:
WindowTitle Status
WindowSize 120 30
WindowPosition 900 1
Init
Begin
ChangeBackColor 3 #000
End
PeriodicTasks
Begin
If (RemainderOfDiv (GetTime) 2) == 0 Then
Begin
Set $length = (GetOutput bash $HOME/.fvwm/scripts/StaTux/cpu.sh 1 -1)
ChangeValue 3 $length
End
End
Widget 3
Property
Type HDipstick
Value 0
MinValue 0
MaxValue 200
ForeColor #f00
Size 110 20
Position 5 5
Main
Case message of
End
The MinValue
and MaxValue
set the expected limits on the number you are getting back from your script. I chose 200 arbitrarily. The PeriodicTasks
call of your script gets this number and uses ChangeValue
to set the Value
property to it. It will be scaled by dividing by 200 and multiplying by the width of the horizontal bar, given here in Size
as 110 pixels.
When playing with this I noticed a bug in my version of FvwmScript which would draw a full bar for certain low values. For example, setting a MaxValue
of 700 meant values 7 to 26 gave a full bar.
Yes, it works. I did not know that ChangeValue changes parameter Value. I did not find in man of HDipstick how possible to change geometry of bar. If I set Size 118 1 the bar does not change. For any height it has the same form.
â nail
Jul 14 at 19:03
It says the minimum size is 30 by 11.
â meuh
Jul 14 at 19:07
!Valid XHTML
â nail
Jul 15 at 21:02
Whats a pity. I prefer thin bars !Valid XHTML. Another observation with this script - it must be loaded last. I use dropbox and it is loaded longest and delete bar if they are and I need to restart fvwm do get bars. For this reason I use delay + I Schedule 30000 Module FvwmScript [FVWM_USERDIR]/scripts/StaTux/Status
â nail
Jul 15 at 21:12
1
Appears another problem. I use Mathematica ant it occupies 4 cpu for 100% long time and appears division on zero. I solved all problems with zero and division on zero by changing total=usr+sys+idle+iow; print int((total-idle)*118/total) to total=1+usr+sys+idle+iow; print int(1+(total-idle)*117/total). Now it works correct without zero length and division on zero.
â nail
Jul 22 at 23:33
add a comment |Â
up vote
0
down vote
up vote
0
down vote
As discussed in the comments, it seems FvwmScript
crashes due to an X error BadValue when the value returned by the shell script is 0. This is probably because it is trying to configure the window to a size of 0.
An alternative solution is to use the HDipstick
widget, which is a horizontal bar in a box of fixed length. Here is a short but complete example:
WindowTitle Status
WindowSize 120 30
WindowPosition 900 1
Init
Begin
ChangeBackColor 3 #000
End
PeriodicTasks
Begin
If (RemainderOfDiv (GetTime) 2) == 0 Then
Begin
Set $length = (GetOutput bash $HOME/.fvwm/scripts/StaTux/cpu.sh 1 -1)
ChangeValue 3 $length
End
End
Widget 3
Property
Type HDipstick
Value 0
MinValue 0
MaxValue 200
ForeColor #f00
Size 110 20
Position 5 5
Main
Case message of
End
The MinValue
and MaxValue
set the expected limits on the number you are getting back from your script. I chose 200 arbitrarily. The PeriodicTasks
call of your script gets this number and uses ChangeValue
to set the Value
property to it. It will be scaled by dividing by 200 and multiplying by the width of the horizontal bar, given here in Size
as 110 pixels.
When playing with this I noticed a bug in my version of FvwmScript which would draw a full bar for certain low values. For example, setting a MaxValue
of 700 meant values 7 to 26 gave a full bar.
As discussed in the comments, it seems FvwmScript
crashes due to an X error BadValue when the value returned by the shell script is 0. This is probably because it is trying to configure the window to a size of 0.
An alternative solution is to use the HDipstick
widget, which is a horizontal bar in a box of fixed length. Here is a short but complete example:
WindowTitle Status
WindowSize 120 30
WindowPosition 900 1
Init
Begin
ChangeBackColor 3 #000
End
PeriodicTasks
Begin
If (RemainderOfDiv (GetTime) 2) == 0 Then
Begin
Set $length = (GetOutput bash $HOME/.fvwm/scripts/StaTux/cpu.sh 1 -1)
ChangeValue 3 $length
End
End
Widget 3
Property
Type HDipstick
Value 0
MinValue 0
MaxValue 200
ForeColor #f00
Size 110 20
Position 5 5
Main
Case message of
End
The MinValue
and MaxValue
set the expected limits on the number you are getting back from your script. I chose 200 arbitrarily. The PeriodicTasks
call of your script gets this number and uses ChangeValue
to set the Value
property to it. It will be scaled by dividing by 200 and multiplying by the width of the horizontal bar, given here in Size
as 110 pixels.
When playing with this I noticed a bug in my version of FvwmScript which would draw a full bar for certain low values. For example, setting a MaxValue
of 700 meant values 7 to 26 gave a full bar.
answered Jul 14 at 18:04
meuh
29k11648
29k11648
Yes, it works. I did not know that ChangeValue changes parameter Value. I did not find in man of HDipstick how possible to change geometry of bar. If I set Size 118 1 the bar does not change. For any height it has the same form.
â nail
Jul 14 at 19:03
It says the minimum size is 30 by 11.
â meuh
Jul 14 at 19:07
!Valid XHTML
â nail
Jul 15 at 21:02
Whats a pity. I prefer thin bars !Valid XHTML. Another observation with this script - it must be loaded last. I use dropbox and it is loaded longest and delete bar if they are and I need to restart fvwm do get bars. For this reason I use delay + I Schedule 30000 Module FvwmScript [FVWM_USERDIR]/scripts/StaTux/Status
â nail
Jul 15 at 21:12
1
Appears another problem. I use Mathematica ant it occupies 4 cpu for 100% long time and appears division on zero. I solved all problems with zero and division on zero by changing total=usr+sys+idle+iow; print int((total-idle)*118/total) to total=1+usr+sys+idle+iow; print int(1+(total-idle)*117/total). Now it works correct without zero length and division on zero.
â nail
Jul 22 at 23:33
add a comment |Â
Yes, it works. I did not know that ChangeValue changes parameter Value. I did not find in man of HDipstick how possible to change geometry of bar. If I set Size 118 1 the bar does not change. For any height it has the same form.
â nail
Jul 14 at 19:03
It says the minimum size is 30 by 11.
â meuh
Jul 14 at 19:07
!Valid XHTML
â nail
Jul 15 at 21:02
Whats a pity. I prefer thin bars !Valid XHTML. Another observation with this script - it must be loaded last. I use dropbox and it is loaded longest and delete bar if they are and I need to restart fvwm do get bars. For this reason I use delay + I Schedule 30000 Module FvwmScript [FVWM_USERDIR]/scripts/StaTux/Status
â nail
Jul 15 at 21:12
1
Appears another problem. I use Mathematica ant it occupies 4 cpu for 100% long time and appears division on zero. I solved all problems with zero and division on zero by changing total=usr+sys+idle+iow; print int((total-idle)*118/total) to total=1+usr+sys+idle+iow; print int(1+(total-idle)*117/total). Now it works correct without zero length and division on zero.
â nail
Jul 22 at 23:33
Yes, it works. I did not know that ChangeValue changes parameter Value. I did not find in man of HDipstick how possible to change geometry of bar. If I set Size 118 1 the bar does not change. For any height it has the same form.
â nail
Jul 14 at 19:03
Yes, it works. I did not know that ChangeValue changes parameter Value. I did not find in man of HDipstick how possible to change geometry of bar. If I set Size 118 1 the bar does not change. For any height it has the same form.
â nail
Jul 14 at 19:03
It says the minimum size is 30 by 11.
â meuh
Jul 14 at 19:07
It says the minimum size is 30 by 11.
â meuh
Jul 14 at 19:07
!Valid XHTML
â nail
Jul 15 at 21:02
!Valid XHTML
â nail
Jul 15 at 21:02
Whats a pity. I prefer thin bars !Valid XHTML. Another observation with this script - it must be loaded last. I use dropbox and it is loaded longest and delete bar if they are and I need to restart fvwm do get bars. For this reason I use delay + I Schedule 30000 Module FvwmScript [FVWM_USERDIR]/scripts/StaTux/Status
â nail
Jul 15 at 21:12
Whats a pity. I prefer thin bars !Valid XHTML. Another observation with this script - it must be loaded last. I use dropbox and it is loaded longest and delete bar if they are and I need to restart fvwm do get bars. For this reason I use delay + I Schedule 30000 Module FvwmScript [FVWM_USERDIR]/scripts/StaTux/Status
â nail
Jul 15 at 21:12
1
1
Appears another problem. I use Mathematica ant it occupies 4 cpu for 100% long time and appears division on zero. I solved all problems with zero and division on zero by changing total=usr+sys+idle+iow; print int((total-idle)*118/total) to total=1+usr+sys+idle+iow; print int(1+(total-idle)*117/total). Now it works correct without zero length and division on zero.
â nail
Jul 22 at 23:33
Appears another problem. I use Mathematica ant it occupies 4 cpu for 100% long time and appears division on zero. I solved all problems with zero and division on zero by changing total=usr+sys+idle+iow; print int((total-idle)*118/total) to total=1+usr+sys+idle+iow; print int(1+(total-idle)*117/total). Now it works correct without zero length and division on zero.
â nail
Jul 22 at 23:33
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f454799%2ffvwm-changesize-crashes%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
You are not calling
cpu.sh
with an argument, so DELAY=-1, andsleep -1
is no sleep at all, so 2 successive cats of/proc/stat
might give the same results twice, so the total will be 0 and you will have an awk division by 0 with no output on stdout.â meuh
Jul 12 at 8:16
@meuh I changed "$DELAY" to 1 or "1" with the same result - after some time the bar disappeared.
â nail
Jul 12 at 10:26
@meuh I think I found the reason of crushing. It is crushed if we have zero size: ChangeSize 3 0 2 is crashed.
â nail
Jul 12 at 14:09
Yes, you are right. I was just trying your script and when it crashed cpu.sh had returned 0 and there was an X Error in the stderr of fvwm: Error: 2 (BadValue (integer parameter out of range for operation)) Major opcode of failed request: 12 (ConfigureWindow) and a core dump.
â meuh
Jul 12 at 14:55
@meuh Thank you for confirming. I saw this error in .xsession-errors. But I was confused by "integer parameter". I saw discussion in fvwm forum that ChangeSize needs for integer parameter and thought that this error due to this integer parameter. There is also official information "FvwmScript crashes if widgets are accessed that have not been defined." Maybe it means that for zero size the widget is not defined?
â nail
Jul 13 at 1:00