Debian Codegraph @

fvwm/recipes/LapRight with ACPI

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