LINUX.ORG.RU

Встроить выхлоп ncal в панельку fvwm

 


0

2

Собственно сабж. Есть нарытй в интернете скрипт. Но он почему то не захотел работать.

Встраивается мной без изысков:

DestroyModuleConfig FvwmButtons: *
*FvwmButtons: BoxSize fixed
*FvwmButtons: Geometry 144x540+0+0
*FvwmButtons: Rows 22
*FvwmButtons: Columns 4
*FvwmButtons: Frame 2
*FvwmButtons: Padding 0 0
*FvwmButtons: Fore black
*FvwmButtons: (4x6, Swallow FvwmApplet-Calendar `FvwmScript FvwmApplet-Calendar`)

fvwm version 2.5.30 из Debian 6.

Прошу у товарища Hoodoo помощи.

★★★★

Ответ на: комментарий от Hoodoo

Это же обычный fvwmscript и пускается соответствующим модулем fvwm'a. Просто не могу отдебажить скрипт и это вызывает у меня ....

leonidko ★★★★
() автор топика
Ответ на: комментарий от leonidko

А, вон чего. Я fvwmscript-то не пользовался.

Тогда вечером посмотрю, щас сириус бизнес у меня. Я думал, скрипт работает, но не встраивается.

Заодно научусь.

Hoodoo ★★★★★
()
Последнее исправление: Hoodoo (всего исправлений: 1)

Отменить панику! Решено.

WindowTitle {FvwmApplet-Calendar}
WindowSize 140 140 
Font  "shadow=0 se:xft:Courier:Bold:size=9"

Init
 Begin
   For $i=1 To 8 Do 
    Begin   
     Set $text$i = (GetOutput {/usr/bin/ncal} $i -1)
     ChangeTitle $i $text$i 
    End
 End

PeriodicTasks
 Begin
  If (RemainderOfDiv (GetTime) 60)==0 Then
   Begin   
   End
 End

Widget     1
 Property
 Type      ItemDraw #
 Size      142 15  
 Position  -15 0
 Font      "shadow=0 se:xft:Sans serif:Bold:size=11:color=d5dee7"
 Flags     NoFocus NoReliefString Center
 ForeColor {blue}
Main
 Case message of
  SingleClic:
   Begin   
   End
End

Widget      2
 Property
  Type      ItemDraw #
  Size      128 11  
  Position  0 18
#  Flags     NoFocus NoReliefString Center
  BackColor {grey}
  ForeColor {black} 
Main
 Case message of
  SingleClic:
   Begin
   End
End

Widget      3
 Property
  Type      ItemDraw #
  Size      128 11
  Position  0 36
#  Flags     NoFocus NoReliefString Center
  ForeColor {black}
Main
 Case message of
  SingleClic:
   Begin
   End
End

Widget     4
 Property
  Type      ItemDraw #
  Size      128 11
  Position  0 54
# Flags     NoFocus NoReliefString Center
  BackColor {grey}
  ForeColor {black}
Main
 Case message of
  SingleClic:
   Begin
   End
End
Widget     5
Property
 Type      ItemDraw #
 Size      128 11
 Position  0 72
# Flags     NoFocus NoReliefString Center
# BackColor {grey}
 ForeColor {black}
Main
 Case message of
  SingleClic:
   Begin
   End
End

Widget     6
 Property
  Type      ItemDraw #
  Size      128 11
  Position  0 90
  Flags     NoFocus NoReliefString Center
  BackColor {grey}
  ForeColor {black}
Main
 Case message of
  SingleClic:
   Begin
   End
End

Widget     7
 Property
  Type      ItemDraw #
  Size      128 11
  Position  0 108
#  Flags     NoFocus NoReliefString Center
#  BackColor {}
  ForeColor {red}
Main
 Case message of
  SingleClic:
   Begin
   End
End
Widget     8
 Property
  Type      ItemDraw #
  Size      128 11
  Position  0 126
#  Flags     NoFocus NoReliefString Left
  BackColor {grey}
  ForeColor {red}
Main
 Case message of
  SingleClic:
   Begin
   End
End

Но! Ложка говна таки присутствует:

*FvwmButtons: (2x3, Swallow FvwmApplet-DayClock `FvwmScript FvwmApplet-DayClock`)
*FvwmButtons: (4x7, Swallow FvwmApplet-Calendar `FvwmScript /home/leonid/.fvwm/scripts/FvwmApplet-Calendar`)
Причём, собаки, оба файла присутствуют в одном каталоге и первый отрабатывается нормально. Переменная присутствует:
echo $fvwm_scripts 
/home/leonid/.fvwm/scripts

На подстановки типа $fvwm_scripts вместо полного пути не ведётся.

leonidko ★★★★
() автор топика
Ответ на: комментарий от leonidko

Посмотри в сторону InfoStoreAdd

man fvwm

InfoStoreAdd key value Stores the value at the given key. This is useful to store generic information used in the lifetime of an fvwm config file. For example storing program preferences for opening video files.

The purpose of this command is to store internal information to fvwm which can be used bu fvwm functions, or when opening programs of a certain type. Previous to this command the only way to do this was via SetEnv but this is discouraged because it places such information in the environment, which pollutes it and makes the information global to other processes started by fvwm which may then modify them which might not be what's wanted. Hence the point of InfoStoreAdd is to still allow for such information to be stored, but kept internal to fvwm.

In this way, one can build up as many key/value pairs as needed. Recalling the value of a given key happens through fvwm's usual expansion mechanism. See the Command Expansion section for more details. For example:

InfoStoreAdd teddybearprog xteddy

# Echo the value of teddybearprog Echo $[infostore.teddybearprog]

Removing an entry from the InfoStore is done with the InfoStoreRemove command.

anonymous
()
Ответ на: комментарий от anonymous

Если честно то непонятно. Видимо вы говорите про новую версию fvwm. У меня в документации подобной функции не находится.

leonidko ★★★★
() автор топика
Ответ на: комментарий от leonidko

2.6.5

Ну тогда можно SetEnv попользовать:

Где-то в начале конфига

SetEnv PathToScript /path/to/script

и потом

$[PathToScript]

anonymous
()
Ответ на: комментарий от anonymous

Усё есть, что самое неприятное. Правда на форуме упоминается, что как то не срабатывают они.

echo $FVWM_USERDIR 

/home/leonid/.fvwm
SetEnv fvwm_scripts $[FVWM_USERDIR]/scripts
leonidko ★★★★
() автор топика
Ответ на: комментарий от leonidko

Если и объявлена до использования и используется как $[...] - тогда не знаю и на что подумать..

anonymous
()
Ответ на: комментарий от anonymous
*FvwmButtons: (4x3,  Action (Mouse 1) `FvwmScript $[fvwm_scripts]/Kalende`)

а так всё работает. Спасибо. Надо походу документацию мне внимательней читать.

leonidko ★★★★
() автор топика
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.