Advertisement
Guest User

Untitled

a guest
Jul 12th, 2021
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.68 KB | None | 0 0
  1. #
  2. WindowTitle {FvwmInfo}
  3. WindowSize 76 120
  4. WindowPosition 0 0
  5. Font "xft:liberation sans:pixelsize=18:lang=ru"
  6. Colorset 0
  7.  
  8. # init
  9. Init
  10. Begin
  11. Set $date0 = ( GetOutput { exec date '+%H:%M' } 1 -1 )
  12. Set $date1 = ( GetOutput { exec date '+%w %d.%m' } 1 -1 )
  13. Set $batt0 = ( GetOutput { exec cat /sys/class/power_supply/BAT1/capacity } 1 -1 )
  14. Set $batt1 = ( GetOutput { exec cat /sys/class/power_supply/BAT1/status|sed 's/Charging/+/;s/Discharging/-/;s/Full/=/;s/Unknown/~/' } 1 -1 )
  15. Set $batt = $batt0{%}$batt1
  16. #Set $mus = ( GetOutput { exec mpc current -f "[%artist% - ]%title%|%file%" | tr '()-' '??:' | cut -c1-69 } 1 -1 )
  17. Set $snd0 = ( GetOutput { exec amixer sget Master | sed -n '5p' | sed 's/\].*//;s/.*\[//' } 1 -1 )
  18. Set $snd1 = ( GetOutput { exec amixer sget Master | sed -n '5p' | sed 's/.*\ \[//;s/\]//;s/on/l/;s/off/m/' } 1 -1 )
  19. Set $snd = $snd0{}$snd1
  20. Set $stat = ( GetOutput { exec xkb-switch|cut -c 1-2 } 1 -1 )
  21. Set $bkl = ( GetOutput { exec xbacklight | cut -d '.' -f 1 } 1 -1 )
  22.  
  23. ChangeTitle 1 $date0
  24. ChangeTitle 2 $date1
  25. ChangeTitle 3 $batt
  26. ChangeTitle 5 $snd
  27. ChangeTitle 6 $stat
  28. ChangeTitle 4 $bkl
  29.  
  30. Set $old_date0 = $date0
  31. Set $old_date1 = $date1
  32. Set $old_batt = $batt
  33. Set $old_snd = $snd
  34. Set $old_stat = $stat
  35. Set $old_bkl = $bkl
  36. End
  37.  
  38. # periodic
  39. PeriodicTasks
  40. Begin
  41. If (RemainderOfDiv (GetTime) 1)==0 Then
  42. Begin
  43. Set $date0 = ( GetOutput { exec date '+%H:%M' } 1 -1 )
  44. Set $date1 = ( GetOutput { exec date '+%w %d.%m' } 1 -1 )
  45. Set $batt0 = ( GetOutput { exec cat /sys/class/power_supply/BAT1/capacity } 1 -1 )
  46. Set $batt1 = ( GetOutput { exec cat /sys/class/power_supply/BAT1/status|sed 's/Charging/+/;s/Discharging/-/;s/Full/=/;s/Unknown/~/'} 1 -1 )
  47. Set $batt = $batt0{%}$batt1
  48. #Set $mus = ( GetOutput { exec mpc current -f "[%artist% - ]%title%|%file%" | tr '()-' '??:' | cut -c1-69 } 1 -1 )
  49. Set $snd0 = ( GetOutput { exec amixer sget Master | sed -n '5p' | sed 's/\].*//;s/.*\[//' } 1 -1 )
  50. Set $snd1 = ( GetOutput { exec amixer sget Master | sed -n '5p' | sed 's/.*\ \[//;s/\]//;s/on/l/;s/off/m/' } 1 -1 )
  51. Set $snd = $snd0{}$snd1
  52. Set $stat = ( GetOutput { exec xkb-switch|cut -c 1-2 } 1 -1 )
  53. Set $bkl = ( GetOutput { exec xbacklight | cut -d '.' -f 1 } 1 -1 )
  54.  
  55. If $date0 <> $old_date0 Then
  56. Begin
  57. ChangeTitle 1 $date0
  58. Set $old_date0 = $date0
  59. End
  60. If $date1 <> $old_date1 Then
  61. Begin
  62. ChangeTitle 2 $date1
  63. Set $old_date1 = $date1
  64. End
  65. If $batt <> $old_batt Then
  66. Begin
  67. ChangeTitle 3 $batt
  68. Set $old_batt = $batt
  69. End
  70. If $snd <> $old_snd Then
  71. Begin
  72. ChangeTitle 5 $snd
  73. Set $old_snd = $snd
  74. End
  75. If $stat <> $old_stat Then
  76. Begin
  77. ChangeTitle 6 $stat
  78. Set $old_stat = $stat
  79. End
  80. If $bkl <> $old_bkl Then
  81. Begin
  82. ChangeTitle 4 $bkl
  83. Set $old_bkl = $bkl
  84. End
  85. End
  86. End
  87.  
  88. # widget
  89. Widget 1
  90. Property
  91. Type ItemDraw
  92. Size 76 20
  93. Position 0 0
  94. Flags Center NoReliefString
  95. Title {}
  96. End
  97.  
  98. Widget 2
  99. Property
  100. Type ItemDraw
  101. Size 76 20
  102. Position 0 20
  103. Flags Center NoReliefString
  104. Title {}
  105. End
  106.  
  107. Widget 3
  108. Property
  109. Type ItemDraw
  110. Size 76 20
  111. Position 0 40
  112. Flags Center NoReliefString
  113. Title {}
  114. End
  115.  
  116. Widget 4
  117. Property
  118. Type ItemDraw
  119. Size 76 20
  120. Position 0 60
  121. Flags Center NoReliefString
  122. Title {}
  123. End
  124.  
  125. Widget 5
  126. Property
  127. Type ItemDraw
  128. Size 76 20
  129. Position 0 80
  130. Flags Center NoReliefString
  131. Title {}
  132. End
  133.  
  134. Widget 6
  135. Property
  136. Type ItemDraw
  137. Size 76 20
  138. Position 0 100
  139. Flags Center NoReliefString
  140. Title {}
  141. End
  142.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement