Guest User

My fvwm config

a guest
Jun 17th, 2022
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.27 KB | None | 0 0
  1. # ____________________________
  2. # ( _________________________)
  3. # ) (__ _ _ _ _
  4. # ( __)( \/ )( \/\/ )/\/\
  5. # ) ( \ / \ // \
  6. # (___) \/ \/\/(_/\/\_) 3
  7. #
  8. # +-------------------------------+
  9. # | $HOME/.fvwm/config |
  10. # +-------------------------------+
  11. #
  12. # This config file is organized as follows:
  13. #
  14. # 1. Variables
  15. # 2. Functions
  16. # 3. Desktops & Pages
  17. # 4. Windows & Focus Styles
  18. # 5. Mouse & Key Bindings
  19. # 5a. Mouse Bindings
  20. # 5b. Key Bindings
  21. # 6. Menus
  22. # 7. Colors & Decors
  23. # 8. Modules
  24. # 9. Read additional files
  25. 
#####################################################################
  26. 
# +---------------------+
  27. # | 1. == VARIABLES == |
  28. # +---------------------+
  29. #
  30. # InfoStoreAdd can be used to store variable data internal to fvwm.
  31. # The variable can then be used in the configuration as $[infostore.name].
  32. # You can also use environment variables but for data internal to fvwm
  33. # use InfoStore variables instead.
  34. #
  35. InfoStoreAdd terminal "xterm"
  36. InfoStoreAdd browser "firefox"
  37. InfoStoreAdd mail "$[infostore.terminal] -e mutt"
  38. InfoStoreAdd editor "$[infostore.terminal] -e vim"
  39. InfoStoreAdd file_manager "pcmanfm"
  40. InfoStoreAdd launchcmd "rofi -show-icons -show drun"
  41. InfoStoreAdd runcmd "rofi -show-icons -show run"
  42. # Set ImagePath so Fvwm can look for custom images and icons.
  43. ImagePath $[FVWM_USERDIR]/icons:$[FVWM_USERDIR]/icons;.png:+
  44. 
# +---------------------+
  45. # | 2. == FUNCTIONS == |
  46. # +---------------------+
  47. #
  48. # Fvwm can use custom functions for various tasks.
  49. # The syntax for defining a function named FunctionName is:
  50. 
#################################################
  51. # DestroyFunc FunctionName #
  52. # AddToFunc FunctionName #
  53. # + I [Action to do Immediately] #
  54. # + C [Action to do on a Mouse Click] #
  55. # + D [Action to do on a Mouse Double Click] #
  56. # + H [Action to do on a Mouse Hold] #
  57. # + M [Action to do on a Mouse Motion] #
  58. #################################################
  59. 
# Function: StartFunction
  60. #
  61. # The start function is run right after fvwm is done reading
  62. # the config file. This function runs after each restart
  63. # so using Test (Init) or Test (Restart) can further control
  64. # actions that are run during the first time run (Init) or
  65. # actions that are run after a restart.
  66. DestroyFunc StartFunction
  67. AddToFunc StartFunction
  68. # Start a tmux session with h-split panes in a maximized window
  69. # + I Test (Init) TmuxSplitH
  70. # Set the wallpaper
  71. + I Test (Init) Exec exec nitrogen --restore
  72. 
# Function: TmuxSplitH
  73. #
  74. # Launch a tmux window that is already horizontally split in half
  75. DestroyFunc TmuxSplitH
  76. AddToFunc TmuxSplitH
  77. + I Exec exec $[infostore.terminal] -n "tmux" -T "tmux" \
  78. -e "tmux new-session\; split -h"
  79. + I Wait tmux
  80. + I Current Maximize
  81. # Function: CloseWindow
  82. #
  83. # Same as Close, but also warps the pointer to the title center of the
  84. # previous window on current desk.
  85. DestroyFunc CloseWindow
  86. AddToFunc CloseWindow
  87. + I Close
  88. + I Prev (CurrentDesk) WarpToWindow 50 2
  89. 
# Function : CenterWindow
  90. #
  91. # Easily center your window without any hardcoded screen height and width
  92. DestroyFunc CenterWindow
  93. AddToFunc CenterWindow
  94. + I ThisWindow PipeRead "echo AnimatedMove \
  95. $(( $[vp.width]/2-$[w.width]/2 ))p \
  96. $(( $[vp.height]/2-$[w.height]/2 ))p"
  97. 
# Function: MaximizeOrMove
  98. #
  99. # Double-click on a window's titlebar to maximize the window
  100. # Drag it around with a left click to move it.
  101. # Also raises the window.
  102. DestroyFunc MaximizeOrMove
  103. AddToFunc MaximizeOrMove
  104. + I Iconify off
  105. + I Raise
  106. + D Maximize
  107. + M Move
  108. 
# Function: AltMove
  109. #
  110. # Easily move a window around when pressing Alt and left-click hold
  111. # anywhere inside it. Also raises the window.
  112. DestroyFunc AltMove
  113. AddToFunc AltMove
  114. + I Iconify off
  115. + I Raise
  116. + M Move
  117. 
# Function: AltResize
  118. #
  119. # Easily start resizing a window when pressing Alt and right-click
  120. # hold anywhere inside it. Also raises the window.DestroyFunc AltResize
  121. AddToFunc AltResize
  122. + I Iconify off
  123. + I Raise
  124. + M Resize warptoborder automatic
  125. 
# Function: WindowList
  126. #
  127. # Let's extend built-in WindowList function, so that
  128. # the cursor warps to the title center of the new focused window
  129. AddToFunc WindowListFunc
  130. + I WarpToWindow !raise 50 2
  131. 
# Function: ViewManPage $0
  132. #
  133. # This function loads the man page $0 in a terminal
  134. # and is used with the help menu.
  135. DestroyFunc ViewManPage
  136. AddToFunc ViewManPage
  137. + I Exec exec $[infostore.terminal] -g 80x40 \
  138. -T "Manual Page - $0" -e "man "$0""
  139. 
# Function: WindowOps
  140. #
  141. DestroyFunc WindowOps
  142. AddToFunc WindowOps
  143. + I WarpToWindow 11 9
  144. + I Silent Menu MenuWindowOps
  145. 
# +---------------------------+
  146. # | 3. == DESKTOPS & PAGES == |
  147. # +---------------------------+
  148. #
  149. # Fvwm has both Virtual Desktops and Pages. Each Desktop is built from
  150. # a grid of Pages. The following sets the name of four Desktops and then
  151. # divides each Desktop into a 2x2 grid of Pages that are positioned as
  152. #
  153. # +---+---+
  154. # | | |
  155. # +---+---+
  156. # | | |
  157. # +---+---+
  158. #
  159. DesktopName 0 WorkDesktopName 1 Browser
  160. DesktopName 2 Chat
  161. DesktopName 3 Misc
  162. DesktopSize 2x2
  163. 
# Disable edge scrolling.
  164. EdgeResistance 450
  165. EdgeThickness -1
  166. Style * EdgeMoveDelay 200, EdgeMoveResistance 50
  167. 
# EwmhBaseStruts [screen name] [left] [right] [top] [bottom]
  168. # Reserves space along the edge(s) of the Screen that will not
  169. # be covered when maximizing or placing windows.
  170. EwmhBaseStruts screen $[monitor.primary] 20 20 20 20
  171. Style * EWMHDonateIcon
  172. 
# +----------------------------------+
  173. # | 4. == WINDOWS & FOCUS STYLES== |
  174. # +----------------------------------+
  175. #
  176. # Mouse and Cursor styles
  177. ClickTime 300
  178. MoveThreshold 3
  179. Style * SloppyFocus
  180. 
# Default Font
  181. DefaultFont "xft:Sans:Bold:size=14:antialias=True"
  182. 
# Make new windows grab focus and give up
  183. # focus to another window upon closing.
  184. Style * FPGrabFocus, FPReleaseFocus
  185. 
# Set position placement for new windows
  186. Style * MinOverlapPlacement
  187.  
  188. # Have Mwm-like move/resize feedback window
  189. Emulate Mwm
  190. 
# Configure transient windows
  191. Style * DontRaiseTransient, DontLowerTransient
  192. Style * DecorateTransient, !FPGrabFocusTransient
  193. 
# Make WindowShade "smoother" with clear animation
  194. Style * WindowShadeScrolls, WindowShadeBusy, WindowShadeSteps 60
# Sets all windows to OpaqueMove (vs a wired frame) and windows will
  195. # snap to each other and the edge of the screen.
  196. OpaqueMoveSize unlimited
  197. Style * ResizeOpaque, SnapAttraction 10 SameType ScreenAll
  198. 
# Ignore Numlock and other modifiers for bindings
  199. # See http://fvwm.org/documentation/faq/#why-do-numlock-capslock-and-scrolllock-interfere
  200. with-clicktofocus-andor-my-mouse-bindings
  201. IgnoreModifiers L25
  202. 
# Decor Styles
  203. Style * BorderWidth 5, HandleWidth 6, MwmButtons, FvwmBorder, DepressableBorder
  204. 
# Icon styles
  205. Style * IconOverride, IconSize 32 32
  206. 
# Application and module-specific Styles
  207. Style XTerm FixedPSize, ResizeHintOverride, MiniIcon 32x32/gant/terminal.png
  208. Style FvwmConsole FixedPSize, ResizeHintOverride, \
  209. MiniIcon 32x32/gant/terminal-special.png
  210. Style htop InitialMapCommand Maximize
  211. Style Pcmanfm EWMHMiniIconOverride, MiniIcon 32x32/gant/file-manager.png
  212. Style chromium EWMHMiniIconOverride, MiniIcon 32x32/gant/www.png
  213. Style firefox EWMHMiniIconOverride, MiniIcon 32x32/custom/firefox.png
  214. Style vlc EWMHMiniIconOverride, MiniIcon 32x32/custom/vlc.png
  215. 
Style Lutris PositionPlacement Center
  216. Style Discord StartsOnDesk 2, PositionPlacement Center
  217. Style KeePassXC StartsOnDesk 3, SkipMapping, PositionPlacement Center
  218. Style transmission-gtk StartsOnDesk 3, PositionPlacement Center
  219. 
Style "FvwmPager" Sticky, WindowListSkip, NoHandles
  220. Style "ConfirmQuit" !Title, PositionPlacement Center,\
  221. WindowListSkip, Layer 6
  222. 
# == Geometry Window ==
  223. # This is the window that shows geometry when moving/resizing windows,
  224. # so it's nice to have it big and clear for legibility.
  225. # Changes the default font - it's used for geometry window and overriden
  226. # everywhere else.
  227. DefaultFont "xft:Inconsolata:size=19:antialias=true"
  228. # Uncomment to hide geometry window for move action
  229. #HideGeometryWindow Move#
  230. # Window Font (used in title bars).
  231. WindowFont "xft:Inconsolata:size=19:antialias=true"
  232. 
# +----------------------------------+
  233. # | 5. == MOUSE & KEY BINDINGS == |
  234. # +----------------------------------+
  235. #
  236. # Mouse and Key bindings
  237. #
  238. # Contexts:
  239. # R = Root Window rrrrrrrrrrrrrrrrrrrrrr
  240. # W = Application Window rIrrrr<---------^rrrrr
  241. # F = Frame Corners rrrrrr[13TTTT642]rrrrr
  242. # S = Frame Sides rIrrrr[wwwwwwwww]rrrrr
  243. # T = Title Bar rrrrrr[wwwwwwwww]rrrrr
  244. # I = Icon rIrrrrv_________>rrrrr
  245. # rrrrrrrrrrrrrrrrrrrrrr
  246. #
  247. # Numbers are buttons: [1 3 5 7 9 TTTTT 0 8 6 4 2]
  248. #
  249. # Modifiers: (A)ny, (C)ontrol, (S)hift, (M)eta, (N)othing
  250. #
  251. # Format: Key <X> <Context> <Modifier> <Action>
  252. # Mouse <X> <Context> <Modifier> <Action>
  253. #
  254. # Silent suppresses any errors (such as keyboards with no Menu key).
  255. #
  256. #
  257. # +-------------------------+
  258. # | 5a. == KEY BINDINGS == |
  259. # +-------------------------+
  260. 
# Super + R to open the Root Menu.
  261. Silent Key R A 4 Menu MenuFvwmRoot
  262. 
# Alt-Tab to cycle through open windows.
  263. Silent Key Tab A M WindowList (CurrentDesk) Root c c NoDeskSort, NoGeometry,\
  264. NoNumInDeskTitle, CurrentAtEnd, SelectOnRelease Alt_L
  265. 
# Super + W to open WindowOps menu on a window
  266. Key W TW 4 Silent WindowOps
  267. 
# Super + Q to close active window.Key Q A 4 Silent CloseWindow
  268. 
# Super + M/F/C/S to toggle Maximize/Fullscreen/Center/Shade on a window
  269. Key M A 4 Silent Maximize
  270. Key F A 4 Silent Maximize fullscreen
  271. Key C A 4 Silent CenterWindow
  272. Key S A 4 Silent WindowShade
  273. 
# Super + 1/2/3/4 to go to desktop 1/2/3/4.
  274. Key 1 A 4 GotoDesk 0 0
  275. Key 2 A 4 GotoDesk 0 1
  276. Key 3 A 4 GotoDesk 0 2
  277. Key 4 A 4 GotoDesk 0 3
  278. 
# Super + Shift + 1/2/3/4 to move focused window to desktop 1/2/3/4.
  279. Key 1 A 4S Silent MoveToDesk 0 0
  280. Key 2 A 4S Silent MoveToDesk 0 1
  281. Key 3 A 4S Silent MoveToDesk 0 2
  282. Key 4 A 4S Silent MoveToDesk 0 3
  283. 
# Super + Enter to open infostored terminal.
  284. # Super + Shift+ Enter to launch maximized tmux window \
  285. inside infostored terminal with hsplit.
  286. Key Return A 4 Exec exec $[infostore.terminal]
  287. Key Return A 4S TmuxSplitH
  288. 
# Super + D to open infostored application launcher (eg. dmenu or rofi)
  289. Key D A 4 Exec exec $[infostore.launchcmd]
  290. 
# Super + Shift+ D to open infostored command runner (eg. dmenu or rofi)
  291. Key D A 4S Exec exec $[infostore.runcmd]
  292. 
# +---------------------------+
  293. # | 5b. == MOUSE BINDINGS == |
  294. # +---------------------------+
  295. # Window Buttons: [1 3 5 7 9 TTTTT 0 8 6 4 2]
  296. # 1 - Open the WindowOps menu.
  297. # 2 - Close on single click, Destory on double click.
  298. # 4 - Maximize (right/middle button will only maximize vertical/horizontal)
  299. # 6 - Iconify (minimize)
  300. #
  301. #
  302. # TitleBar: Click to Raise, Move, Double Click to Maximize
  303. # Mouse Wheel Up/Down to WindowShade On/Off# Borders: Click to raise, Move to Resize
  304. # Root Window: Right Click - Main Menu
  305. # Middle Click - Window List Menu
  306. # Right click TitleBar/Borders for WindowOps Menu
  307. #
  308. # RMB on root window to open the RootMenu
  309. Mouse 3 R N Menu MenuFvwmRoot
  310. Mouse 1 R N Nop
  311. 
# Alt + LMB anywhere on a window to begin a move operation
  312. Mouse 1 WT M AltMove
  313. 
# Alt + RMB anywhere on a window to begin a resize operation.
  314. # Best practice is to place cursor far away from window's center,
  315. # near a border or corner you want to resize the window to/from.
  316. Mouse 3 WT M AltResize
  317. 
# Alt + Middle MB anywhere on a window to Close it
  318. Mouse 2 WT M Silent CloseWindow
  319. 
# Double click on a window's title-bar to toggle Maximize
  320. Mouse 1 T N MaximizeOrMove
  321. 
# Right click on a window's title-bar to open the WindowOps menu
  322. Mouse 3 T N WindowOps
  323. 
# +-----------------+
  324. # | 6. == MENUS == |
  325. # +-----------------+
  326. #
  327. #MenuStyle * MenuColorset 5, ActiveColorset 6, GreyedColorset 7, TitleColorset 8
  328. MenuStyle * PopupImmediately, PopupOffset 0
  329. MenuStyle * HilightBack, HilightTitleBack, SeparatorsLong
  330. MenuStyle * TrianglesSolid, TrianglesUseFore
  331. MenuStyle * ItemFormat "%|%3.1i%5.3p%5.3l%5l%5r%5.3>%|"
  332. MenuStyle * Font "xft:Inconsolata:size=19:antialias=True"
  333. 
# Root Menu
  334. #
  335. # The root menu will PopUp with a click in the root window
  336. DestroyMenu MenuFvwmRoot
  337. AddToMenu MenuFvwmRoot "Root Menu" Title
  338. + "&1.Terminal%32x32/gant/terminal.png%" Exec exec $[infostore.terminal]
  339. + "&2.Browser%32x32/gant/www.png%" Exec exec $[infostore.browser]+ "&3.File Manager%32x32/gant/file-manager.png%" Exec exec $[infostore.file_manager]
  340. + "" Nop
  341. + "&4.FvwmConsole%32x32/gant/terminal-special.png%" Module FvwmConsole -terminal xterm
  342. + "&5.$[gt.Man Pages]%32x32/gant/help.png%" Popup MenuFvwmManPages
  343. + "" Nop
  344. + "&6.$[gt.Refresh]%32x32/gant/refresh.png%" Refresh
  345. + "&7.$[gt.Restart]%32x32/gant/restart.png%" Restart
  346. + "&8.$[gt.Quit]%32x32/gant/quit.png%" Module FvwmScript FvwmScript-ConfirmQuit
  347. 
# Window Operations Menus
  348. #
  349. DestroyMenu MenuWindowOps
  350. AddToMenu MenuWindowOps
  351. + "$[gt.Move]" Move
  352. + "$[gt.Resize]" Resize
  353. + "$[gt.(De)Iconify]" Iconify
  354. + "$[gt.(Un)Maximize]" Maximize
  355. + "$[gt.(Un)Shade]" WindowShade
  356. + "$[gt.(Un)Stick]" Stick
  357. + "" Nop
  358. + "$[gt.Close Window]" CloseWindow
  359. 
#DestroyMenu MenuIconOps
  360. #AddToMenu MenuIconOps
  361. #+ "$[gt.(De)Iconify]%icons/win/iconify.png%" Iconify
  362. #+ "$[gt.(Un)Maximize]%icons/win/max.png%" Maximize
  363. #+ "$[gt.(Un)Shade]%icons/win/shade.png%" WindowShade
  364. #+ "$[gt.(Un)Sticky]%icons/win/sticky.png%" Stick
  365. #+ "$[gt.(No)TitleBar]%icons/win/title.png%" Pick (CirculateHit) ToggleTitle
  366. #+ "$[gt.Send To]%icons/win/sendto.png%" Popup MenuSendTo
  367. #+ "" Nop
  368. #+ "$[gt.Close]%icons/win/close.png%" CloseWindow
  369. #+ "$[gt.Destroy]%icons/win/destroy.png%" Destroy
  370. #+ "" Nop
  371. #+ "$[gt.Raise]%icons/win/raise.png%" Raise
  372. #+ "$[gt.Lower]%icons/win/lower.png%" Lower
  373. #+ "" Nop
  374. #+ "$[gt.Stays On Top]%icons/win/top.png%" Pick (CirculateHit) Layer 0 6
  375. #+ "$[gt.Stays Put]%icons/win/stays.png%" Pick (CirculateHit) Layer 0 4
  376. #+ "$[gt.Stays On Bottom]%icons/win/bottom.png%" Pick (CirculateHit) Layer 0 2
  377. #+ "" Nop
  378. #+ "$[gt.Identify]%icons/info.png%" Module FvwmIdent
  379. 
#DestroyMenu MenuSendTo#AddToMenu MenuSendTo
  380. #+ "$[gt.Current]" MoveToCurrent
  381. #+ "$[gt.Page]" PopUp MenuSendToPage
  382. #+ "$[gt.Desk]" PopUp MenuSendToDesk
  383. #
  384. #DestroyMenu MenuSendToDesk
  385. #AddToMenu MenuSendToDesk
  386. #+ "$[gt.Desk] 0" MoveToDesk 0 0
  387. #+ "$[gt.Desk] 1" MoveToDesk 0 1
  388. #+ "$[gt.Desk] 2" MoveToDesk 0 2
  389. #+ "$[gt.Desk] 3" MoveToDesk 0 3
  390. 
#DestroyMenu MenuSendToPage
  391. #AddToMenu MenuSendToPage
  392. #+ "$[gt.Page] (0,0)" MoveToPage 0 0
  393. #+ "$[gt.Page] (0,1)" MoveToPage 0 1
  394. #+ "$[gt.Page] (1,0)" MoveToPage 1 0
  395. #+ "$[gt.Page] (1,1)" MoveToPage 1 1
  396. 
# Fvwm Man Pages (Help) Menu
  397. DestroyMenu MenuFvwmManPages
  398. AddToMenu MenuFvwmManPages "Help" Title
  399. + "fvwm3" ViewManPage fvwm3
  400. + "fvwm3all" ViewManPage fvwm3all
  401. + "FvwmAnimate" ViewManPage FvwmAnimate
  402. + "FvwmAuto" ViewManPage FvwmAuto
  403. + "FvwmBacker" ViewManPage FvwmBacker
  404. + "FvwmButtons" ViewManPage FvwmButtons
  405. + "FvwmCommand" ViewManPage FvwmCommand
  406. + "FvwmConsole" ViewManPage FvwmConsole
  407. + "FvwmEvent" ViewManPage FvwmEvent
  408. + "FvwmIconMan" ViewManPage FvwmIconMan
  409. + "FvwmIdent" ViewManPage FvwmIdent
  410. + "FvwmPager" ViewManPage FvwmPager
  411. + "FvwmPerl" ViewManPage FvwmPerl
  412. + "FvwmRearrange" ViewManPage FvwmRearrange
  413. + "FvwmScript" ViewManPage FvwmScript
  414. + "" Nop
  415. + "fvwm-root" ViewManPage fvwm-root
  416. + "fvwm-menu-desktop" ViewManPage fvwm-menu-desktop
  417. + "fvwm-menu-directory" ViewManPage fvwm-menu-directory
  418. + "fvwm-menu-xlock" ViewManPage fvwm-menu-xlock
  419. + "fvwm-config" ViewManPage fvwm-config
Advertisement
Add Comment
Please, Sign In to add comment