Debian Codegraph @

fvwm/recipes/LapLeft with ACPI

raw
1 # LapLeft with ACPI recipe for Fvwm-Crystal
2 # Written by Dominique Michel <[email protected]>, 2014
3 #
4 # Modern laptops have a much wider than high screen. This recipie try to adress
5 # this issue by putting all the decorations on the left.
6 #
7 # From that recipe, fvwm-crystal begin to use buttons with several pictures, apps, etc. whenever possible.
8 # Compared with multiple buttons, this decrease both the config size and the memory usage.
9 #
10 # You can use folding to navigate this file
11
12 Echo LapLeft with ACPI recipe loading from $.
13 InfoStoreAdd Recipe "LapLeftACPI"
14
15 # Includes and FVWM modules {{{1
16 # Default FVWM-Crystal functions, initialization {{{2
17 #Include components/functions/Window-Autohide
18 Include components/functions/FocusOnGotoPage
19
20 # Type of icons on the desktop {{{2
21 LoadPreferences IconsType
22
23 # Media player {{{2
24 Include components/functions/Music-$[infostore.MusicPlayer]
25
26 # Desktop settings {{{1
27 EdgeScroll 100000 100000
28 EdgeResistance -1
29 Style * EdgeMoveDelay 250
30 Style * EdgeMoveResistance 20
31
32 HideGeometryWindow Move, Resize
33 OpaqueMoveSize 100
34
35 # Change desktop with mouse wheel
36 Include components/bindings/Desktop-PageSwitch-Horizontal
37
38 # Pager {{{1
39 All (FvwmPager) Close
40 DestroyModuleConfig FvwmPager: *
41
42 # Desktop panel {{{1
43 EWMH-Desktop 63 3 3 3
44 EWMH-Panel-Bottom 3
45 EWMH-Panel-Top 3
46 EwmhBaseStruts 63 3 3 3
47
48 # Desktop manager {{{2
49 DestroyFunc RedrawIconBox
50 AddToFunc RedrawIconBox
51 + I PipeRead 'echo "Style * IconBox $(($[vp.width]-((((50*$[IconColumnsNumber]))+69))))x$(($[vp.height]-6))+50+6, IconFill right bottom, IconGrid 30 30"'
52 LoadPreferences DefaultDesktopManager
53
54 # Icons on Desktop {{{1
55 Test (EnvMatch DefaultDesktopManager Crystal) PipeRead 'echo "Style * IconBox $(($[vp.width]-((((50*$[IconColumnsNumber]))+69))))x$(($[vp.height]-6))+50+6, IconFill right bottom, IconGrid 30 30"'
56 Test (!EnvMatch DefaultDesktopManager Crystal) Style * IconBox 66 3 -1 -1, IconFill right bottom, IconGrid 30 30
57
58 Style * StickyIcon
59 #Style ApplicationPanel !Icon
60
61 # top |Crystal + batt |---|ApplicationPanel|---|NotifArea| Clock |Media|Freq + Temp + Pager| bottom #
62 # # | 54px |---| 490 px |---| varianle| 24 px |48 px| 72 px |# #
63 # Top button with Crystal and AcpiBatt {{{1
64 All (FvwmButtons-Top) Close
65 DestroyModuleConfig FvwmButtons-Top: *
66 *FvwmButtons-Top: Geometry 60x54+0+0
67 *FvwmButtons-Top: BoxSize smart
68 *FvwmVuttons-Top: ActiveColorset $[infostore.cs_panel_active]
69 *FvwmButtons-Top: Colorset $[infostore.cs_panel_inactive]
70 #*FvwmButtons-Top: Colorset $[infostore.cs_transparent]
71 *FvwmButtons-Top: Columns 2
72 *FvwmButtons-Top: Font "xft:$[panel_font]:pixelsize=$[panel_font_size]:$[panel_font_style]"
73 *FvwmButtons-Top: Padding 2 2
74 *FvwmButtons-Top: Frame 0
75 *FvwmButtons-Top: (2x1, Size 60 30, Icon "22x22/fvwm-crystal/fvwm-crystal.png", \
76 Action (Mouse 1) Menu /FVWM-Crystal $[MenuPosition_E], \
77 Action (Mouse 2) Menu /Random-Wallpaper $[MenuPosition_E], \
78 Action (Mouse 3) Menu /Applications $[MenuPosition_E], \
79 Action (Mouse 4) X fvwm-crystal.videomodeswitch+, \
80 Action (Mouse 5) X fvwm-crystal.videomodeswitch-)
81 *FvwmButtons-Top: (2x1, Size 60 24, Swallow (Close, Respawn, FvwmModule) FvwmScript-AcpiBatt)"'
82 Module FvwmButtons FvwmButtons-Top
83 Script components/scripts/FvwmScript-AcpiBatt
84
85
86 # Other menus {{{1
87 # Applications menu generator
88 # This creates the main "Start Menu" avaiable at mouse button 1
89 PipeRead 'fvwm-crystal.apps --database=$[FVWM_DISTROMENUDIR]/Applications --database=$[FVWM_SYSTEMDIR]/Applications --database=$[FVWM_USERDIR]/Applications --search-icons-in=$[FVWM_USERDIR]/icons/$[infostore.Icon_Theme]/32x32/categories:$[FVWM_USERDIR]/icons/$[infostore.Icon_Theme]/32x32/apps:$[FVWM_SYSTEMDIR]/icons/$[infostore.Icon_Theme]/32x32/categories:$[FVWM_SYSTEMDIR]/icons/$[infostore.Icon_Theme]/32x32/apps:$[FVWM_DISTROMENUDIR]/icons/$[infostore.Icon_Theme]/32x32/categories:$[FVWM_DISTROMENUDIR]/icons/$[infostore.Icon_Theme]/32x32/apps --default-file-icon=32x32/apps/default.png --default-dir-icon=32x32/categories/directory.png --min-submenu-length=5 --root-cat-name="StartMenu" --sort=prio --no-panel --check-execs'
90 AddToMenu /StartMenu "" Nop
91 AddToMenu /StartMenu "%32x32/fvwm-crystal/fvwm-crystal.png%FVWM-Crystal" Popup /FVWM-Crystal
92
93 # This creates app menu available under Alt+Win_R
94 PipeRead 'fvwm-crystal.apps --database=$[FVWM_DISTROMENUDIR]/Applications --database=$[FVWM_SYSTEMDIR]/Applications --database=$[FVWM_USERDIR]/Applications --search-icons-in=$[FVWM_USERDIR]/icons/$[infostore.Icon_Theme]/22x22/categories:$[FVWM_USERDIR]/icons/$[infostore.Icon_Theme]/22x22/apps:$[FVWM_SYSTEMDIR]/icons/$[infostore.Icon_Theme]/22x22/categories:$[FVWM_SYSTEMDIR]/icons/$[infostore.Icon_Theme]/22x22/apps:$[FVWM_DISTROMENUDIR]/icons/$[infostore.Icon_Theme]/22x22/categories:$[FVWM_DISTROMENUDIR]/icons/$[infostore.Icon_Theme]/22x22/apps --default-file-icon=22x22/apps/default.png --default-dir-icon=22x22/categories/directory.png --min-submenu-length=5 --sort=prio --no-panel --check-execs'
95 AddToMenu /Applications '%22x22/fvwm-crystal/audio-x-generic.png%$[gt.Music]' Popup /Music
96
97 # Desktop menu with left click {{{1
98 SetEnv DesktopMenu /StartMenu
99 #SetEnv DesktopMenu /Applications
100 #SetEnv DesktopMenu /FVWM-Crystal
101
102 # Window list on mouse button 2 {{{2
103 Mouse 2 R $[Mod0] Window-List
104
105 # Application panel {{{1
106 All (ApplicationPanel) Close
107 DestroyModuleConfig ApplicationPanel: *
108 # geometry: Width(60) x Height(490) + x(0) + y( ( ( vp.H - ( 174 + 490 + ( ( fontsize * 3 ) / 2 ) + ( ( ( ( trayerwidth * 5 ) / 152 ) ) * 30 ) ) ) / 2 ) + 54 )
109 PipeRead 'echo "*ApplicationPanel: Geometry 60x490+0+$(((((($[vp.height]-((54+490+150+(((((((((((($trayer_width))/24))-1))/2))+1))*30))))))/2))+54))"'
110 *ApplicationPanel: BoxSize smart
111 *ApplicationPanel: ActiveColorset $[infostore.cs_panel_active]
112 *ApplicationPanel: Colorset $[infostore.cs_panel_inactive]
113 #*ApplicationPanel: Colorset $[infostore.cs_transparent]
114 *ApplicationPanel: Rows 10
115 *ApplicationPanel: Padding 6 2
116 *ApplicationPanel: Frame 0
117 *ApplicationPanel: Font "xft:$[panel_font]:pixelsize=$[panel_font_size]:$[panel_font_style]"
118
119 # This creates the main panel with applications - default app icon is
120 # shown on the panel, and can be launched using RMB; LMB opens the app
121
122 # category menu
123 PipeRead 'fvwm-crystal.apps --database=$[FVWM_DISTROMENUDIR]/Applications --database=$[FVWM_SYSTEMDIR]/Applications --database=$[FVWM_USERDIR]/Applications --without=/Applications/$[FVWM_DISTROMENUNAME] --search-icons-in=$[FVWM_USERDIR]/icons/$[infostore.Icon_Theme]/48x48/categories:$[FVWM_USERDIR]/icons/$[infostore.Icon_Theme]/48x48/apps:$[FVWM_SYSTEMDIR]/icons/$[infostore.Icon_Theme]/48x48/categories:$[FVWM_SYSTEMDIR]/icons/$[infostore.Icon_Theme]/48x48/apps:$[FVWM_DISTROMENUDIR]/icons/$[infostore.Icon_Theme]/48x48/categories:$[FVWM_DISTROMENUDIR]/icons/$[infostore.Icon_Theme]/48x48/apps --default-file-icon=48x48/apps/default.png --default-dir-icon=48x48/categories/directory.png --min-submenu-length=5 --sort=prio --panel-icons=topapp --panel-action1=menu --panel-action2=secondapp --panel-action3=topapp --menu-pos=E --menuname-suffix="Panel" --check-execs'
124
125 Module FvwmButtons ApplicationPanel
126
127 # Bottom button {{{1
128 All (FvwmButtons-Bottom) Close
129 DestroyModuleConfig FvwmButtons-Bottom: *
130 PipeRead 'echo *FvwmButtons-Bottom: Geometry 60x$(((((((((((((($trayer_width))/24))-1))/2))+1))*30))+150))+0-0'
131 *FvwmButtons-Bottom: BoxSize smart
132 *FvwmButtons-Bottom: ActiveColorset $[infostore.cs_panel_active]
133 *FvwmButtons-Bottom: Colorset $[infostore.cs_panel_inactive]
134 #*FvwmButtons-Bottom: Colorset $[infostore.cs_transparent]
135 *FvwmButtons-Bottom: Columns 2
136 *FvwmButtons-Bottom: Padding 2 2
137 *FvwmButtons-Bottom: Frame 0
138 *FvwmButtons-Bottom: Font "xft:$[panel_font]:pixelsize=$[panel_font_size]:$[panel_font_style]"
139
140 # Notification aera {{{2
141 # We use fixed sizes
142 # Settings of stalonetray
143 Test (!EnvMatch trayer_width 0) \
144 PipeRead 'if [ "$[infostore.NotificationAreaManager]" = "stalonetray" ]; then echo FvwmStalonePanel \
145 30 2 $(((((((($[trayer_width]/24))-1))/2))+1)) "+0" "-+150" NE 60 $(((((((((((($trayer_width))/24))-1))/2))+1))*30)) "+0" "-+150"; fi'
146 # Settings of trayer
147 Test (!EnvMatch trayer_width 0) \
148 PipeRead 'if [ "$[infostore.NotificationAreaManager]" = "trayer" ]; then echo FvwmTrayerPanel \
149 pixel pixel $(((((((((((($trayer_width))/24))-1))/2))+1))*30)) bottom left 0 "150" \\"--width 60\\"; fi'
150 # The button
151 Test (!EnvMatch trayer_width 0) \
152 PipeRead 'if [ "$[infostore.NotificationAreaManager]" = "stalonetray" ]; then echo "*FvwmButtons-Bottom: (2x$(((((((($trayer_width/24))-1))/2))+1)), \
153 Size 60 $(((((((((((($trayer_width))/24))-1))/2))+1))*30)), Swallow (Close, Respawn, FvwmModule) FvwmStalonePanel Nop)"; \
154 else echo "*FvwmButtons-Bottom: (2x$(((((((($trayer_width/24))-1))/2))+1)), Size 60 $(((((((((((($trayer_width))/24))-1))/2))+1))*30)), \
155 Swallow (UseOld, FvwmModule) trayer Nop)"; fi'
156
157 # Clock {{{2
158 *FvwmButtons-Bottom: (2x1, Size 60 24, \
159 Swallow (Close, Respawn, FvwmModule) "FvwmScript-Clock" 'Script components/scripts/FvwmScript-Clock', \
160 Action (Mouse 3) SendToModule *FvwmScript-Clock SendString 1 1 str)
161
162 # Main music button , with some menus {{{2
163 *FvwmButtons-Bottom: (1x1, Size 22 22, Icon "22x22/categories/Multimedia.png", \
164 Action (Mouse 1) Menu /Player $[MenuPosition_E], \
165 Action (Mouse 2) Music-GUI, \
166 Action (Mouse 3) Music-QJackGUI, \
167 Action (Mouse 4) Change-Volume-Up $[infostore.Vol_Step], \
168 Action (Mouse 5) Change-Volume-Down $[infostore.Vol_Step])
169 # music controls button {{{2
170 *FvwmButtons-Bottom: (1x1, Size 22 22, Icon "22x22/fvwm-crystal/media-eject.png", \
171 Action (Mouse 1) Menu /Playlist-button $[MenuPosition_E], \
172 Action (Mouse 2) Menu /Music/Volume $[MenuPosition_E], \
173 Action (Mouse 3) Menu /Mixer $[MenuPosition_E], \
174 Action (Mouse 4) Music-Next, \
175 Action (Mouse 5) Music-Prev)
176 # music controls button {{{2
177 *FvwmButtons-Bottom: (1x1, Size 22 22, Icon "22x22/fvwm-crystal/media-playback-start.png", \
178 Action (Mouse 1) Music-Play, \
179 Action (Mouse 2) Music-Pause, \
180 Action (Mouse 3) Menu /Playback $[MenuPosition_E], \
181 Action (Mouse 4) Music-Speed-Up, \
182 Action (Mouse 5) Music-Speed-Down)
183 # music controls button 4 {{{2
184 *FvwmButtons-Bottom: (1x1, Size 22 22, Icon "22x22/fvwm-crystal/media-skip-forward.png", \
185 Action (Mouse 1) Menu /Speed $[MenuPosition_E], \
186 Action (Mouse 4) Button-Seek-+, \
187 Action (Mouse 5) Button-Seek--)
188
189 # CpuFreq {{{2
190 *FvwmButtons-Bottom: (2x1, Size 60 24, Swallow (Close, Respawn, FvwmModule) FvwmScript-CpuFreq)
191 Script components/scripts/FvwmScript-CpuFreq-small
192
193 # CpuTemp {{{ 2
194 *FvwmButtons-Bottom: (2x1, Size 60 24, Swallow (Close, Respawn, FvwmModule) FvwmScript-CpuTemp)
195 Script components/scripts/FvwmScript-CpuTemp
196
197 # Pager button {{{2
198 # PipeRead 'echo \*FvwmButtons-Bottom: (2x1, Size 60 30, Icon "22x22/fvwm-crystal/user-desktop.png", \
199
200 *FvwmButtons-Bottom: (2x1, Size 60 30, Icon "22x22/fvwm-crystal/user-desktop.png", \
201 Action (Mouse 2) GotoPage prev, \
202 Action (Mouse 3) GotoPage next, \
203 Action (Mouse 4) GotoPage-Right, \
204 Action (Mouse 5) GotoPage-Left, \
205 Panel (position Button left 70p 30p) FvwmPager "Module FvwmPager")
206
207 # Pager window {{{2
208 DestroyFunc FvwmPagerWindow
209 AddToFunc FvwmPagerWindow
210 + I KillModule FvwmPager
211 + I DestroyModuleConfig FvwmPager: *
212 + I PipeRead 'echo \*FvwmPager: Geometry $((60*$[infostore.Desk_Pages_X]))x$((60*$[infostore.Desk_Pages_Y]))+50000-+50000'
213 + I *FvwmPager: MiniIcons
214 + I *FvwmPager: Font none
215 + I *FvwmPager: WindowBorderWidth 1
216 + I *FvwmPager: Window3DBorders
217 #+ I *FvwmPager: NoSeparators
218 + I *FvwmPager: UseSkipList
219 + I *FvwmPager: Colorset * $[infostore.cs_panel_inactive]
220 + I *FvwmPager: HilightColorset * $[infostore.cs_panel_active]
221 #+ I *FvwmPager: Colorset $[infostore.cs_transparent]
222 #+ I *FvwmPager: HilightColorset $[infostore.cs_transparent]
223 + I *FvwmPager: WindowColorsets $[infostore.cs_panel_wininactive] $[infostore.cs_panel_winactive]
224 #+ I *FvwmPager: WindowColorset $[infostore.cs_transparent] $[infostore.cs_transparent]
225
226 FvwmPagerWindow
227
228 Module FvwmButtons FvwmButtons-Bottom
229
230 # Override FVWM style (it's applied later) {{{1
231 MenuStyle * PopupOffset 0 79
232 # Style * TitleAtRight
233
234 Echo /--------- Fvwm-Crystal: Recipe loaded ---------/
235 #PrintInfo infostore
236
237 # ViM modeline {{{1
238 # vim:foldmethod=marker:foldenable:foldlevel=0:ft=fvwm